Skip to main content

Coming Soon: A Python ORM That Treats You Like Its 2026

Alchemy is complex, but Idli is simple.

Have Some Idli

(Doesn't work yet)

$ pip install idli
$ uv add idli

Goals

  • Act as a simple data persistence & query layer for simple Python apps (typical CRUD apps).
  • Primarily support solo devs and small teams who iterate fast. Not intended for those who need 4 approvals to create a new column.
  • Be as declarative as possible.
  • Keep your data layer code minimal and elegant.
  • Manage as much database administration as possible within the application.
  • Handle migrations natively, with least nagging.
  • Be framework agnostic.
  • Support both sync and async.
  • Be well documented.

What Could It Be Like?

from datetime import datetime
import uuid

from idli import connect

db = connect('postgresql://user:pwd@localhost/somedb')


@db.Model
class Task:
    id: uuid.UUID = uuid.uuid7 # initialize with function value
    title: str
    description: str | None # nullable column because None is an allowed type
    status: str = 'todo' #  initialize with default value as 'todo'
    created: datetime = datetime.now
    updated: datetime | None


task = Task(
    title = "Ship this ORM", 
    description = "Before the year ends",
)
task.save()

# tomorrow
task = Task.select(title = "Ship this ORM").one()
task.status = 'doing'
task.save()

# few weeks later
task = Task.select(title = "Ship this ORM").one()
task.update(status = 'done') # using .update will update the status and save it.

# next year
pending_tasks = Task.select(status__neq='done')
for task in pending_tasks:
    print(task.title, ',', 'Pending Since:', datetime.now()-task.created)

Migrations

Apart from Django ORM, there is no other Python ORM that I know of that handles database migrations natively. Even with that, I'm too lazy to 'make migrations', check them into my VCS, run them, etc. It's okay be to lazy and prioritize other things in life. Hence, Idli will support auto-migrations for non-destructive migrations. Destructive migrations will have to be done by hand. Suppose the above data model has to be extended a few days later:

from datetime import datetime
import uuid

from idli import connect, PrimaryKey, Index

db = connect(
    'postgresql://user:pwd@localhost/somedb',
    sambar_dip = True # this will automatically create tables, columns, and indexes defined below
)


@db.Model
class Task:
    id: uuid.UUID = uuid.uuid7 # initialize with function value
    title: str
    description: str | None # nullable column because None is an allowed type
    status: str = 'todo' #  initialize with default value as 'todo'
    created: datetime = datetime.now
    updated: datetime | None
    owner: User # newly created column referencing another table

    __idli__ = [
        Index('owner', '-created') # newly created Index
    ]


@db.Model
class User: # new table
    username: str
    full_name: str
    email: str
    send_task_reminders: bool = False

    __idli__ = [
        PrimaryKey('username')
    ]

This is inspired from GORM for Golang:

NOTE: AutoMigrate will create tables, missing foreign keys, constraints, columns and indexes. It will change existing column’s type if its size, precision changed, or if it’s changing from non-nullable to nullable. It WON’T delete unused columns to protect your data. - (from GORM docs: https://gorm.io/docs/migration.html)

Async

import asyncio
from datetime import datetime
import uuid

from idli import async_connect

db = async_connect('postgresql://user:pwd@localhost/somedb')


@db.Model
class Task:
    id: uuid.UUID = uuid.uuid7 # initialize with function value
    title: str
    description: str | None # nullable column because None is an allowed type
    status: str = 'todo' #  initialize with default value as 'todo'
    created: datetime = datetime.now
    updated: datetime | None


async def main():
    task = Task(
        title = "Ship this ORM", 
        description = "Before the year ends",
    )
    await task.save()


asyncio.run(main())

Metadata

Release files for idli 0.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for idli 0.2.7
File Size Uploaded
idli-0.2.7.tar.gz 29.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for idli 0.2.7
File Interpreter ABI Platform
idli-0.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 41.3 kB

Release files / idli-0.2.7.tar.gz

Download URL idli-0.2.7.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8338b9d639ae06559a9b7455398b33daa900ca50acf47535fc8fc1b50a4d39b9
BLAKE2b-256 checksum
How to use checksums
fc818540a8f6c2db49e690eb9b028e118b3a5d6a70ace8325ca172d985e11ee2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / idli-0.2.7-py3-none-any.whl

Download URL idli-0.2.7-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5aca5fa781c8bbc95abf6898cc90c4cd0530d2d4a792840bd0ce80bcd685ad1f
BLAKE2b-256 checksum
How to use checksums
33bb9089f1f19d9eaba34b3b3472a57983a300e3e1a8a00a793f586c2a207582
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.7 This release

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page