r/madeinpython • • 7h ago

I built DoveORM, a lightweight Python ORM with built-in migrations — looking for feedback

2 Upvotes

Hi everyone! 👋

I've been building DoveORM, a small, synchronous ORM for Python. It brings models, validation, chainable queries, relationships, and migrations together in one package with a short learning curve.

It's currently at version 0.8.0 on PyPI, licensed under MIT, and I'd love to get feedback from the Python community and welcome contributors.

🔗 Links

What does DoveORM do?

Here's a small example:

from doveorm import Model, configure, CharField, IntegerField

configure(DATABASE_PATH="app.db")

class User(Model):
    name = CharField(max_length=100, nullable=False)
    age = IntegerField(default=0)

User.create_table()

user = User.create(name="Ada", age=36)

adults = User.where(age__gte=18).order_by("name").get()

The goal is to make everyday database operations straightforward without requiring a large amount of configuration.

Key features

  • Models and validation: A table() decorator or class Meta, 31 field types, and a clean() validation hook.
  • Chainable queries: Lazy QuerySets, field__lookup filters, Q objects for combining conditions, slicing, and eager loading.
  • Dynamic finders: Methods such as findByEmail(), findAllByActive(), countBy...(), and existsBy...().
  • Relationships: HasMany, HasOne, BelongsTo, and ManyToMany.
  • Transactions: Nested transactions using SAVEPOINTs and a db.run_in_transaction(fn) helper with retries for deadlocks and lock timeouts.
  • Built-in migrations: Automatic change detection, reversible migrations, squashing, and a CLI for generating, applying, reverting, and verifying migrations.
  • Security-conscious defaults: Bound SQL parameters, identifier validation, protection against accidental unfiltered bulk updates and deletes, mass-assignment protection, and redaction of sensitive fields.
  • Connection safety: Thread-safe and fork-safe connections.
  • Minimal setup: SQLite works without installing an additional database driver.

Who is it for?

DoveORM is intended for small to medium-sized applications, services, background workers, and scripts that primarily perform CRUD operations.

It supports SQLite, MySQL/MariaDB, and PostgreSQL and can be used with Flask, FastAPI, django or plain Python applications.

How does it compare with other ORMs?

I know Python already has excellent ORM options, so I'm not trying to claim DoveORM replaces them all.

  • SQLAlchemy: A much more comprehensive toolkit with extensive database support, Core, ORM, and asynchronous capabilities. DoveORM takes a smaller, more opinionated approach with migrations built in.
  • Peewee: Probably the closest in spirit. DoveORM aims for a similarly lightweight experience while offering model-driven migration generation and a CLI for managing migrations.
  • Django ORM: Provides a great ORM and migration workflow within Django. DoveORM is designed to offer a similar model-and-migration workflow across different Python frameworks and standalone scripts.

What are its limitations?

DoveORM is still a young project, and there are some deliberate limitations:

  • It is synchronous; there is no async API.
  • It supports three database families: SQLite, MySQL/MariaDB, and PostgreSQL.
  • Advanced SQL features, such as window functions and CTEs, may require raw SQL through db.execute(...).
  • As a 0.x project, its API may still evolve. Pin the version if using it in production.

For applications that need advanced database features, extensive integrations, or a mature ecosystem, SQLAlchemy or Django ORM may be the better choice.

I'd love your feedback!

I'm sharing DoveORM because I've been using it in my own projects and want to see how it holds up to different use cases.

I'd particularly appreciate feedback on:

  • The API design and developer experience.
  • What feels missing or unnecessarily complicated.
  • Database driver compatibility and edge cases.
  • Documentation and examples.
  • Potential contributions or areas worth improving.

If you were evaluating a new Python ORM, what would you need to see before considering it for a project?

Honest criticism is welcome. I'd rather hear about the problems early and make the project better.

GitHub: https://github.com/imaradesk/doveorm


r/madeinpython • • 2h ago

I built a small ML framework from scratch in Python, with an OpenCL backend

Thumbnail
1 Upvotes

r/madeinpython • • 12h ago

i built a python tool to make understanding codebases easier

1 Upvotes

working on a large codebase can get confusing pretty quickly. you end up jumping between files, tracing dependencies, figuring out how things connect, and trying to understand what might break when you change something.

so i built context forge, a local-first python cli that helps developers understand and navigate python codebases.

it analyzes your repository and stores information about its structure, symbols, and dependencies in sqlite, so you can reuse that information instead of starting from scratch every time.

some of its main features include:

  • repository analysis — explore files, symbols, dependencies, and code relationships.
  • context and memory — persist repository information and retrieve relevant context when working on a task.
  • architecture analysis — understand how different parts of a project connect and identify structural issues.
  • change impact analysis — investigate what could be affected before modifying code.
  • pre/post-change verification — inspect the project before making changes and check the results afterward.

i wanted the tool to be deterministic and local-first rather than depending on an llm to figure everything out. getting caching, persistence, and analysis reliability right took quite a bit of work, and the project went through several iterations before reaching its current release.

this started as my project for stardance, a ysws event by hack club. building it taught me a lot about python, software architecture, testing, and the difference between adding features and making them reliable.

it's now open source, and i'd like to get it into the hands of developers who might actually find it useful.

github: https://github.com/vxyzln/context_forge

pypi: https://pypi.org/project/context-forge-local/1.0.1/

to try it, install it with:

uv tool install context-forge-local

then run cf --help to explore the commands.

i'd appreciate a star if you find it interesting, but i'm especially interested in honest feedback. if you've worked on larger python projects, what would you want a tool like this to do better? IF u like this , Please upvote it.

This was made as a Part of a YSWS event Stardance by Hack Club. Stardance Project


r/madeinpython • • 21h ago

i built a python tool to make understanding codebases easier

Thumbnail
1 Upvotes

r/madeinpython • • 15h ago

🐍 Operador de asignación += en Python

Thumbnail
youtube.com
0 Upvotes