Skip to main content

ORMithorynque

ORMithorynque is an ORM (Object Relational Mapper), that is to say an object-oriented database built on top of a relational database (SQLite3). ORMithorynque allows to save and reload Python object in a database, and to perform complex and optimized request on the database. ORMithorynque can be seen as SQLite3 with objects and (multiple) inheritance, or Python object system with SQL queries.

The key features of ORMithorynque are:

  • Very good performance thanks to prebuilt requests and agressive caching (faster than SQLAlchemy, SQLObject, Pony and Peewee)

  • Automatic database schema update when adding new tables, new columns or new indexes

  • Single and multiple inheritance support

  • Transactions

  • Native SQL queries

  • Funny name :)

And its main drawbacks are:

  • Support a single database backend (SQLite3)

  • No specific high-level query language

  • Not thread-safe

ORMithorynque is available under the GNU LGPL licence v3. It requires Python 3.2 (or more) or Pypy 3.

Installation

To install ORMithorynque, type the following command into the command prompt (with root permission):

pip install ormithorynque

What can I do with ORMithorynque?

Open an ORMithorynque database from a filename (if the database does not exist, it is automatically created):

>>> import ormithorynque

>>> database = ormithorynque.Database("database_filename.sqlite3")

Create two classes, with a one-to-many relation between them (tables are automatically created with the class if they do not exist; if they exist, they are automatically updated with new column if needed):

>>> class Person(database.Object):
...     name       = database.SQLAttribute(str, indexed = True)
...     first_name = database.SQLAttribute(str)
...     houses     = database.SQLOneToMany("House", "owner")

>>> class House(database.Object):
...     address = database.SQLAttribute("Nowhere") # String attribute with a default value
...     owner   = database.SQLAttribute(object)

Create two instances (database is automatically updated):

>>> someone = Person(name = "Some", first_name="One")

>>> house = House(address = "Somewhere", owner = someone)

The attributes of the instances can be accessed and modified (database is automatically update):

>>> someone.name
Some
>>> someone.name = "Some2"

>>> someone.houses
[<House id=2 address='Somewhere' owner=<Person id=1 first_name='One' name='Some2'>>]

Finally, plain SQL can be used to query the database:

>>> database.select_one("select count(id) from Person")
(1,)

Changelog

0.1

  • First release

Metadata

Release files for ORMithorynque 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ORMithorynque 0.1.1
File Size Uploaded Provenance
ORMithorynque-0.1.1.tar.bz2 341.9 kB Without provenance Details

Release files / ORMithorynque-0.1.1.tar.bz2

Download URL ORMithorynque-0.1.1.tar.bz2
Size 341.9 kB
Tags Source
SHA-256 checksum
How to use checksums
feab6f89d78e4d1d0e63a494c67ea2e652691598af2bd21b720c42794133c768
BLAKE2b-256 checksum
How to use checksums
c62bb567398995654371665d5f75d9bc7dbd0be41b9bc3e79c06b2948ce2cc96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ORMithorynque 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page