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 = 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",
  "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.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pysdb-0.0.2.tar.gz
  • Upload date:
  • Size: 3.1 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.2.tar.gz
Algorithm Hash digest
SHA256 ce622b60bdac6ac68c8385e22db313f27d654cf321a189398b295eb70e216087
MD5 b7b675b1fbd58be44309bd5e1ccd10e2
BLAKE2b-256 b1c279967ba1736774ac1fc546c16b72b371b7a70f9d5b1fc76dc7627646d45c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysdb-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74c3c0c9f59e035da3201baf060d788893a5cb3f58268f14c0ff38396d3b6c35
MD5 7bbb59f512f8aa1d8894a4c86617c300
BLAKE2b-256 c85e533e1df416c3373d6b860f7b2cf68cf618a572bf98b88e186133a469d952

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