Skip to main content

getsetpy

Python connector for GetSetDB with official support.

Some familiarity with GetSetDB would come a long way in using getsetpy as most of the API calls by the space.Space and database.Database inter-actors comes directly from it. To learn GetSetDB, refer to A Tour of GetSetDB

Installation

$ pip install getsetpy

Usage

getsetpy provides an interface to GetSetDB by using inter-actors that provide a similar and easy to use API for sending commands to the Space or a particular Database.

Space API

To run Space commands, use the space.Space inter-actor -

from getsetpy.space import Space

space = Space()
databases = space.ls() # returns list of all databases

space.new('users') # creates a new database
space.delete('old_database') # deletes an old database

space.rename('users', 'people') # renames 'user' database to 'people'

commands = space.commands() # returns a list of commands for "space"

Database API

To run commands for a specific Database, use the database.Database inter-actor -

from getsetpy.database import Database

# connects to the 'users' database
users = Database('users') 
# if it does not exist, it raises a DatabaseNotFound exception

# returns a dictionary with all the user keys as values and a redundant number as the key
users = users.all() 
# returns an empty dictionary if no pairs are found
# but if the users database was populated like this - 
# manan : yadav
# bruce : wayne
# martha : stewart
# kunal : pahuja
# peter : parker
# donald : trump
# barry : allen
# sheldon : cooper
# then the dictionary would look like
# {1.0: 'manan', 2.0: 'bruce', 3.0: 'martha', 4.0: 'kunal', 5.0: 'peter', 6.0: 'donald', 7.0: 'barry', 8.0: 'sheldon'}

# deletes the pair - donald : trump to database 'users'
users.delete('donald')

# gets the value for key 'barry'
users.get('barry')
# 'allen'

# adds the pair - wonder : woman to database 'users'
users.set('wonder', 'woman')

# returns a dictionary containg info about the database 'users'
# like its size in bytes and the path to its file
users.info()
# {'size': '136 bytes', 'path': '/tmp/gsdb/users.gsdb'}

# returns the number of pairs in the 'users' database
users.count()
# 8

Metadata

Release files for getsetpy 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for getsetpy 1.2.1
File Size Uploaded Provenance
getsetpy-1.2.1.tar.gz 5.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for getsetpy 1.2.1
File Interpreter ABI Platform
getsetpy-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / getsetpy-1.2.1.tar.gz

Download URL getsetpy-1.2.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6bd191f083c7433173cb7d1d880b49a1060d8f3f3f3096f34d0a14f8e7417f08
BLAKE2b-256 checksum
How to use checksums
f56ef7330d0df2badd34d600174c1d2d15d607e10b104c5ea492351f5d554555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Release files / getsetpy-1.2.1-py3-none-any.whl

Download URL getsetpy-1.2.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25ac41a2d53a092278f2983399172fdbac6cc395438d7447b0870a3a989cb286
BLAKE2b-256 checksum
How to use checksums
b71c2c95ff199d4e357403c21c43dce8bb4b671b07b17b6d9119421ab1ed460d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Security for getsetpy 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page