Skip to main content

API wrapper for myjson

Project description

Quickly, freely host json data with this Python wrapper for the mysjon.com free beta service.

Warning: Anyone can read and alter this data as soon as you post it…

Install

pip install myjson

Use as module:

>>> import myjson
>>> import json
>>> url = myjson.store(json.dumps({"test": "ing"}))
>>> url
'https://api.myjson.com/bins/ccq2j'
>>> json.loads(myjson.get(url))["test"]
'ing'
>>> id = myjson.store(json.dumps({"alpha": "beta"}), update=url, id_only=True)
>>> print(myjson.get(id))
{"alpha":"beta"}
>>> print(myjson.get(url))
{"alpha":"beta"}
>>> id
'ccq2j'
>>> url
'https://api.myjson.com/bins/ccq2j'

As a script

~$ myjson -h
usage: myjson [-h] {get,store} ...

A python commandline utility for working with https://myjson.com/

positional arguments:
  {get,store}  mjson commands

optional arguments:

  -h, --help   show this help message and exit

~$ myjson store example.json

https://api.myjson.com/bins/ut5tn

~$ myjson get ut5n --compact

[1,2,3]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for myjson, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size myjson-1.1.1.zip (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page