Simple and fast data encoding.
Project description
SimpleEncoder
[?] A simple library for encode, decode and hash data.
Installation
Python require 3.6+
install SimpleEncoder libary:
pip install SimpleEncoder
Examples
Encode and decode string and dict:
from SimpleEncoder import SimpleEncode as SE
str_encoded = SE.Encode("hello world!").b64_str()
print(str_encoded) # aGVsbG8gd29ybGQh
str_decoded = SE.Decode(str_encoded).b64_str()
print(str_decoded) # hello world!
example use b64_dict:
from SimpleEncoder import SimpleEncode as SE
mydict = dict(hello_content="hello", username="world", use_important=True, important_suffix="!")
str_encoded = SE.Encode(mydict).b64_dict()
print(str_encoded) # {'hello_content': 'aGVsbG8=', 'username': 'd29ybGQ=', 'use_important': 'VHJ1ZQ==', 'important_suffix': 'IQ=='}
str_decoded = SE.Decode(str_encoded).b64_dict()
print(str_decoded) # {'hello_content': 'hello', 'username': 'world', 'use_important': 'True', 'important_suffix': '!'}
# use b64_dict argument encode keys:
str_encoded = SE.Encode(mydict).b64_dict(encode_keys=True)
print(str_encoded) # {'aGVsbG9fY29udGVudA==': 'aGVsbG8=', 'dXNlcm5hbWU=': 'd29ybGQ=', 'dXNlX2ltcG9ydGFudA==': 'VHJ1ZQ==', 'aW1wb3J0YW50X3N1ZmZpeA==': 'IQ=='}
str_decoded = SE.Decode(str_encoded).b64_dict(encode_keys=True)
print(str_decoded) # {'hello_content': 'hello', 'username': 'world', 'use_important': 'True', 'important_suffix': '!'}
Documentation for the library: GitHub WIKI
##the library will be constantly updated and will be better soon!
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
SimpleEncoder-0.0.2.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for SimpleEncoder-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53ab5a24643f70d570e8351ceb051b3a5abebd3d01dadddd580247b2926932be |
|
MD5 | beabce25a3bcfc6274f986bd5156f801 |
|
BLAKE2b-256 | 392c369ac886e10c840cd1e777bd99be90d4cc750a3e169aace524dc00ab0b5a |