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 SimpleEncoder 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 SimpleEncoder 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.1.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file SimpleEncoder-0.0.1.tar.gz
.
File metadata
- Download URL: SimpleEncoder-0.0.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b445b95a4875f11169982470a8880e844bba4aef3a7c35d258804ba04e74089f |
|
MD5 | 327ef26b9f266431a00aa5761fcbdee7 |
|
BLAKE2b-256 | c54cb09929490357619304e394daa919c93e5b5361e3029391ceda4c67f6bf24 |
File details
Details for the file SimpleEncoder-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: SimpleEncoder-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab2baedca0738b488e8a2a2b3817d026a8277a62ea86686067cfa02808c62079 |
|
MD5 | cd9206c7a85a55d5d14e2b5f523e2f6d |
|
BLAKE2b-256 | 8052deacf750f88141d6ba0774dff07791c391f65807ce5b7b7372fc9b9d5e7b |