geny
An extendable file generator
Installation
Install via pip:
pip install geny
After installation, the CLI will expose the binary with the name:
geny
Extending the CLI
Currently, there are two main ways of extending the functionality of the CLI:
- Adding your own commands/plugins
- Overriding the provided resource templates
Including your own commands
If you would like to extend the functionality of this CLI, you can include your own plugins/commands by
setting an environment variable: GENY_PLUGINS. Simply set this variable to the path where your plugins are.
Plugin commands are auto-discovered if they are placed under the plugins directory, but please be sure to do the following for this to work:
- Name your package and click command the same. That is, a package called
get, for example, should define agetcommand. - Place the command definition within the package's
main.pymodule. For example:
# get/main.py
import click
@click.command()
@click.pass_context
def get(ctx):
pass
- Sub-commands should be added to the top-most command group in the package's
main.pymodule.
# get/main.py
import click
@click.group() # <- group
@click.pass_context
def get(ctx):
pass
@click.command()
@click.pass_context
def foo(ctx):
pass
get.add_command(foo)
- Access your commands via your top-most command group.
geny get foo
NOTE: If you would like to skip a plugin/command from being auto-discovered, simply rename the package by either
prepending or appending any number of underscores (_). Any code contained within the package will be ignored.
Overriding the templates
The flag --templates-dir can be used to configure an additional path wherein the CLI can look for resource templates.
Alternatively, you can use the environment variable GENY_TEMPLATES_DIR for the same purpose.
Development
Install from source:
git clone https://github.com/oleoneto/geny.git
cd geny
pip install --editable .
Dependencies
Check out pyproject.toml for all installation dependencies.
To Do
Pull requests
Found a bug? See a typo? Have an idea for new command? Feel free to submit a pull request with your contributions. They are much welcome and appreciated.
LICENSE
geny is BSD Licensed.
Release files for geny 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geny-0.1.8.tar.gz | 14.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geny-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.1 kB
Release files / geny-0.1.8.tar.gz
| Download URL | geny-0.1.8.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b717de4417a49af4d0d6c7648d424348a690d5807c9b568f7d7c21a4c671bf9f
|
|
BLAKE2b-256 checksum How to use checksums |
21bebc34a22cca08a24ae9041dc03ea0b4698d76f305e53ababe3d2c3a3d1833
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / geny-0.1.8-py3-none-any.whl
| Download URL | geny-0.1.8-py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e41e19e50b404be5f6a26f92d30d2b5ceb1c88ee967ebffcae9838f79ca23a0
|
|
BLAKE2b-256 checksum How to use checksums |
81851efc3600faa517ed73b2c07696dbd71783dfda857cf5a68f163eed21a58c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|