daner
install
pip install daner
example
simple usage
from daner import dong
# command
# python manage.py hi --name milisp
@dong()
async def hi(name: str):
print(name)
# command
# python manage.py hi -u milisp
# alias u=username
@dong(alias={"u": "username"})
async def create(username: str):
print(username)
# command
# python manage.py greet --name milisp
# if you want to run a sync function
@dong(sync=True)
def greet(name):
print(name)
create superuser
# manage.py
# createsuperuser
# $ python manage.py createsuperuser -u username -e email
from daner import dong
import databases
import getpass
import ormar
import sqlalchemy
import uvicorn
DB_URI = "sqlite:///fast.db"
database = databases.Database(DB_URI)
engine = sqlalchemy.create_engine(DB_URI)
metadata = sqlalchemy.MetaData()
metadata.create_all(engine)
class User(ormar.Model):
class Meta(ormar.ModelMeta):
metadata = metadata
database = database
id = ormar.Integer(primary_key=True)
username = ormar.String(max_length=60, unique=True)
password = ormar.String(max_length=2048)
email = ormar.String(max_length=80, nullable=True, unique=True)
@dong(alias={"u": "username", "e": "email"})
async def createsuperuser(username: str, email: str = None):
await database.connect()
password = getpass.getpass("password: ")
password = "hashed" + password
await User(
username=username,
password=password,
email=email,
is_superuser=True,
).save()
await database.disconnect()
Metadata
Release files for daner 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| daner-0.0.3.tar.gz | 3.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| daner-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.0 kB
Release files / daner-0.0.3.tar.gz
| Download URL | daner-0.0.3.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e9f3a6cdfb1557f84c363221f1a41d064493a8074bd1871d00574c7855f9ec9
|
|
BLAKE2b-256 checksum How to use checksums |
c6392c0616bac17bd55d52b864c496e8bb3dc92148b523de5ad985013f0ccce0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / daner-0.0.3-py3-none-any.whl
| Download URL | daner-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
012fa1e42f459da1fff65c5d1f496766920e600b3b01fe9823964669a2b1bf58
|
|
BLAKE2b-256 checksum How to use checksums |
96274529c5280d856e0dfb876c7cac6f61f481c8f421e66eb35bd6ffbf8a7dbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Security for daner 0.0.3
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.