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.

Source Distribution

myjson-1.1.1.zip (3.5 kB view details)

Uploaded Source

File details

Details for the file myjson-1.1.1.zip.

File metadata

  • Download URL: myjson-1.1.1.zip
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for myjson-1.1.1.zip
Algorithm Hash digest
SHA256 7d4811ac8a77bbb354c7b35a176ace3b0f99a2af4689c532bbf056be346a7a23
MD5 b87d0d099c3f215ed49f1950e3ca2704
BLAKE2b-256 7e564c1e1be1cbffababd4fccbee8abe2656b1cb645d23542150bb6e252a2905

See more details on using hashes here.

Provenance

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