Skip to main content

A simple lightweight portable, embeddable database library

Project description

pysdb

pysdb is a lightweight , portable, embeddable database management library

Import first:

import pysdb

concepts

SDB_STORE

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

DATABASE

group of Collections is a Database

COLLECTIONS

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

Records

Records are like a row in a table

Record is pure python Dictionary

example:

student_record1  = {
  "name": "student1_name1",
  "age":19
 }

example

import pysdb

store = pysdb.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",
  "age":19
 }


student_record2  = {
  "name": "student_name2",
  "age":20
 }


 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.3.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

pysdb-0.0.3-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file pysdb-0.0.3.tar.gz.

File metadata

  • Download URL: pysdb-0.0.3.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.2

File hashes

Hashes for pysdb-0.0.3.tar.gz
Algorithm Hash digest
SHA256 c842d07ac3e9891dc4f8b2e4de4b0a8cdb7f5f73b1a93fa1282c34a84d4908d1
MD5 c8d492d9b1aac92e43e9df5ad6b7284c
BLAKE2b-256 22a23193a6ef77526deb74c4d4223c30a72abaf2328d75409916ac9b3b6451ca

See more details on using hashes here.

File details

Details for the file pysdb-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pysdb-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.2

File hashes

Hashes for pysdb-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4e6e5ebcfa6666994717466860f81cbbea6aa3a37378ba0f32e35f882f495f83
MD5 35588d24ef6692cf676513af7fb8df0d
BLAKE2b-256 01fc7d45981a569de1e718c4214580ba603d3e553c768cfc69166250b2bf5d35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page