Skip to main content

A simple lightweight portable, embeddable database library

Project description


pysdb is a lightweight , portable, embeddable database management library

Import first:

import pysdb



SDB_STORE is a group of Databases

it's the directory where all the Databases exists.

SDB_STORE can be created by the following command:

$ mkdir /path/to/SDB_STORE/ && touch /path/to/SDB_STORE/sdbstore

if you prefer a different directory name change DB_STORE to whatever name you like , for example:

$ mkdir /path/to/MY_STORE/ && touch /path/to/MY_STORE/sdbstore


group of Collections is a Database


a bundle of Records is a collection (it's kinda like a Table)


Records are like a row in a table

Record is pure python Dictionary


student_record1  = {
  "name": "student1_name1",


import pysdb

store = sdb.UseStore('/path/to/DB_STORE/') # use the created store (returns a pointer to store)

store.CreateDB('db') # creates a db in store (returns true or false)

db = store.OpenDB('db') # opens a db in store (return a pointer to db)

store.CloseDB('db') # closes an opened db

store.DropDB('db') # deletes the entire database (return true or false)

store.LookForDB('db') # checks if a Database exists (returns true or false)

db.CreateCl('cl')  # creates a collection in db (returns true or false)

cl = db.OpenCl('cl') # opens a collection in db (returns a pointer to the collection)

db.CloseCl('cl') # closes the collection

db.DropCl('cl') # deletes a collection in db (returns true or false)

db.LookForCl('cl') # checks if a collection exists (returns true or false)

# create a record (pure python dictionary)
student_record1  = {
  "name": "student_name1",

student_record2  = {
  "name": "student_name2",

 cl.AddRec('student_record_1', student_record1) # adds a record to cl

 cl.UpdateRect('student_record_1', student_record2) # updates the record in cl

 cl.ReadRec('student_record_1') # returns a Record ( python dictionary - same as above student_record1 )

 cl.RemoveRect('student_record_1') # removes a Record in cl

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

pysdb-0.0.2.tar.gz (3.1 kB view hashes)

Uploaded source

Built Distribution

pysdb-0.0.2-py3-none-any.whl (3.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page