Skip to main content

Simplified invokation of typer apps from any directory.

Project description

typer-invoke

pypi Project License - MIT

Simplified invocation of typer apps from any directory.

The idea is that you place typer apps in a directory in your project and then you can invoke them from any directory.

Why?

The main use case is for project management that require custom scripts for various tasks. Wrapping those scripts as typer apps makes them easier to use. Making typer easier to use makes those scripts even easier to use.

An alternative to:

Versus Invoke

The main driver for this project is as a replacement for Invoke, which I've been using for a while and found the following limitations:

  • --help and --list options are clunky, in that they need to be placed right after the inv command, ex:
    inv --help some.task
    
    Here a more common pattern is used and --help acts as both help and list:
    inv some task --help
    
  • Lack of support. Some issues and features have been piling up for a while, and I'm not sure if they will ever be addressed. Seems like the project has had new development recently, though.
    Typer is widely used and has a lot of support.

Other advantages (in my opinion):

  • Prettier Developer experience counts. Other than more common usage patterns, Typer supports rich and Markdown formatting.
    Including using rich for logging, which is done in this project.
  • No dot . namespace Invoke uses a dot . namespace for tasks, which is not very common when running scripts.
    Typer follows a normal CLI pattern. Namespaces are Typer apps and are separated by a space.

Invoke is the inspiration for this project, hence the name typer-invoke and keeping the inv command name.

Cool things about Invoke

Invoke concepts and features I was using that are not native to this project, but the workarounds work well:

  • Task dependencies.
    In Invoke, it's easy to declare a task dependent on others and they will be executed in the correct order.
    While we don't have this feature, it's very easy to simply call other functions and end up with the same functionality.
  • Namespaces (task groups)
    You can declare namespaces and whatever tasks you want in them.
    The same is done in Typer by with apps. Each app added is the equivalent of a namespace.
    Usually, one app is in one file, but it's not a requirement.
  • Dry runs
    The --dry option in Invoke is very useful and available to all tasks.
    Typer doesn't have this feature, but it's easy to add. See the examples in this project, under the admin directory.

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

typer_invoke-0.2.0.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

typer_invoke-0.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file typer_invoke-0.2.0.tar.gz.

File metadata

  • Download URL: typer_invoke-0.2.0.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for typer_invoke-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d5f66a6194b58b4552e8fe0516bdfafad64d5ae93f8fd7ce6e40a3c0c55282ec
MD5 9630a6e40bffe2a6fba92728329efde7
BLAKE2b-256 30e1c909d90034248f563813b4efed0ac7a17598cd261aeaf3280c13913cbc7e

See more details on using hashes here.

File details

Details for the file typer_invoke-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: typer_invoke-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for typer_invoke-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22a616a0dc0b41ae3e3655bfc94a7016e5db41611f252197570258604c0f283d
MD5 1911bbac2937e80251e2f5a74c109ff5
BLAKE2b-256 c7a0b1d638bcb670229b6a934ad8d2fbce83c53a04a5889da966dcf82d7f4d11

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