Skip to main content

pyinvoke

pyinvoke is a simple module that is used to invoked Python applications using a full function specifier, similar to distlib entrypoints.

The key advantage is that the Python application you want to run will be loaded as its proper module instead of as the __main__ module. pyinvoke will be the __main__ module for this operation.

One of the motivating cases where pyinvoke comes in handy is the following:

$ python -m module.main
Traceback (most recent call last):
  File "module/main.py", line 7, in <module>
    from .stuff import ham
SystemError: Parent module '' not loaded, cannot perform relative import

To run the application with pyinvoke:

$ python3 -m pyinvoke module.main:main

Applications that depend on restarting can read the original commandline from sys.__argv__:

argv = getattr(sys, '__argv__', sys.argv)

Copyright © 2018 Niklas Rosenstein

Metadata

Release files for pyinvoke 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyinvoke 1.0.4
File Size Uploaded Provenance Actions
pyinvoke-1.0.4.tar.gz 2.6 kB Without provenance Details for pyinvoke-1.0.4.tar.gz

Release files / pyinvoke-1.0.4.tar.gz

Download URL pyinvoke-1.0.4.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0b96de9e8ed5b6d681bc761ed6758087998b1a84f84b09811f7d5401d64dea7e
BLAKE2b-256 checksum
How to use checksums
ebd3da06f4cfa461c18c4fa8f5621b9c408c3d16829b450998684f332753978a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.4

Security for pyinvoke 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page