Skip to main content

tormdb

tormdb stands for Transposed Object Relational Mapping Database. tormdb stores your objects into SQLite for maintaining the accessibility across runtimes without you inheriting any customized Classes.

Usage

Save

tormdb.save(<object>)

import dataclasses
from typing import List

import tormdb


@dataclasses.dataclass
class Person:
    name: str
    age: int


@dataclasses.dataclass
class Family:
    husband: Person
    wife: Person
    children: List[Person] = dataclasses.field(default_factory=list)


wife: Person = Person('Catherine', 24)
husband: Person = Person('Chris', 24)
daughter: Person
son: Person
daughter = son = Person('Alex', 0)

family = Family(
    husband=husband,
    wife=wife,
    children=[daughter, son])

tormdb.save(family)

Load

<object> = tormdb.load(<List[Class]>)

import dataclasses
from typing import List, Optional

import tormdb


@dataclasses.dataclass
class Person:
    name: str
    age: int


@dataclasses.dataclass
class Family:
    husband: Person
    wife: Person
    children: List[Person] = dataclasses.field(default_factory=list)


family: Optional[Family] = tormdb.load([Family, Person])

Metadata

Release files for tormdb 0.0.2

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

Source distribution (sdist)

Source distribution for tormdb 0.0.2
File Size Uploaded
tormdb-0.0.2.tar.gz 8.2 kB Details

Release files / tormdb-0.0.2.tar.gz

Download URL tormdb-0.0.2.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0f49dcdaba191aa25d587779445e999b8cf7d633f2c66b79f98bce4be50031fb
BLAKE2b-256 checksum
How to use checksums
1276d4d656808dad91e2b662bdc350c0e5de2217181d51728864cac22b6183f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.4 Windows/10

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

2 release files

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