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.2a94.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.2a94-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: myfy_commands-0.1.2a94.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.2a94.tar.gz
Algorithm Hash digest
SHA256 8f2df39c4e86afced0b506d29f35c76837af75e8627d848f434dfcc334cafb8b
MD5 69cd6a6707c19827469b4b3a2e201d3f
BLAKE2b-256 7f514699dbf3d6d15d4a85786a2d7f8216192209b2d6d26f725fdab9a0f36c91

See more details on using hashes here.

Provenance

The following attestation bundles were made for myfy_commands-0.1.2a94.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.2a94-py3-none-any.whl.

File metadata

File hashes

Hashes for myfy_commands-0.1.2a94-py3-none-any.whl
Algorithm Hash digest
SHA256 51da99e95d13418abd3a7ae2944538a5954be41a3a5b6916732a8fab18f8c2c8
MD5 c4f796fb83b63fff1e0b6339fb6ab70d
BLAKE2b-256 068046fc2d1c6e0037b2b0ff7dcd5f923d3a0249c79ccf5a8f8ddb19de66563a

See more details on using hashes here.

Provenance

The following attestation bundles were made for myfy_commands-0.1.2a94-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