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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f2df39c4e86afced0b506d29f35c76837af75e8627d848f434dfcc334cafb8b
|
|
| MD5 |
69cd6a6707c19827469b4b3a2e201d3f
|
|
| BLAKE2b-256 |
7f514699dbf3d6d15d4a85786a2d7f8216192209b2d6d26f725fdab9a0f36c91
|
Provenance
The following attestation bundles were made for myfy_commands-0.1.2a94.tar.gz:
Publisher:
publish.yml on psincraian/myfy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
myfy_commands-0.1.2a94.tar.gz -
Subject digest:
8f2df39c4e86afced0b506d29f35c76837af75e8627d848f434dfcc334cafb8b - Sigstore transparency entry: 813981005
- Sigstore integration time:
-
Permalink:
psincraian/myfy@f8f5d874325bdb62aa606f869ed73ae8947876b8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/psincraian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f8f5d874325bdb62aa606f869ed73ae8947876b8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file myfy_commands-0.1.2a94-py3-none-any.whl.
File metadata
- Download URL: myfy_commands-0.1.2a94-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51da99e95d13418abd3a7ae2944538a5954be41a3a5b6916732a8fab18f8c2c8
|
|
| MD5 |
c4f796fb83b63fff1e0b6339fb6ab70d
|
|
| BLAKE2b-256 |
068046fc2d1c6e0037b2b0ff7dcd5f923d3a0249c79ccf5a8f8ddb19de66563a
|
Provenance
The following attestation bundles were made for myfy_commands-0.1.2a94-py3-none-any.whl:
Publisher:
publish.yml on psincraian/myfy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
myfy_commands-0.1.2a94-py3-none-any.whl -
Subject digest:
51da99e95d13418abd3a7ae2944538a5954be41a3a5b6916732a8fab18f8c2c8 - Sigstore transparency entry: 813981007
- Sigstore integration time:
-
Permalink:
psincraian/myfy@f8f5d874325bdb62aa606f869ed73ae8947876b8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/psincraian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f8f5d874325bdb62aa606f869ed73ae8947876b8 -
Trigger Event:
push
-
Statement type: