Universal, framework-independent ORM for Python.
Project description
AkronDB
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.2.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.2-py3-none-any.whl
(8.9 kB
view details)
File details
Details for the file akron-0.1.2.tar.gz.
File metadata
- Download URL: akron-0.1.2.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 |
fc68f64ba4e6205dcf56b67ad00c54cff0448215da98a85e6447ec6d66afb8bf
|
|
| MD5 |
8ce315b61fe2879131e4419657ab56ad
|
|
| BLAKE2b-256 |
e96f8f4143eb602b8768db2ae05b6533bd449a0e4d44d3d95e854827f39c52e0
|
File details
Details for the file akron-0.1.2-py3-none-any.whl.
File metadata
- Download URL: akron-0.1.2-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 |
b1ba04ed6274ad1480388eb203ae0044093aa19ab826e18cb64857b76d3fb86d
|
|
| MD5 |
051f41763b0e3b14ce5aad31e5ef8daf
|
|
| BLAKE2b-256 |
9e81d3a58096128719890e7680147d55dd9d647e558158ff09c50fd57e264760
|