Skip to main content

Improved and easy-to-use version of builtin Python's JSON

Project description

Chroma Database (ChrDB)

Improved and easy-to-use version of builtin Python's JSON

Key Features

  • Simple and easy-to-use syntax.
  • It is based on ujson, instead of default json, which speeds up the database.
  • You can use dots in the key arguments to search in child dictionaries.

Installing

Python 3.8 or higher is required.

# Linux/macOS
python3 -m pip install pychrdb

# Windows
py -3 -m pip install pychrdb

Usage

Print full database to the console:

from chrdb import ChrDB

database = ChrDB("database.json")
print(database.full())

Get the key from the database:

from chrdb import ChrDB

database = ChrDB("database.json")
database.find("key")

Update key value in the database:

from chrdb import ChrDB

database = ChrDB("database.json")
database.update(key="key", value="Hello, World!")

Update full database (value must be dict):

from chrdb import ChrDB

database = ChrDB("database.json")
database.update(key=None, value={"key": "Hello, World!"})

Delete key from the database:

from chrdb import ChrDB

database = ChrDB("database.json")
database.delete("key")

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

pychrdb-1.2.1.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

pychrdb-1.2.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

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