Skip to main content

CLI commands module for myfy framework

Project description

myfy-commands

CLI commands module for the myfy framework.

Installation

pip install myfy-commands

Usage

from myfy.core import Application
from myfy.commands import CliModule, cli

@cli.command()
async def seed_users(user_service: UserService, count: int = 10):
    """Seed the database with test users."""
    for i in range(count):
        await user_service.create(f"user{i}@example.com")

app = Application()
app.add_module(CliModule())

Run commands with:

myfy app seed-users --count 20

Command Groups

from myfy.commands import cli

db = cli.group("db")

@db.command()
async def seed(db: Database):
    """Seed the database."""
    await db.seed()

@db.command()
async def reset(db: Database, force: bool = False):
    """Reset the database."""
    if force:
        await db.reset()

Run grouped commands:

myfy app db:seed
myfy app db:reset --force

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

myfy_commands-0.1.2a90.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

myfy_commands-0.1.2a90-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file myfy_commands-0.1.2a90.tar.gz.

File metadata

  • Download URL: myfy_commands-0.1.2a90.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for myfy_commands-0.1.2a90.tar.gz
Algorithm Hash digest
SHA256 b46ea6c70073f977a008d802ff198dae54238a4557b8422af2f2677808a54db1
MD5 fc2560e3b1cc12b6900aa84269b6db93
BLAKE2b-256 5556265db6bcb4e628058a6d48b1d1a5489f00d5f6195d0e0b7a92ec8d2ec5a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for myfy_commands-0.1.2a90.tar.gz:

Publisher: publish.yml on psincraian/myfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file myfy_commands-0.1.2a90-py3-none-any.whl.

File metadata

File hashes

Hashes for myfy_commands-0.1.2a90-py3-none-any.whl
Algorithm Hash digest
SHA256 2e1487e97d89e29e92e52646bc719ba2305737675c2d270164e3c8441dbd8761
MD5 38c767f464e8eda1f6266698d57cd288
BLAKE2b-256 2660fe8cebc8233d923ae7e0854a72a720c5f3e19de139fc3a57e813ad74662a

See more details on using hashes here.

Provenance

The following attestation bundles were made for myfy_commands-0.1.2a90-py3-none-any.whl:

Publisher: publish.yml on psincraian/myfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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