Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Latest commit

 

History

History
56 lines (48 loc) · 777 Bytes

File metadata and controls

56 lines (48 loc) · 777 Bytes

Installation

pip install EasyJSON

Usage

EasyJSON is a package i made for people to ease the use of JSON files

from EasyJSON import JSON
db = JSON("JSON_FILE_LOCATION", indent=4)

You can now use it like any other db, but its a json!

Adding data

db.add('Water', 'Lava')
db.query.all()
#{"Water": "Lava"}

Editing data

db.edit('Water', 'Air')
db.query.all()
#{"Water": "Air"}

Removing data

db.delete('Water')
db.query.all()
#{}

Clear JSON

db.reset()
#{}

Getting all the data

db.add('Water', 'Lava')
db.add('Air', 'Soil')
db.query.all()
#{"Water": "Lava", "Air": "Soil"}

Getting specific data

db.query.filter_by('Water')
#'Lava'
db.query.filter_by('Lava')
#None