Skip to main content

ramorm [Alpha]

Model based ORM in RAM. Made for performance. Please do not store critical data (yet)

codecov

Installation

pip install ramorm

Usage

from ramorm import orm, model

db = orm.Orm('my_test_database') 

class Vehicle(model.Model):
    name = model.TextField()
    wheels = model.IntegerField(default=4)
    max_speed = model.IntegerField(default=100)

sports_car = Vehicle(name='Aventador', max_speed=230)
print(sports_car.name,sports_car.wheels, sports_car.max_speed)
>> 'Aventador' 4 230

bicycle = Vehicle(name='Bicycle', wheels=2, max_speed=50)
print(bicycle.wheels, bicycle.max_speed)
>> 'Bicycle' 2 50

Add your model based objects to database using push function, you can pass one or multiple objects at once

db.push(sports_car, bicycle)

Retrieving single objects from database is possible using get function

print(db.get(Vehicle, wheels=4).name)
>> 'Aventador'

print(db.get(Vehicle, name='Bicycle').max_speed
>> 50

For filtering numerical parameters you can use __gt (greater), __gte (greater or equal), __lt (lower), __lte(lower or equal)

print(db.get(Vehicle, max_speed__gt=70).name)
>> 'Aventador'

For retrieving multiple objects at once use filter

for vehicle in db.filter(Vehicle, max_speed__gte=10):
    print(vehicle.name, vehicle.wheels, vehicle.max_speed)
>>  'Aventador' 4 230
>>  'Bicycle' 2 50

For deleting objects from db use delete function. Returns True if changes were made to database

db.delete(Vehicle, name='Bicycle')
>> True
db.delete(Vehicle, name='Starship')
>> False

If you want completely delete all data in your database use drop .Returns array of objects in db (empty)

db.drop()
>> []

Coming soon

  • Delete objects using .delete()

  • Order by

  • Backup to file

  • PyPI package

  • Integration with postgresql, redis

Metadata

Release files for ramorm 0.0.11

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

Source distribution (sdist)

Source distribution for ramorm 0.0.11
File Size Uploaded Provenance Actions
ramorm-0.0.11.tar.gz 4.2 kB Without provenance Details for ramorm-0.0.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ramorm 0.0.11
File Interpreter ABI Platform Actions
ramorm-0.0.11-py3-none-any.whl Python 3 none any Details for ramorm-0.0.11-py3-none-any.whl

Total release size: 10.2 kB

Release files / ramorm-0.0.11.tar.gz

Download URL ramorm-0.0.11.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dd530664685d51d4bd9ccf2479f2b74c083caf22b6350539ca02fbac65965cd5
BLAKE2b-256 checksum
How to use checksums
254a99f6fdf499754dbf10250ea3db468f0b7451cfa88016b7c3ee9a827d4abf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / ramorm-0.0.11-py3-none-any.whl

Download URL ramorm-0.0.11-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e42eeb2b4b11f4563ad0a244cf0578376fb219f1acb5cbbc5906e9e1b4405a90
BLAKE2b-256 checksum
How to use checksums
d6c5d89edd002a9ab541dd30209cd437b15143eccf104be57a254f2fece23897
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Security for ramorm 0.0.11

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.11 This release

2 release files 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