Python implementation of jsonurl, an alternative format for JSON data model
Project description
About
This is a python implementation of jsonurl, an alternative text format which encodes the same data model in a way that is more suitable for use in URLs.
This is an incomplete implementation.
Installation
pip install jsonurl-py
The package name is jsonurl_py to avoid confusion with an unrelated jsonurl package on pypi which implements an unrelated syntax. In theory you can install and import both packages without having them interfere with each other.
The project name uses a dash in the name for consistency with the existing jsonurl-js and jsonurl-java implementations.
Usage
import jsonurl_py as jsonurl assert jsonurl.loads('(a:1,b:c)') == {'a': 1, 'b': 'c'} assert jsonurl.dumps(dict(a=[1,2])) == '(a:(1,2))'
Command Line Interface
The package includes a command line interface for converting between jsonurl and standard json:
$ echo "(a:b)" | jsonurl-py load {"a": "b"} $ echo '{"a":"b"}' | jsonurl-py dump (a:b)
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
Built Distribution
File details
Details for the file jsonurl-py-0.2.0.tar.gz
.
File metadata
- Download URL: jsonurl-py-0.2.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7669b3d2f1fd7aa4993547ba7a64809034bbbb44b966f5f36711726e3da637ad |
|
MD5 | 66a8961b4097dbe35b4a6e730c7dcba9 |
|
BLAKE2b-256 | 34cb29128377075001e20d0d322391f50a2ebbc706a7e6a71478d7b0feba33d1 |
File details
Details for the file jsonurl_py-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: jsonurl_py-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01459ebc9b075833a6c19b5af99e3738193c2bd5ed3e4d4f840381df4fd8cb53 |
|
MD5 | 6da165bf1e37c1f0c19fb5404723f221 |
|
BLAKE2b-256 | d9f5d31f718c9c0a1daf97ce7eec8adc2f438dcc8dd35474f80586edcbf0f9f9 |