Ormophine
A fast, Pythonic ORM that gets out of your way.
Write database queries the way you think — in plain Python.
The Problem with Other ORMs
Most Python ORMs are either too verbose, too magical, or too slow. Compare fetching filtered rows with a popular ORM versus Ormophine:
Other ORMs:
# SQLAlchemy (Core)
with engine.connect() as conn:
stmt = select(users.c.phone, users.c.name, users.c.age).where(
and_(
users.c.age > 18,
or_(
users.c.phone.like('+98%'),
func.substr(users.c.phone, 1, 3) == '+98'
)
)
).order_by(users.c.age)
result = conn.execute(stmt).fetchall()
Ormophine:
my_db = Ormophine.Sqlite('my_db')
users = my_db.users
phone, name, age = users.phone, users.name, users.age
users.get_row(
[phone, name, age],
where = (age > 18) & (phone.startswith('+98') | (phone[:3] == '+98')),
order_by = age
)
Same result. No boilerplate. No imports. No ceremony.
Why Ormophine?
- Intuitive syntax — columns behave like Python variables with full operator overloading (
>,&,|,+,[],.startswith(), etc.) - Fast — built on a dedicated writer thread + read-only connection pool; no ORM overhead on the hot path
- Multi-database — one API across all supported backends
- Connection pooling built-in — parallel reads, serialized writes, no configuration needed
- WAL mode support (SQLite) — automatic checkpointing for maximum write throughput
- Blocking and non-blocking — fire-and-forget writes or wait for commit confirmation
Supported Databases
| Database | Status |
|---|---|
| SQLite | ✅ Available |
| MySQL | 🔧 In development |
| MariaDB | 🔧 In development |
| PostgreSQL | 🔧 In development |
The API is identical across all backends. Switch databases by changing one line.
Benchmark Results
📊 Coming soon — benchmark results comparing Ormophine against SQLAlchemy, Tortoise ORM, and raw DB-API 2.0 will be published here across INSERT, SELECT, bulk operations, and concurrent read workloads.
Quick Examples
Connect and access tables
import Ormophine
db = Ormophine.Sqlite('company.db')
# Tables and columns are discovered automatically
users = db.users
orders = db.orders
Insert
users.insert({
users.name: 'Alice',
users.email: 'alice@example.com',
users.age: 30
})
Select with conditions
name, email, age = users.name, users.email, users.age
rows = users.get_row(
[name, email],
where = (age >= 18) & name.startswith('A'),
order_by = age
)
Update
users.update(
update = {users.age: users.age + 1},
where = users.status == 'active'
)
Bulk insert
users.bulk_insert(
columns = [users.name, users.age],
data_list = [['Bob', 25], ['Carol', 32], ['Dave', 28]]
)
Joins
from Ormophine import Join
result = orders.join(
columns = [users.name, orders.amount, orders.date],
joins_list = [Join.Inner(users, users.id == orders.user_id)],
where = orders.amount > 100,
order_by = [orders.date]
)
Batch operations (single transaction)
(users.batch()
.insert({users.name: 'Eve', users.age: 28})
.update({users.age: 29}, where=users.name == 'Eve')
.run())
Schema management
from Ormophine import TableStructure
schema = TableStructure('products', strict=True)
schema.add_column('id', int, primary_key=True)
schema.add_column('title', str, not_null=True, unique=True)
schema.add_column('price', float, default_value=0.0)
products = db.create_table(schema)
# Add / rename / drop columns
products.add_column('stock', int, default_value=0, not_null=True)
products.rename_column(products.stock, 'inventory')
products.delete_column(products.inventory, True, True, True)
WAL mode and performance tuning
db.set_WAL_mode(True, wal_timer=60) # automatic checkpoint every 60 s
db.SetPragma.synchronous('NORMAL')
db.SetPragma.cache_size(-4000) # 4 MiB page cache
db.SetPragma.foreign_keys(True)
Operator Reference
Ormophine columns support native Python expressions — all values are automatically parameterized.
| Expression | SQL equivalent |
|---|---|
age > 18 |
age > 18 |
(age >= 18) & (age < 65) |
age >= 18 AND age < 65 |
status == 'active' |
status = 'active' |
name.startswith('A') |
name LIKE 'A%' |
email.contains('@corp.com') |
email LIKE '%@corp.com%' |
code[:3] |
SUBSTR(code, 1, 3) |
name.upper().strip() |
TRIM(UPPER(name)) |
price * qty - discount |
price * qty - discount |
Installation
🚧 PyPI release coming soon.
# Not yet available — star the repo to get notified
pip install ormophine
Roadmap
- SQLite backend with full ORM
- Operator overloading for columns
- Read-only connection pool
- WAL mode + automatic checkpointing
- Batch / bulk operations
- MySQL / MariaDB backend
- PostgreSQL backend
- Async support
- PyPI release
- Benchmark suite publication
Contributing
The codebase is currently in active development and not yet public. Once released, contributions, bug reports, and feature requests will be very welcome.
License
MIT — free to use, modify, and distribute.
Release files for Ormophine 0.7.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ormophine-0.7.5.tar.gz | 569.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ormophine-0.7.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / ormophine-0.7.5.tar.gz
| Download URL | ormophine-0.7.5.tar.gz |
|---|---|
| Size | 569.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba45cf1b20feb38a75ffe9ce6f8dc9e9e041b090ecad8bdec7213f1199726806
|
|
BLAKE2b-256 checksum How to use checksums |
bedf324594144ec30693ba155ea6f2690cddebcaf879afe8fc548f9cddedfea8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.
Transparency logRelease files / ormophine-0.7.5-py3-none-any.whl
| Download URL | ormophine-0.7.5-py3-none-any.whl |
|---|---|
| Size | 595.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed8cd8c4fa2b59ac9fad068fe715f5707f13da58f517ecd234a98d35dfc812c7
|
|
BLAKE2b-256 checksum How to use checksums |
6f913b6b112e13f2123f98e944e4ff8f257c40621375246f13fae55ab0d44930
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 3, 2026.
Transparency log