Skip to content

SamK/lcad

Repository files navigation

lcad: Load, convert and dump

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

Install

Install as a binary file

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"

Execute locally

PYTHONPATH=. python ./bin/lcad_bin.py

Development

Execute tests

make clean
make tests
  • pytest tip: Add --capture=no to see print() statements

Build the doc

make doc

The generated doc is available at doc/index.html.

Release

  1. Create release branch
  2. Update version in lcad/__init__.py
  3. Pin versions in requirements.txt
  4. Execute tests with make clean tests
  5. Merge into master
  6. tag with git tag ...
  7. push the work with git push && git push --tags
  8. Install locally with make install
  9. Update version in lcad/__init__.py to master

About

Load, convert and dump

Resources

Stars

Watchers

Forks

Packages

No packages published