https://github.com/fortmea/python-local-database
A python package made to simplify the use of json as a mean to organize and store data.
https://github.com/fortmea/python-local-database
database json python3
Last synced: 5 months ago
JSON representation
A python package made to simplify the use of json as a mean to organize and store data.
- Host: GitHub
- URL: https://github.com/fortmea/python-local-database
- Owner: fortmea
- License: mit
- Created: 2022-05-19T20:20:39.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-13T19:04:54.000Z (over 2 years ago)
- Last Synced: 2024-09-18T17:08:59.629Z (almost 2 years ago)
- Topics: database, json, python3
- Language: Python
- Homepage: https://pypi.org/project/pylocaldatabase/
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Local Database

A python package made to simplify the use of json as a mean to organize and store data in python.
[](https://github.com/fortmea/python-local-database/actions/workflows/release.yml)
----------
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install Python Local Database.
### Linux/macOS:
```bash
pip install pylocaldatabase
```
### Windows:
```bash
py -m pip install pylocaldatabase
```
Release history and file downloads can be found [on the project's pypi page](https://pypi.org/project/pylocaldatabase/).
----
## Usage
```python
# 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](https://github.com/fortmea/python-local-database/tree/main/examples).
## Cryptography
An example on how to use the built-in Cryptography functions, you can refer to [Example 2.](https://github.com/fortmea/python-local-database/blob/main/examples/example2.py)
## 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](https://choosealicense.com/licenses/mit/)