Skip to main content

A small json database

Project description

DB_in_JSON: A Simple JSON-Based Database Library

DB_in_JSON is a Python library designed to provide a simple and lightweight solution for managing data using JSON files. It offers basic CRUD (Create, Read, Update, Delete) operations for collections of data, allowing for efficient storage and retrieval.

Features

  • Create and manage JSON-based databases.
  • Create, read, update, and delete collections within the database.
  • Insert, select, update, and delete data within collections.
  • Utilize conditional operations for data manipulation.

Installation

You can install DB_in_JSON with PyPI with the command :

pip install DB_in_JSON

Usage

Here's a simple example of how to use DB_in_JSON:

from db_in_json import DB

# Create a database (create the file if needed)
db = DB('DB.json')

# Get a collection (create it if it doesn't exist)
test_collection = db.getCollection('test_collection')

# Insert data into the collection
insert_uuid = test_collection.queries['insert']('Some good data')

# Select data from the collection
selected_items = test_collection.queries['select'](lambda uuid, data: True)

# Update data in the collection
updated_amt = test_collection.queries['update'](lambda uuid, data: True, 'Another updated data')

# Delete data from the collection
deleted_amt = test_collection.queries['delete'](lambda uuid, data: True)

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

db_in_json-1.0.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

db_in_json-1.0.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file db_in_json-1.0.2.tar.gz.

File metadata

  • Download URL: db_in_json-1.0.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for db_in_json-1.0.2.tar.gz
Algorithm Hash digest
SHA256 85637f112f102721eab1539281c7fb24ffa63dfe7aa604e4671152f63a423efc
MD5 dc6781b0a290147df9ff473643334b90
BLAKE2b-256 9623daf2b8442733f277d418646aa72d01692c89a50d307b38f9a61f4b811786

See more details on using hashes here.

File details

Details for the file db_in_json-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: db_in_json-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for db_in_json-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b3e7087ff1397bbe3aa178266c0a3da076ccd26e7252f56dbe443481b58afe16
MD5 60254771a6ff3bd04f3eaf090af60980
BLAKE2b-256 21c224127a66365a08893b2d39277f8afc8833907bee9f2a29d5bdd91182797a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page