Skip to main content
File added late

1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.

Getting started with DBJson

from dbjson.main import DB

# Instatilizing DB class from dbjson.main
db = DB()

# Test Data
data = {
  "id": 1,
  "first_name": "Vivyan",
  "last_name": "Treherne",
  "email": "vtreherne0@jigsy.com",
  "ip_address": "94.254.247.240"
}
collection = "users"

# Adding Record
data = db.createRecord(collection, data)
print(data)
# Response -> {'__id__': 'f00ae4e3ca8c3e318a68acc460e5f401', '__data__': {'id': 1, 'first_name': 'Vivyan', 'last_name': 'Treherne', 'email': 'vtreherne0@jigsy.com', 'ip_address': '94.254.247.240'}}

# Updating Record
record_key = "f00ae4e3ca8c3e318a68acc460e5f401"
to_update = [
    {"email": "jhon@email.com"},
    {"ip_address": "google.com"}
]
data = db.updateRecord(collection, "f00ae4e3ca8c3e318a68acc460e5f401", to_update)
print(data)
# Response -> {'id': 1, 'first_name': 'Vivyan', 'last_name': 'Treherne', 'email': 'jhon@email.com', 'ip_address': 'google.com'}

# Deleting Record
db.removeRecord(collection, record_key)

What is DBJson?

Read the DBJson docs here .

This is a simple flat file database which stores its data in filesystem ( folders and JSONfiles ). It is NOT INTENTED TO USE IN PRODUCTION. It can be used times when you are too lazy to write a schema and do other stuff for a ORM like SQLAlchemy.

Data is structured as follows:

Collections : contains records. records: contains key value pair. key value pair ( key: str, value: dictionary ).

What are its features ?

It can CRUD data. It is ACID Compliant.

What can it Do ?

It can do all the basic things that a database can do, which includes:

  1. creating records
  2. reading records
  3. updating records
  4. deleting records
  5. filter records

Why was it made ?

Sometimes I am to lazy to setup database make database models and all that stuff, and I like key-value pair databases for small fun projects. So I could not find in python so I decided to make one for myself.

Hope you guys like it.😊

Read the DBJson docs here .

Metadata

Release files for dbjson 0.0.3

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

File added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for dbjson 0.0.3
File Size Uploaded
dbjson-0.0.3.tar.gz 3.1 kB Details

Built distribution (wheel)

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

Total release size: 6.1 kB

Release files / dbjson-0.0.3.tar.gz

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL dbjson-0.0.3.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
39f893054ba9e2b9d26745cdf2e08efc9a4efeca4b8019b15f349c6970cbb9e2
BLAKE2b-256 checksum
How to use checksums
09e816a9953c0b79e22179fde9cdec9f92bbebe58170c543e884142974825dbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / dbjson-0.0.3-py3-none-any.whl

Download URL dbjson-0.0.3-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0307aff60a34e84f46c77250f7b0785be84fb1f12a5889fe060d4c1f10616fa4
BLAKE2b-256 checksum
How to use checksums
bba75da0b9a373764dd2cc0ab9f77d62c58630a766f08afe46d2421264476404
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

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