Skip to main content

simple json database

Project description

PyPI GitHub repo size GitHub GitHub last commit

GitHub repo size GitHub Repo stars

Features

  • Easy to use
  • Encoding support
  • Json friendly
  • Light weight and fastest
  • Support all python types

Instalation

Via pip

$ pip install spacedb

Via github

$ git clone https://github.com/fxckfxtxre/SpaceDB.git
$ cd SpaceDB
$ python setup.py

Docs

  • Initialization:

    db = spacedb.Storage(<name>, <[args]>, <encoding>)
    example = spacedb.Storage("cars", ["name", "power", "color"], "base64")
    
    #Note: encoding in 1.1.0v supports base64 or json
    
  • Add

    db.add(<arg>=<value>, ...)
    example.add(name="ferrari", power=1000, color="red")
    
  • Delete

    db.delete(<arg>=<value>, ...)
    example.delete(power=1000)
    
    #Note: also use 2 and more args
    example.delete(color="red", power=1000) #its work
    
  • Update

    Update data

    db.update({<new args>}, <old arg>, ...)
    example.update({"name": "bmw"}, name="ferrari")
    
    #Note: also use 2 and more args
    example.update({"name": "bmw", "power": 750}, name="ferrari", color="red")
    
  • Search

    Return first data by your query

    db.search(<arg>=<value>, ...)
    example.search(name="ferrari") #return data or none
    
    #Note: also use 2 and more args
    example.search(name="ferrari", color="red")
    
  • Search All

    As opposed to search this method returned all data by your query

    db.search_all(<arg>=<value>, ...)
    example.search_all(name="ferrari") #return [data, data] or none
    
  • Unique

    Check unique

    db.unique(<arg>=<value>, ...)
    example.unique(name="ferrari") #if unique return true else false
    
    #Note: also use 2 and more args
    example.unique(name="ferrari", power=1000)
    
  • Data

    All data from database

    db.data() #return all data from db
    

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

spacedb-1.1.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Supported by

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