- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| .gitignore | ||
| cspvtocsv.py | ||
| README.md | ||
Comma Seperated Python Values
A CSPV file is essentially a CSV file except that values may be python commands, as interpreted using the Pandas library. The script reads a CSPV file as input and then outputs a CSV file where the results from the pandas equations overwrite the original expressions. This allows for the use of OpenDocument Spreadsheet inspired equations embedded within a CSV while still maintaining the advantages of plain text, including the ability to easily track changes in git.
Usage
Simply run the script using the flag -f or --file to specify input CSPV file name and optionally -o or --ouput to specify output CSV file name. If no output file flag is provided, it will output the file to the same file name as input, except with the extension changed to .csv. It is not required for the input file to follow the implied .cspv extension, and .csv may be preffered to allow for CSV preview usage built into certain IDE programs.
Example
python cspvtocsv.py -f '.test.cspv' -o 'test.csv'
Using with workflows
An example workflow has been provided for how to monitor changes to .cspv. files an run the program on changed files.