Skip to main content

A high-performance ORM for Python with support for migrations, relations, and caching.

Project description

Hermes ORM

Latest Version GitHub stars GitHub forks GitHub license

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.


🚀 Key Features

  • 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, and DELETE statements.
  • Rich Relationships: Support for One-to-One, One-to-Many, Many-to-Many, and polymorphic Morph 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).

🛠️ Getting Started

Step 1: Install Hermes ORM

Install Hermes ORM via pip:

pip install hermes-orm

Step 2: Define Your Models

Define models that represent your database structure:

from hermes.model import BaseModel
from 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)

Step 3: Run Migrations

Use the CLI to generate and apply migrations:

hermes make_migration create_users_table create
hermes migrate

Step 4: Query the Database

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)

🧩 Supported Relationships

  • 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 and MorphMany for flexible, type-based relations.

Each relationship is implemented with robust utilities for querying and manipulation.


📦 Latest Version

  • Version: 1.0.0
  • Release Date: November 28, 2024

🔍 Project Status

Closed Issues Enhancement Issues Bug Issues

Hermes ORM is under active development, with new features and improvements added regularly. Contributions and feedback are welcome!


📜 License and Usage

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.


🤝 Contributors

Developed and maintained by Altxria Inc. with contributions from a growing community of developers.

Contributors

See All Contributors


❤️ Support Hermes ORM

If you find Hermes ORM useful, consider supporting its development and ongoing maintenance:

Sponsor Hermes ORM

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_orm-0.1.2.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_orm-0.1.2-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file hermes_orm-0.1.2.tar.gz.

File metadata

  • Download URL: hermes_orm-0.1.2.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for hermes_orm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 969cb88d9bbec5938a6468461f6edaa620c91b67c0d12773912ab8927bd539c7
MD5 ccf5788474cff954b6bfe53765d41049
BLAKE2b-256 bfe5e9497c91d862e8406e21e40c98bd17cdd62e50eb293eab88f51a66018533

See more details on using hashes here.

File details

Details for the file hermes_orm-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: hermes_orm-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for hermes_orm-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 165a2b31b3c05e289daf45169a87918dd0364c6059d66aeab2163f4165b5eaae
MD5 6a5a76ebbef639c26206027b1c3a5c88
BLAKE2b-256 b1889c5668d9e7517cc036a411cd076e03760f58fdd8c71d65b637c002d42291

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page