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.1.tar.gz (4.1 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.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: db_in_json-1.0.1.tar.gz
  • Upload date:
  • Size: 4.1 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.1.tar.gz
Algorithm Hash digest
SHA256 b03f3fc215b234c33a91a640ecc584e3abb8152597e60278c7482578a30508f1
MD5 4648e673e80a1a2ba16063d12816cdd1
BLAKE2b-256 f2bd3724a98f35efde8c6ec302b59b1d16ebd6737a4a0931c9221b24a9034e54

See more details on using hashes here.

File details

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

File metadata

  • Download URL: db_in_json-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc6c88a2046a5939010fcdcf741aeba0fc0d10d5cfd3cf1d7f84218dc192fd16
MD5 3f0a2564ee2dcaae1dc27524394113e1
BLAKE2b-256 5ee5faf390c2cc886db0b8f47e2459305a100078cf7dc2441a4c28832208f5c9

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