Skip to main content

A package to simplify the use of json as a way to store data in Python.

Project description

Python Local Database

Logo Python Local Database

A python package made to simplify the use of json as a mean to organize and store data in python. Upload Python Package

Installation

Use the package manager pip to install Python Local Database.

Linux/macOS:

pip install pylocaldatabase

Windows:

py -m pip install pylocaldatabase

Release history and file downloads can be found on the project's pypi page.


Usage

# import library
from pylocaldatabase import pylocaldatabase

# define database file and assign databasecontroller instance to var dbcontroll
dbcontroll = pylocaldatabase.databasecontroller(path="file.json")

# load data from file
dbcontroll.load()

# create database file 'file.json'
dbcontroll.makeDatabase()

# creating document 
dbcontroll.insertDocument({}, "documentName")

# assigning document to a var
document = dbcontroll.getDocument("documentName")

# inserting Item in the document
document.insertItem("ItemName", {"Property":"Property Value"})

# reading Item data
itemData = document.getItem("ItemName").get()

# assigning item to var
item = document.getItem("ItemName")

# inserting new property in Item
item.insertProperty("Property Name", "Property Value")

# removing property from item
item.removeProperty("Property Name")

# removing item from document 

document.removeItem("ItemName")

# save data 
dbcontroll.save()

Examples

Examples can be found here.

Cryptography

An example on how to use the built-in Cryptography functions, you can refer to Example 2.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

pylocaldatabase-1.0.9b0.tar.gz (6.8 kB view hashes)

Uploaded Source

Built Distribution

pylocaldatabase-1.0.9b0-py3-none-any.whl (6.3 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