Convert any data type to any data type.
Examples:
- Convert json to yaml:
lcad convert --from json --to yaml --input-file file.json
- Display a yaml file as a table:
lcad convert --from yaml --to tabulate --input-file file.json
Supported formats:
This table shows what format lcad can read (input) and write (output).
| format | input | output | notes |
|---|---|---|---|
json |
✅ | ✅ | |
yaml |
✅ | ✅ | |
csv |
✅ | ✅ | |
pandas |
❌ | ✅ | https://pandas.pydata.org/ |
tabulate |
❌ | ✅ | https://pypi.org/project/tabulate/ |
vertical |
❌ | ✅ | a kind of vertical formatting |
py |
✅ | ✅ | raw Python |
pickle |
✅ | ✅ | serialized Python |
lines |
✅ | ✅ | a list, one element per line |
make
make install
- Extra tip: add shell aliases
alias py2json="lcad convert --from py --to json"
alias py2yaml="lcad convert --from py --to yaml"
alias json2py="lcad convert --from json --to py"
alias json2yaml="lcad convert --from json --to yaml"
alias yaml2json="lcad convert --from yaml --to json"
alias yaml2py="lcad convert --from yaml --to py"
alias yaml2csv="lcad convert --from yaml --to csv"
alias csv2yaml="lcad convert --from csv --to yaml"
alias yaml2lines="lcad convert --from yaml --to lines"
alias lines2yaml="lcad convert --from lines --to yaml"
PYTHONPATH=. python ./bin/lcad_bin.py
make clean
make tests
- pytest tip: Add
--capture=noto seeprint()statements
make doc
The generated doc is available at doc/index.html.
- Create release branch
- Update version in
lcad/__init__.py - Pin versions in
requirements.txt - Execute tests with
make clean tests - Merge into master
- tag with
git tag ... - push the work with
git push && git push --tags - Install locally with
make install - Update version in
lcad/__init__.pytomaster