Skip to main content

Data Relation Mapping framework for Python.

Project description

SQLAlchemy-ORM

ORM framework for Python. Designed for simplicity, based on SQLAlchemy.

coverage report

pipeline status

Check out the tests directory for more examples.

Basic Example

from sqlalachemy_orm import Model, Database

Base = Model()

class Animal(Base):
    name: str
    age: int

db = Database("sqlite:///:memory:") # use an in-memory SQLite database
db.create(Animal)  # Create the `Animal` table in the database

bea = Animal(name="bea", age=5)

session = db.session()
session.create(bea) # Create a row in the `Animal` table

print(session.query(Animal).filter(Animal.name == "bea").one())

session.commit() # commit the session to the database
$ python example.py
>>> Animal(name='bea', age=5)

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

sqlalchemy-orm-1.2.10.tar.gz (21.8 kB view hashes)

Uploaded Source

Supported by

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