This python cli app uses dynaconf to manage secrets and environment variables.
So that you can use your secrets and environment variables declared in settings.toml
or .settings.toml
, use the GITHUB
prefix value of envvar_prefix
declared in config.py.
Set up python package dependencies in pyproject.toml
:
rye sync
Activate virtualenv
:
. .venv/bin/activate
List all defined parameters:
rye run list-config
Validate the settings parameters:
rye run check-config
NOTE: dynaconf_validators.toml
must exist.
Export required environment variables:
export GITHUB_USER="<github-username>"
export GITHUB_AUTH_TOKEN="<github-auth-token>"
Run the cli:
github-rest-api -h
After install dynaconf via pip, run this commando to init a dynaconf project at the root of project:
dynaconf init
This will create the following files:
├── ./config.py
├── ./.gitignore
├── ./__pycache__
├── ./.secrets.toml
├── ./settings.toml
└── ./venv
List all defined parameters:
dynaconf -i config.settings list
To use github-rest-api.py cli, export the following environment variables:
export GITHUB_USER="<github-username>"
export GITHUB_AUTH_TOKEN="<github-auth-token>"