Universal, framework-independent ORM for Python.
Project description
Akron
Universal, framework-independent ORM for Python.
Getting Started
from pydantic import BaseModel
from akron import Akron
from akron.models import ModelMixin
class User(BaseModel, ModelMixin):
id: int
name: str
age: int
db = Akron("sqlite:///test.db")
User.create_table(db)
User.insert(db, User(id=1, name="Alice", age=30))
users = User.find(db)
print(users)
Features Table
| Feature | Supported |
|---|---|
| Simple Syntax | ✅ |
| Multi-DB Support | ✅ |
| Multi-Table/FK | ✅ |
| Auto Migrations | ✅ |
| CLI | ✅ |
| Typesafe Models | ✅ |
| NoSQL (MongoDB) | ✅ |
| Error Handling | ✅ |
| Test Coverage | ✅ |
Database Support Matrix
| Database | CRUD | FKs | Migrations | CLI | Typesafe Models |
|---|---|---|---|---|---|
| SQLite | ✅ | ✅ | ✅ | ✅ | ✅ |
| MySQL | ✅ | ✅ | ✅ | ✅ | ✅ |
| PostgreSQL | ✅ | ✅ | ✅ | ✅ | ✅ |
| MongoDB | ✅ | ❌ | Schemaless | ✅ | ✅ |
CLI Command Examples
akron makemigrations users --db sqlite:///test.db --schema '{"id": "int", "name": "str"}'
akron migrate users --db sqlite:///test.db
akron create-table users --db sqlite:///test.db --schema '{"id": "int", "name": "str"}'
akron drop-table users --db sqlite:///test.db
akron inspect-schema users --db sqlite:///test.db
akron seed users --db sqlite:///test.db --data '{"id": 1, "name": "Alice"}'
akron raw-sql --db sqlite:///test.db --sql "SELECT * FROM users"
Versioning & Changelog
- Current version: v0.1.1
- See
CHANGELOG.mdfor updates.
PyPI Installation
pip install akron
License
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
akron-0.1.3.tar.gz
(10.8 kB
view details)
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
akron-0.1.3-py3-none-any.whl
(8.9 kB
view details)
File details
Details for the file akron-0.1.3.tar.gz.
File metadata
- Download URL: akron-0.1.3.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a859536e22f4535882a62295ccd16dc529cfc32f58caf0c1cfd2733fb718520
|
|
| MD5 |
2d4a39f5b5c6c88f33630eaa407b520a
|
|
| BLAKE2b-256 |
1c55ed5018a7b915b77b78e63d29777c43100cecf0068c831e4d8c776cea1789
|
File details
Details for the file akron-0.1.3-py3-none-any.whl.
File metadata
- Download URL: akron-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a6ca57b2fed36a4411cb9c3c99c290b88e4017445a928a1c8c304714bdcaceb
|
|
| MD5 |
489ba9611e65e9abd09c76524159998e
|
|
| BLAKE2b-256 |
09fc87758c8aab24ad3a582ec58c83d1d28e71479e80837397d4f1a1c6cb7ed3
|