One stop solution to all your file transformation needs!
danfe
, named after डाँफे, is a simple tool that helps to convert files/data structures from one type to another.
- Execute
git clone https://github.com/shridpant/danfe
. - Add
danfe
to your PATH as follows:- Temporary: Write
export PATH=$PATH:/path/to/danfe
to terminal. - Permanent: Append
export PATH=$PATH:/path/to/danfe
to the end of your~/.bashrc
file. Finally, typesource ~/.bashrc
.
- Temporary: Write
- And you're all set!
==== EXTRA ==== - (Additionally) Please ensure that you have the necessary permissions on your OS before running the program.
- (Additionally) Make
danfe
executable by runningchmod +x danfe
in the root directory ofdanfe
.
Note: danfe
requires Python 3 to run. No external dependencies are required, however.
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.
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.
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.
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.
Distributed under the GNU General Public License v3.0 as published by the Free Software Foundation. See LICENSE for more information.
Feel free to hmu on my LinkedIn.
- io
- re
- ast
- csv
- json
- argparse
- textwrap
- Adobe Photoshop Express
- Wikipedia: The image was obtained under the Creative Commons Attribution-Share Alike 4.0 International. Therefore, the modified image is also distributed under the same license.
- Inskipp C., Baral H. S., Phuyal S., Bhatt T. R., Khatiwada M., Inskipp, T, Khatiwada A., Gurung S., Singh P. B., Murray L., Poudyal L. and Amin R. (2016) The status of Nepal's Birds: The national red list series. Zoological Society of London, UK. Vol 1 Page 75-79