Skip to main content

Python wrapper for jsonbox.io

Project description

jsonbox-python

Python wrapper for https://jsonbox.io

Installation

pip install jsonbox

Usage

import uuid
from jsonbox import JsonBox

# generate unique box id
MY_BOX_ID = str(uuid.uuid4()).replace("-", "_")

# create instance
jb = JsonBox()

data = {"name": "David"}

# write data
result = jb.write(data, MY_BOX_ID)

# get record id of written data
record_id = jb.get_record_id(result)

# read record
print(jb.read(MY_BOX_ID, record_id))

# read all records in box
print(jb.read(MY_BOX_ID))

# update data
data = {"name": "Bob"}
jb.update(data, MY_BOX_ID, record_id)

# read updated data
print(jb.read(MY_BOX_ID, record_id))

# delete record
jb.delete(MY_BOX_ID, record_id)

License

MIT

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

jsonbox-0.1.3.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

jsonbox-0.1.3-py2-none-any.whl (2.9 kB view hashes)

Uploaded Python 2

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