Skip to content

One stop solution to all your file transformation needs!

License

Notifications You must be signed in to change notification settings

shridpant/danfe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

danfe


One stop solution to all your file transformation needs!

Table of Contents

About the Project

danfe, named after डाँफे, is a simple tool that helps to convert files/data structures from one type to another.

Installation

  1. Execute git clone https://github.com/shridpant/danfe.
  2. Add danfe to your PATH as follows:
    1. Temporary: Write export PATH=$PATH:/path/to/danfe to terminal.
    2. Permanent: Append export PATH=$PATH:/path/to/danfe to the end of your ~/.bashrc file. Finally, type source ~/.bashrc.
  3. And you're all set!
    ==== EXTRA ====
  4. (Additionally) Please ensure that you have the necessary permissions on your OS before running the program.
  5. (Additionally) Make danfe executable by running chmod +x danfe in the root directory of danfe.

Note: danfe requires Python 3 to run. No external dependencies are required, however.

Execution

Standalone

The command-line interface is simple and powerful. Transform your files with simple commands and perform get and/or save operations to the output.

Usage:

danfe [-h] [--version] [-v] [-q] [-s LOCATION] -t {list,dict,json,csv} FILENAME

required arguments:
FILENAME absolute or relative path to the argument file
-t {list,dict,json,csv}, --target {list,dict,json,csv} target file format or data structure to convert to
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
-v, --verbose enable verbose
-q, --quiet enable quiet mode
-s LOCATION, --save LOCATION absolute or relative path to save the output

Providing inputs and receiving outputs:

  • Inputs: In its present form, danfe can take .json, .csv and .ora files as inputs. Additionally, danfe is able to read some data structures (lists and dictionaries) provided as inputs through an extension-less file. Learn more about the inputs on the wiki.
  • Outputs: By default, danfe only prints the output to the command-line; enfore the quiet mode to prevent this. Exercising the -s LOCATION option should allow the users to save the output as any file type, to any location. To save to the current location, just append -s . to your command. Learn more about the outputs on the wiki.

Plug and Play

The source code of danfe is highly modularized and, thus, supports plug and play. Various parts of danfe may be separately reused for specific needs. Head over to src/convert to find the relevant conversion programs for your specific use cases.

Examples

Example 1: To simply display the output on the command-line.

Example 2: To save the output to the current directory you're in.

Note: In any case, the log file and the status file are stored in a temporary directory. The location of these files are printed on the command-line by default.

Contributing

This project welcomes contributions and suggestions. Feel free to fork this repository or submit your ideas through issues. Please carefully read and follow the Contributor Covenant Code of Conduct while participating in this project.

License

Distributed under the GNU General Public License v3.0 as published by the Free Software Foundation. See LICENSE for more information.

Contact

Feel free to hmu on my LinkedIn.

Acknowledgements

About

One stop solution to all your file transformation needs!

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages