
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
a simple python local database
to get started in an easy way... let's start by creating a new instance of the Data Base
from EasyDB import EasyDB, DB
db = EasyDB(autoSave=True)
collection: DB = db.newCollection
what is "autoSave" of the DB instance?
it is an automatic backup method, which you can activate or deactivate... having this system activated... your database is less vulnerable to a total loss of data, in case something unforeseen occurs
You can see some examples on: Create Items
for you to create objects in the database, it is also very easy... see below
collection.create("hello", "word")
Just that? ya
it is worth noting. To create objects in the database in a specific way you can do:
collection.create("hello", {})
collection.create("how are you?","good, and you?", "hello")
{
"hello": {
"how are you?": "good, and you?"
}
}
the path must be divided by dots
collection.create("hello", {})
collection.create("how are you?", {}, "hello")
collection.create("good, and you?", "me also", "hello.how are you?")
You can see some examples on: Delete Items
to delete an object you just use the .delete method. see below
collection.delete("path")
You can see some examples on: Filtering Items
To get start filtering objects, you must create a filter, lambda or a normal def
def filter(arg): #receive a db object
#your stuff, but must return a bool
return arg == 1
#or
filter = lambda x: x == 1
and then, call
for i in collection.filter(filter):
print(i.path, i.value)
filtering method returns 2 attributes. path and value
value return the value what returns True path return the path of the value ("path.to.value")
You can see some examples on: Finding Items
Find item is like the filtering method... but returns only one value
result = collection.find(filter)
print(result.path, result.value)
You can see some examples on: Getting Items
To get a item, you can just type:
print(collection.get(path if has))
You can see some examples on: Save Database
to save your database, you jsut type
collection.save()
You can see some examples on: Load Json
to load you json file to db you just type
collection.load("<path> or <file stream>", mode="set"| "append" )
apppend: append data to database
set: sets the data from de json as database
if autoSave is off... you can store any type of object. however when trying to save, it will corrupt your database
FAQs
A very easy database but very good :)
We found that EasyDB.py demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.