Skip to main content

A useful library for simplifying work with .json files.

Project description

Betterjson

Library for easier working with JSON files in Python.

Quick example

{"names": ["Alex", "Allan"]}
import betterjsondb

db = betterjsondb.connect(file="tests.json", prefix="~")                  # Name of file and prefix can be custom

print(                                                                    # In concole you'll see:
    db.get("all"),                                                        # {'names': ['Alex', 'Allan']}
    db.push("cars", {"BMW": "car", "Tosiba": "not_car"}, callback=True),  # True
    db.update("cars", "=", {"BMW": "car"}, callback=True),                # True
    db.delete("names", callback=True),                                    # True
    db.get("all")                                                         # {'cars': {'BMW': 'car'}}
)

Important information

27.12.2021 library updated using Python 3.10. So now its strictly requere it on your PC.

Changelog:

v. 0.1.8:

After connect file if its not exists library will create it. Added warning to not existing file.

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

betterjsondb-0.1.9.tar.gz (3.5 kB view hashes)

Uploaded Source

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