Skip to main content

django-subcommandir

GitHub Actions PyPI PyPI - Python Version framework - Django PyPI - Django Version PyPI - License

Django subcommands in subdirectories

Installation

$ pip install django-subcommandir

Example of usage

my_app
├── ...
├── management
│   ├── commands
│   │   ├── __init__.py
│   │   ├── load
│   │   │   ├── __init__.py
│   │   │   ├── month_report.py
│   │   │   └── year_report.py
│   │   ├── my_app_load.py
│   ├── __init__.py
# .../management/commands/my_app_load.py
from subcommandir import BaseCommand

class Command(BaseCommand):
    subcommand_dir = 'load'
# .../management/commands/load/month_report.py
from django.core.management.base import BaseCommand

class Command(BaseCommand):
    def add_arguments(self, parser):
        parser.add_argument('--start', ...)
        ...

    def handle(self, *args, **options):
        ...

Command calls:

$ python manage.py my_app_load year_report
$ python manage.py my_app_load month_report --start="2021-01" --end="2021-02"

or

from django.core.management import call_command

def load_year_report():
    call_command('my_app_load', 'year_report')
    
def load_month_report():
    call_command('my_app_load', 'month_report', start=...)

License

MIT

Metadata

Release files for django-subcommandir 0.3.0

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

Source distribution (sdist)

Source distribution for django-subcommandir 0.3.0
File Size Uploaded Provenance
django-subcommandir-0.3.0.tar.gz 4.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-subcommandir 0.3.0
File Interpreter ABI Platform
django_subcommandir-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / django-subcommandir-0.3.0.tar.gz

Download URL django-subcommandir-0.3.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8e728ee7742979e459998df4dacad11f9ca0122c03aaf4c3c254dc0a401dfcf2
BLAKE2b-256 checksum
How to use checksums
cfe6da6839851d0dcafdd73a44d05b497dd486c3387dd1eeafd504fcdbb7356e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / django_subcommandir-0.3.0-py3-none-any.whl

Download URL django_subcommandir-0.3.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37e1de71fb1ba677b547d699a871c2a454cec6f533ed7d2af3478a89055282f8
BLAKE2b-256 checksum
How to use checksums
4b37ae87ebd47836176e5791357c84dd70c8c9640c925b454c38536c65e36790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for django-subcommandir 0.3.0

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.

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