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 hashes)

Uploaded Source

Built Distribution

simpleJDB-0.1.3-py3-none-any.whl (4.2 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