Python serialization for adults
Project description
This fork from "eevee/camel" aims to maintain and potentially enhance the library, the original project has been inactive for years.
CamelX
CamelX is a library that lets you describe how to serialize your objects to YAML — and refuses to serialize them if you don't.
If you are interested in contributing, please submit pull requests.
Quick example:
from camelx import Camel, CamelRegistry
class DieRoll(tuple):
def __new__(cls, a, b):
return tuple.__new__(cls, [a, b])
def __repr__(self):
return "DieRoll(%s,%s)" % self
reg = CamelRegistry()
@reg.dumper(DieRoll, u'roll', version=None)
def _dump_dice(data):
return u"{}d{}".format(*data)
@reg.loader(u'roll', version=None)
def _load_dice(data, version):
a, _, b = data.partition(u'd')
return DieRoll(int(a), int(b))
value = DieRoll(3, 6)
camel = Camel([reg])
print(camel.dump(value))
# !roll 3d6
# ...
Docs: http://camel.readthedocs.org/en/latest/
GitHub: https://github.com/eevee/camel
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file camelx-0.0.1.tar.gz
.
File metadata
- Download URL: camelx-0.0.1.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af87ea694ae5e83c8700673a20c606108adbf606db5b03c18d80d64e6dee6042 |
|
MD5 | d791cf005c57580ba05985ba9e1c5281 |
|
BLAKE2b-256 | 359651435757cfaab4e28385d8b83f81f1e0e65eb123766edcc3cb2cd1609e00 |
File details
Details for the file camelx-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: camelx-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 927f1bdd2b392dda2a7d9cbefec6335ecdba40ad13762acb39575ce1a591977e |
|
MD5 | 101c1b2592da126dcdd6d821e88c6681 |
|
BLAKE2b-256 | 4e951b0fdd4e19523f23060b38c921d24085cb23f4fd851a967dfdfb500d208c |
File details
Details for the file camelx-0.0.1-cp312-cp312-win_arm64.whl
.
File metadata
- Download URL: camelx-0.0.1-cp312-cp312-win_arm64.whl
- Upload date:
- Size: 324.2 kB
- Tags: CPython 3.12, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1d0e1b11ae4140da6f6e40c8aa6d76bd23b33cb60744c2a5bb5da177f5539d7 |
|
MD5 | 98335f00ab9232175948eedc1a79bb3b |
|
BLAKE2b-256 | 67bceb77268e5fe253832ce98e6999ed216fd41359134cf2e29643a184e42e21 |
File details
Details for the file camelx-0.0.1-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: camelx-0.0.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 324.2 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1727c73d646dda62bfa3d99e3ab4bd409349b680d73ae538c9b49c1ae1e595d1 |
|
MD5 | f0e0958032f7c9a5f1f48713e5632565 |
|
BLAKE2b-256 | 1fb3516df7806ebe6df7e30d3b432502981632f3a3b4e82a68e4f0fb275564c8 |
File details
Details for the file camelx-0.0.1-cp312-cp312-manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: camelx-0.0.1-cp312-cp312-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 324.3 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98b5b30b5216d93b8dfed7e35b97c7251c8541c387975fe4907ca8262f0554ae |
|
MD5 | e682c462350e31049572b5906dc33979 |
|
BLAKE2b-256 | a5899f4bb818c8d47c1922eaee2c3836d80d6fb5a0a9b555844340106522986d |
File details
Details for the file camelx-0.0.1-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: camelx-0.0.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 324.3 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0329dc887837d367bcbd17d242977d3fa6fb507518bf9c294db90aef69c13ab7 |
|
MD5 | b55bf80f1d8cbf9f10b5be7e8c9eac0d |
|
BLAKE2b-256 | 69ad9e6ed3cb5040a4424b2c6a638ddfe893f5fb5f10e3d5158293f5d2b753a9 |
File details
Details for the file camelx-0.0.1-cp312-cp312-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: camelx-0.0.1-cp312-cp312-macosx_10_9_x86_64.whl
- Upload date:
- Size: 324.3 kB
- Tags: CPython 3.12, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be1a573fd26468f690af2485fcdf7b945de400f31a9cb0dd9b61dba71bb3498c |
|
MD5 | 5d923741587ee265fbf6225b67c82aa7 |
|
BLAKE2b-256 | ef2de0d3a457bd5ed5a4c166540fc69820fe8161224a9da32965f01462b65460 |
File details
Details for the file camelx-0.0.1-cp312-cp312-linux_armv7l.whl
.
File metadata
- Download URL: camelx-0.0.1-cp312-cp312-linux_armv7l.whl
- Upload date:
- Size: 324.3 kB
- Tags: CPython 3.12
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87593f4e4d16a0171e8ebc1646a88499708aa46a596f07c6528fa566adbd6641 |
|
MD5 | 7b0eae3e95127cc88d1a83ba9e933536 |
|
BLAKE2b-256 | 9fc2d1b58421a325bf8c2cd5b7b156aeedc852274ae3f21070716df134293f12 |