MosaicDB
Universal, framework-independent ORM for Python.
Getting Started
from pydantic import BaseModel
from mosaicdb import Mosaic
from mosaicdb.models import ModelMixin
class User(BaseModel, ModelMixin):
id: int
name: str
age: int
db = Mosaic("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
mosaicdb makemigrations users --db sqlite:///test.db --schema '{"id": "int", "name": "str"}'
mosaicdb migrate users --db sqlite:///test.db
mosaicdb create-table users --db sqlite:///test.db --schema '{"id": "int", "name": "str"}'
mosaicdb drop-table users --db sqlite:///test.db
mosaicdb inspect-schema users --db sqlite:///test.db
mosaicdb seed users --db sqlite:///test.db --data '{"id": 1, "name": "Alice"}'
mosaicdb raw-sql --db sqlite:///test.db --sql "SELECT * FROM users"
Versioning & Changelog
- Current version: v0.1.0-alpha
- See
CHANGELOG.mdfor updates.
PyPI Installation
pip install mosaicdb
License
MIT
Metadata
Release files for mosaicdb 0.1.1
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 |
|---|---|---|---|---|
| mosaicdb-0.1.1.tar.gz | 10.7 kB | Without provenance | Details for mosaicdb-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mosaicdb-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for mosaicdb-0.1.1-py3-none-any.whl |
Total release size: 19.5 kB
Release files / mosaicdb-0.1.1.tar.gz
| Download URL | mosaicdb-0.1.1.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7f8bdedf9fabb8baac7af25c6238ea33812b417e5373792a128e1434af135c2
|
|
BLAKE2b-256 checksum How to use checksums |
e42ec09600c05351097a7e45c60f29b7a7968231baa6077f042e58f802530b7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Release files / mosaicdb-0.1.1-py3-none-any.whl
| Download URL | mosaicdb-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
825d920cc2399a00dfc85e722934875ea1645d5f49728a9c43bf5af4a9dfff08
|
|
BLAKE2b-256 checksum How to use checksums |
66202a83b4337b717ec5f90fe04ea666d1cc0c780434d8da92e84b1ca84619b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Security for mosaicdb 0.1.1
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.