Skip to main content

No project description provided

Project description

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])

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

tormdb-0.0.2.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file tormdb-0.0.2.tar.gz.

File metadata

  • Download URL: tormdb-0.0.2.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Windows/10

File hashes

Hashes for tormdb-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0f49dcdaba191aa25d587779445e999b8cf7d633f2c66b79f98bce4be50031fb
MD5 003418cb530c172391fe268054f16676
BLAKE2b-256 1276d4d656808dad91e2b662bdc350c0e5de2217181d51728864cac22b6183f8

See more details on using hashes here.

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