Skip to main content

An extendable file generator

Project description

geny

An extendable file generator

publish PyPI - Package PyPI - Python PyPI - License PyPI - Downloads

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:

  1. Adding your own commands/plugins
  2. 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:

  1. Name your package and click command the same. That is, a package called get, for example, should define a get command.
  2. Place the command definition within the package's main.py module. For example:
# get/main.py
import click


@click.command()
@click.pass_context
def get(ctx):
    pass
  1. Sub-commands should be added to the top-most command group in the package's main.py module.
# 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)
  1. 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

Check out our open issues.

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.

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

geny-0.1.1.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geny-0.1.1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file geny-0.1.1.tar.gz.

File metadata

  • Download URL: geny-0.1.1.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for geny-0.1.1.tar.gz
Algorithm Hash digest
SHA256 301fd81f1dbae4be2d02ce8f1097eab9db21d3bacbe8efa3d9ba1d97336d2a4e
MD5 89295f701f80f02b10d1b85d203b06c4
BLAKE2b-256 29ecf367db1210812ce84118b28ce58024fb30a94281bf595283d2fd0b2eaa22

See more details on using hashes here.

File details

Details for the file geny-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: geny-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for geny-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e0818f6a3d3b7be687c71d116b223357da43e64a98e911e26534e171b7655d6
MD5 23557617f5710e940e32f61bea7f54b3
BLAKE2b-256 6f78a413738aa9a5e368d79a7b3902107ddcc46d036282e4c91b8b908f27c400

See more details on using hashes here.

Supported by

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