Skip to main content

Document Generator, aka Doc As Code

Project description

Kouyierr (Arthouuur)

GitHub tag GitHub license PyPI pyversions CircleCI

Kouyierr

This project is basically a document generator (Doc As Code) focused on a few targets like invoices, timesheet, resume or documentation.

The initial goal was to avoid using Microsoft Wo@#$ and Ex@#$ to generate these recurrent documents, and to be able to add a little automation (of course we're lazy ^^).

Usage

This python module use click to facilitate cli calls, help is self-explanatory:

kouyierr --help
Usage: kouyierr [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  documentation
  invoice
  version

We use rich Python module to add some fancy console display as well:

richsample

Scope

With click module, we bundled several scope to make life easier

kouyierr documentation

This scope let you generate PDF documentaion file based on markdown document.

kouyierr documentation generate --help
Usage: kouyierr documentation generate [OPTIONS]

  Generate a new documentation from Markdown file based on TeX template

Options:
  --output-dir TEXT   Output directory, default=.
  --markdown TEXT     Markdown file path to use for documentation  [required]
  --output-file TEXT  Output PDF filename, default=output.pdf
  --template TEXT     TeX template file path
  --help              Show this message and exit.

It can be summoned simply like:

cd tests/org_sample
kouyierr documentation generate --markdown README.md --template template.tex

Sample files can be found in this repo in the unittest folder:

Generated file with these sample can also be found in this repo:

kouyierr invoice

This scope let you generate HTML/PDF invoice file based on YAML definition file and Jinja2 template.

kouyierr invoice generate --help
Usage: kouyierr invoice generate [OPTIONS]

  Generate a new invoice based on definition file and company template

Options:
  --output-dir TEXT      Output directory, default=.
  --company_config TEXT  Company config file  [required]
  --invoice_config TEXT  Invoice config file  [required]
  --invoice_id TEXT      Invoice ID, default=all
  --template TEXT        Template file path  [required]
  --help                 Show this message and exit.

It can be summoned simply like:

kouyierr invoice generate --company_config tests/org_sample/myfancycompany.yml --invoice_config tests/org_sample/nicecustomer.yml --template tests/org_sample/myfancycompany.html.j2 # for bulk mode for all invoices from this client
kouyierr invoice generate --company_config tests/org_sample/myfancycompany.yml --invoice_config tests/org_sample/nicecustomer.yml --template tests/org_sample/myfancycompany.html.j2 --invoice_id 202011_CUS # for specific invoice

Sample files can be found in this repo in the unittest folder:

Generated file with these sample can also be found in this repo:

kouyierr ghproject

This scope let you generate a markdown file with a review of all issues related to a Github project, grouped by column/category.

kouyierr ghproject generate --help
Usage: kouyierr ghproject generate [OPTIONS]

  Generate a changelog-lookalike .md file with all Github project issues grouped by category/column

Options:
  --output-dir TEXT  Output directory, default=.
  --user-token TEXT  Github personal access token used for authentication, use env_var for security reason  [required]
  --repo-owner TEXT  Github repository owner (user or organization)  [required]
  --repo-name TEXT   Github repository name  [required]
  --project TEXT     Github project name  [required]
  --help             Show this message and exit.

It can be summoned simply like:

kouyierr ghproject generate --user-token $GITHUB_PAT --repo-owner REPO_OWNER_OR_ORG --repo-name REPO_NAME --project MY_GITHUB_PROJECT

Generated sample file can also be found in this repo:

kouyierr resume

TODO

kouyierr timesheet

TODO

How to build

# create a virtual env
virtualenv venv

# activate virtual env 
source venv/bin/activate 

# run test and package
pip3 install .[test] --user --upgrade
pip3 install .\[test\] --user --upgrade # for ZSH users
python3 setup.py test

# install snapshot build
pip3 install . --user --upgrade

Releases

After a commit or merge on master circleci deploys kouyierr automatically on pypi

To install the release version from PyPi:

pip3 install kouyierr --upgrade --user

Or you can install local version as well:

git clone git@github.com:vmdude/kouyierr.git && cd kouyierr
pip3 install . --upgrade --user

Docker image

For our unittests we built a docker image with requirements for kouyierr. You can use it as well from this repo

docker pull vmdude/kouyierr-docker
docker run -it vmdude/kouyierr-docker

License

This project is licensed under the MIT License (see the LICENSE file for details).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kouyierr-0.0.12.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

kouyierr-0.0.12-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file kouyierr-0.0.12.tar.gz.

File metadata

  • Download URL: kouyierr-0.0.12.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8

File hashes

Hashes for kouyierr-0.0.12.tar.gz
Algorithm Hash digest
SHA256 6d92fc78843677f5b3059060cd40fcecca54700e15fc17fd1abf3a5fbf738b27
MD5 34f5b9631bffa2316a589c2edd60b536
BLAKE2b-256 74c1fbcac90a6bb0ff3d4376b73b3e4bf51ce766508e14bc71a2260feda18667

See more details on using hashes here.

File details

Details for the file kouyierr-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: kouyierr-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8

File hashes

Hashes for kouyierr-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 01c84612e436c9f16d9f65123c5652dccf2b1d4209eefcc2584f22f13dbab282
MD5 36ca7789f6c0dc0b5bb519f6ffdc923a
BLAKE2b-256 f604aa0260d3eae3297dc9a39eefb8b074a23477674127326b6cd408682e511e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page