A package to simplify the use of json as a way to store data in Python.
Project description
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](https://pypi-camo.freetls.fastly.net/4440306ffe34e3262a8af3f48493b5a7bcb2c8a0/68747470733a2f2f6769746875622e636f6d2f666f72746d65612f707974686f6e2d6c6f63616c2d64617461626173652f616374696f6e732f776f726b666c6f77732f72656c656173652e796d6c2f62616467652e737667)
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
Project details
Release history Release notifications | RSS feed
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.1.0.tar.gz
(7.0 kB
view hashes)
Built Distribution
Close
Hashes for pylocaldatabase-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38af69a970b7e3347be15eed236baa3266bea0319d8007c0d7875e9caaa86087 |
|
MD5 | 8f00462959f774bb47f18a6a7c13fb5d |
|
BLAKE2b-256 | 870fe3aa2bfcb329dd3f9bc2a02811dae29f5dfb50fab80f3a2154a3d9458797 |