Skip to main content

RunDB

RunDb is not exactly a database. It is similar to TinyDB <https://tinydb.readthedocs.io/en/stable/>__ on storing files as json.

The main point of this library is to help the user on storing and loading data.

Philosophy

  • NoSql with tools to simulate relational
  • Table are all fully loaded when declared
  • Query are done using python
  • Data are dict, they all have a unique key as a string

Quick Overview


.. code:: python

    import RunDB
    from pathlib import Path
    from RunDB.tools.serialization import call_kwargs

    # Path to DB folder
    db_path = Path("testRunDB")
    # Create the Database instance
    db = RunDB.Database(db_path)

    # Get or Create User table, specifying the key as login (default is "id")
    # The key is used to find, if not explicitly given, the database id
    User = db.table("user", key="login")

    # Same for Group table
    Group = db.table(
        "group",
        key="name",
        one2many={"users": "user"}
    )

    # Create User 1
    u1 = User.append({"login": "paul"})  # With values

    # without values, 
    u2 = User["Matthieu"]
    u3 = User["Thomas"]

    u1.age = 18
    u2.age = 20
    u3.age = 18

    res = User.filter(lambda user: user.age == 20)

    list(User.records())


    test= Group["test"]
    test.users.append(u1)


    adminGroup = Group.append({
        "name": "admin",  # as the table key is "name", name will be poped
    })


    db["test"]["new"] = {"name": "new data"}  # Quick insert

    # Check if record has attribute age
    "age" in u1  # True

    # Get a dict
    data = dict(u1.items())

    db.dump_all()

Nb: Database are simply Group of Table, We can register Tables from
somewhere else or simply use a Table without Database object

Future
------

-  improve relational

Metadata

Release files for rundb 0.6

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

Source distribution (sdist)

Source distribution for rundb 0.6
File Size Uploaded Provenance Actions
rundb-0.6.tar.gz 6.3 kB Without provenance Details for rundb-0.6.tar.gz

Built distribution (wheel)

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

Total release size: 26.7 kB

Release files / rundb-0.6.tar.gz

Download URL rundb-0.6.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1b510e6e842ff06ba3fe43050f1b82a3472861dcc484289f193b3a63610aedea
BLAKE2b-256 checksum
How to use checksums
1873efd40d463d4ba6358da193d43d30150faeef6df43d638f1eddd83e58c71a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.9

Release files / rundb-0.6-py3-none-any.whl

Download URL rundb-0.6-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d034e8e3ebe26e4857ea93fe916bb8e2adf7f977817cde39119a49731e41fac0
BLAKE2b-256 checksum
How to use checksums
5c1a596af2d0040e3907ffa096804ef3089fff44d6e96400c5d23c2aeda9df68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.9

Security for rundb 0.6

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.6 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