🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

spacedb

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spacedb

simple json database

pipPyPI
Version
1.1.0
Maintainers
1

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
    

Keywords

database

FAQs

Did you know?

Socket

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.

Install

Related posts