pyJCOF
A Python implementation of JCOF: JSON-like Compact Object Format
For an explanation on what JCOF is, please see https://github.com/mortie/jcof. This README does not explain the semantics of JCOF or its syntax.
Table of contents
📦 Installation
pyJCOF is available on PyPi. It requires a Python version of at least 3.10.0. and depends on no packages.
To install pyJCOF with pip:
python -m pip install jcof
The package name is
jcof, notpyjcof.
To install pyJCOF through Git:
python -m pip install git+https://gitlab.com/whoatemybutter/pyjcof.git
🛠 Usage
pyJCOF functions are similar to json.
Use jcof.dumps for converting Python values to JCOF,
and use jcof.loads for converting JCOF to Python values.
Use dump and load for dealing with files rather than objects.
import jcof
example = {
"people": [
{"first-name": "Bob", "age": 32, "occupation": "Plumber", "full-time": True},
{
"first-name": "Alice",
"age": 28,
"occupation": "Programmer",
"full-time": True,
},
{"first-name": "Bernard", "age": 36, "occupation": None, "full-time": None},
{"first-name": "El", "age": 57, "occupation": "Programmer", "full-time": False},
]
}
dumped = jcof.dumps(example)
# 'Programmer;"age""first-name""full-time""occupation";{"people"[(0,iw"Bob"b"Plumber")(0,is"Alice"b,s0)(0,iA"Bernard"n,n)(0,iV"El"B,s0)]}'
assert jcof.loads(dumped) == example
# Returns nothing; True
📰 Changelog
The changelog is at CHANGELOG.md.
📜 License
pyJCOF is licensed under
GNU General Public License 3.0 or later.
Metadata
Release files for jcof 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jcof-1.0.1.tar.gz | 21.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jcof-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.8 kB
Release files / jcof-1.0.1.tar.gz
| Download URL | jcof-1.0.1.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a93be33c5155e613ee7b8049bfddb998aa4fe231918dcc5fe9a7fab63ef0bad
|
|
BLAKE2b-256 checksum How to use checksums |
494244435bb7d2147609656de6cdf8e637a0d475ceb18ae593c616a7fb7b9785
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|
Release files / jcof-1.0.1-py3-none-any.whl
| Download URL | jcof-1.0.1-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20bcf855e254781211886104f6da5992926ac27acc92c2ad4ff97381dcb2c11c
|
|
BLAKE2b-256 checksum How to use checksums |
1ed3a49253bea4a2492be37bea5bf2a2a0da7a415a64ae9e781850d785ee422c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|