Enhanced Invoke task management with simplified namespacing support
Project description
Invocate
Enhanced Invoke task management with simplified namespacing support.
Purpose
I love Invoke and I use it all the time, but I find the namespace feature to be a bit cumbersome to maintain so I've written Invocate as a wrapper on top of Invoke.
Invocate overrides the task decorator to accept additional namespace-related parameters and defines a task_namespace() function that makes namespacing task a lot easier to work with.
Features
- Namespaced Tasks: Organize tasks into hierarchical namespaces
- Enhanced Decorator: Drop-in replacement for
@taskwith additional features
Installation
pip install invocate
Quick Start
from invocate import task
# Simple task (no namespace)
@task
def hello(c):
"""Say hello"""
print("Hello, World!")
# Namespaced task
@task(namespace=('build', 'frontend'))
def build_js(c):
"""Build JavaScript assets"""
c.run("npm run build")
# Another namespaced task
@task(namespace='build.backend')
def build_python(c):
"""Build Python package"""
c.run("python -m build")
Save this as tasks.py and run:
invocate -l
You'll see:
Available tasks:
hello
build.frontend.build-js
build.backend.build-python
Advanced Usage
Customer Task Names
@task(name='custom-name', namespace=('utils',))
def some_function(c):
pass
API Reference
task(*args, **kwargs)
Enhanced task decorator with namespace support. Parameters:
- (tuple): Namespace hierarchy as tuple of strings
namespace - Standard invoke task parameters (name, help, etc.)
task_namespace()
Returns the complete task collection for use with Invoke.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file invocate-0.2.1.tar.gz.
File metadata
- Download URL: invocate-0.2.1.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
631f3a2262a7290164f9b24156f9436151c81593ce4872bb86e3784f3585c2c0
|
|
| MD5 |
69ef6a71c7c2b9693ae58cd9c5a8bcec
|
|
| BLAKE2b-256 |
b89f46f6d800838a005fe5957f80fedc8dda022f99a62200037c1fc9bb1a9b79
|
File details
Details for the file invocate-0.2.1-py3-none-any.whl.
File metadata
- Download URL: invocate-0.2.1-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c880afdd57336fd949cfc70675cadeb66c4fb2bc10bba6b82140a4db1cd8a53b
|
|
| MD5 |
56e88a80591069d5e4f61c34b79bc66b
|
|
| BLAKE2b-256 |
97449db7e48e1cc02280ff01a2d7beb65f2ebc29d766e6e9e428edf641a89026
|