DuckORM
The Duck-ORM package is an asynchronous ORM for Python, with support for Postgres and SQLite. ORM is built with:
Requirements: Python 3.8+
Duck-ORM is still under development.
Installation
$ pip install duck-orm
!!! note
Don't forget to install databases before installing duck-orm.
Quickstart
For this example we will create a connection to the SQLite database and create a model.
$ pip install databases[sqlite]
$ pip install ipython
Note that we want to use ipython here, because it supports using await expressions directly from the console.
Creating the connection to the SQLite database:
from databases import Database
from duck_orm.model import Model
db = Database('sqlite:///example.db')
await db.connect()
Defining a model:
from duck_orm.sql import fields as Field
class Person(Model):
__tablename__ = 'persons'
__db__ = db
id: int = Field.Integer(primary_key=True, auto_increment=True)
first_name: str = Field.String(unique=True)
last_name: str = Field.String(not_null=True)
age: int = Field.BigInteger(min_value=18)
# Table creation in the database.
await Person.create()
- The
__tablename__attribute is used to define the table's name in the database. - The
__db__attribute is the instance of the database connection. - And then the definition of the fields, their types and restrictions.
- And finally, the table creation in the database.
Author
- Rich Ramalho - @richecr - @richzinho_ecr
License
DuckORM is built as an open-source tool and remains completely free(MIT license).
Metadata
Release files for duck-orm 1.0.2
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 | Actions |
|---|---|---|---|---|
| duck_orm-1.0.2.tar.gz | 11.8 kB | Without provenance | Details for duck_orm-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| duck_orm-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for duck_orm-1.0.2-py3-none-any.whl |
Total release size: 26.9 kB
Release files / duck_orm-1.0.2.tar.gz
| Download URL | duck_orm-1.0.2.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
492b4d1beb0838ca3781b43fbf18d3a6f71f3263b76416cd5fe247500b4cd789
|
|
BLAKE2b-256 checksum How to use checksums |
726ad9a7fff184e01270d3120cfab6ccfc68ec134292b286228544b03f3dcf0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.9.16 Linux/5.15.0-1037-azure
|
Release files / duck_orm-1.0.2-py3-none-any.whl
| Download URL | duck_orm-1.0.2-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ffda0625834e7d343c5b12183ae56fdd450f44d91fdd0d06a83dd9e8c4031dc4
|
|
BLAKE2b-256 checksum How to use checksums |
9904822378f6569ae1475e344cde5ae0d4b6a23fd715f09df41c57c3a8f18823
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.9.16 Linux/5.15.0-1037-azure
|
Security for duck-orm 1.0.2
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.