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.7.tar.gz (21.7 kB view details)

Uploaded Source

File details

Details for the file sqlalchemy-orm-1.2.7.tar.gz.

File metadata

  • Download URL: sqlalchemy-orm-1.2.7.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for sqlalchemy-orm-1.2.7.tar.gz
Algorithm Hash digest
SHA256 89bdad8dbbe458a89ae48385204408d300c03977f3a059cfd4b6edf78dd1d282
MD5 d7badac6878e3ebb8b11fbfa358c0c23
BLAKE2b-256 03ac91c7e5058dc45eca9a077912c216e3ecf3e716e34fe447d8723c4770c6dd

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