Used to encode or decode data in a web-friendly format.
Project description
Web Encoder
Used to encode and decode data in a web-friendly format.
It's only uses building libraries, therefore, it has no external dependency. It is also lightweight and thread-safe, which makes it ideal for use in services and microservices.
By default WebEncoder will try to compress the data. If it manages to compress the data, the encoded data started with '.'.
Typical usage example:
Encode session
web_encoder = WebEncoder()
session_id = "b801692b-135f-40ff-8f7e-016dc7748c45"
session = {"user_uuid": "67fa3e17-4672-4036-8184-7fbe4c097439"}
encoded_session = web_encoder.encode(json.dumps(session))
redis.set(session_id, encoded_session)
Decode session
web_encoder = WebEncoder()
session_id = "b801692b-135f-40ff-8f7e-016dc7748c45"
encoded_session = redis.get(session_id)
session = json.loads(web_encoder.decode(encoded_session))
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
Web Encoder-0.1.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for Web_Encoder-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94ae55de0ffb4b4fcb347bec4c64a5a2eab61a15b0355c48006b46b9780a207a |
|
MD5 | 68c9886237c89c23f75ac2a822e235b4 |
|
BLAKE2b-256 | 0db2b393ce38afd2417e95f0a48561190851ecde401bff6d43cbabacce978c41 |