Skip to main content

jsonDB - A Python library for json-based databases with thread-safety, staging/commit and easy-to-use API.

Project description

simpleJDB

simpleJDB is a lightweight and easy-to-use python database that allows you to store, retrieve, and manipulate data with minimal code.

Features

  • Support for multiple data types: simpleJDB supports storing integers, strings, floats, and lists as values.
  • Concurrency Support: simpleJDB is thread-safe and can handle simultaneous access and modification of data by multiple users.
  • Staging/Commit: simpleJDB has a staging/commit feature that allows you to make changes to the data before committing them to the json file.
  • Documentation: simpleJDB is well-documented and easy to understand, making it easier to get started with the library.
  • Unit testing: simpleJDB has a comprehensive test suite to ensure that the library is working as expected and to catch any bugs before they are released to the public.

Getting Started

To initialize the database, simply import the simpleJDB module and create a new database object, passing in a name for the database as an argument:

import simpleJDB db = simpleJDB.database("my_database")

Adding and Updating Keys

To add a new key-value pair to the database, use the setkey() method and pass in the key name and the value to be stored:

db.setkey("age", 22)

You can also update the value of an existing key by calling setkey() with the same key name and a new value:

db.setkey("age", 23)

When you are ready to commit the changes to the json file, use the commit() method:

db.commit()

Retrieving and Deleting Keys

To retrieve the value of a key, use the getkey() method and pass in the key name:

age = db.getkey("age")

To delete a key, use the delkey() method and pass in the key name:

db.delkey("age")

Key Type

To check the data type of a key, use the gettype() method and pass in the key name:

data_type = db.gettype("age")

Conclusion

With simpleJDB, you can easily store and manipulate data in a pythonic way. With the added features, you can do more complex data manipulation and you can use it in a concurrent environment. Give it a try and see how it can simplify your project.

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

simpleJDB-0.1.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

simpleJDB-0.1.3-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file simpleJDB-0.1.3.tar.gz.

File metadata

  • Download URL: simpleJDB-0.1.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for simpleJDB-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5cf932fbfb2119c8fec2b1006bec189a2440d85170282ec2687d9542dda7bbf5
MD5 5ea22826f5e0398a23874ca7ac0e72be
BLAKE2b-256 2bd015112c4a0ac4734c97e3940b25026113f3a8763c7c3dfef1573e5cdfb5d0

See more details on using hashes here.

File details

Details for the file simpleJDB-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: simpleJDB-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for simpleJDB-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 20f56b649d583592347d4edc7b218464bfad0d1f3728afb1a1f4de10d29c1962
MD5 eb2927fe6753c09d8083f323651dd147
BLAKE2b-256 e4cacd26068afad15cb4d2c15afab9d01a36c4d570e0c6fc7d142ff300862799

See more details on using hashes here.

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