Hermes ORM is a modern Python ORM designed for simplicity, flexibility, and performance. With support for relational mappings, migrations, and advanced querying, Hermes ORM is tailored for developers who need a powerful yet intuitive tool for managing database operations in their applications.
- Dynamic Model Mapping: Automatically map Python classes to database tables with field validation and relational support.
- Advanced Query Builder: Intuitive querying with dynamic
SELECT
,INSERT
,UPDATE
, andDELETE
statements. - Rich Relationships: Support for
One-to-One
,One-to-Many
,Many-to-Many
, and polymorphicMorph
relationships. - Migrations Manager: Create, apply, and rollback migrations seamlessly.
- Asynchronous & Synchronous Database Operations: Flexible execution modes to match your application’s needs.
- Caching Mechanisms: Built-in query caching for optimized performance.
- Debugging & Logging: Configurable debug and logging options for streamlined troubleshooting.
- Open for Personal & Commercial Use: Use Hermes ORM freely in personal and commercial projects (not for resale as a standalone product).
Install Hermes ORM via pip:
pip install hermes-orm
Define models that represent your database structure:
from altxria.hermes.model import BaseModel
from altxria.hermes.fields import IntegerField, StringField, ForeignKeyField
class User(BaseModel):
id = IntegerField(primary_key=True)
name = StringField(max_length=255, nullable=False)
class Post(BaseModel):
id = IntegerField(primary_key=True)
user_id = ForeignKeyField("User", nullable=False)
content = StringField(nullable=False)
Use the CLI to generate and apply migrations:
hermes make_migration create_users_table create
hermes migrate
Perform operations on your models:
# Create a user
user = User(name="Alice")
user.save(db_connection)
# Fetch all posts
posts = Post.all(db_connection)
# Add a post for a user
post = Post(user_id=user.id, content="Hello, Hermes!")
post.save(db_connection)
- One-to-One: Easily map one-to-one relationships with
OneToOne
fields. - One-to-Many: Establish hierarchical relationships with
OneToMany
. - Many-to-Many: Simplify complex mappings with
ManyToMany
pivot tables. - Polymorphic: Use
MorphOne
andMorphMany
for flexible, type-based relations.
Each relationship is implemented with robust utilities for querying and manipulation.
- Version: 0.1.7
- Release Date: November 28, 2024
- Latest Release Date: November 29, 2024
Hermes ORM is under active development, with new features and improvements added regularly. Contributions and feedback are welcome!
Hermes ORM is free to use for both personal and commercial projects. However, Hermes ORM itself cannot be resold or distributed as a standalone product.
Developed and maintained by Altxria Inc. with contributions from a growing community of developers.
If you find Hermes ORM useful, consider supporting its development and ongoing maintenance: