tgcode
Installation
You can install using the pip command line utility.
pip install tgcode
Usage
It’s simple, just use the encode() and decode() functions, just like that:
import tgcode
data = b'Hello, World!'
encoded = tgcode.encode(data)
decoded = tgcode.decode(encoded)
print('Are they equals: {}'.format(decoded==data))
Complex Usage
encode()
import tgcode
data = b'Hello, World!' #bytes data to be encoded
encoded_data = tgcode.encode(data) #encodes the data
print('Encoded bytes: {}'.format(encoded_data)) #prints the encoded data
decode()
import tgcode
encoded_data = '_=}o§}v§}v§}y=SG}=}y§}B§}v§}n=H' #the encoded string
data = tgcode.decode(encoded_data) #decodes the string
file = open('tgcode.test', 'wb') #opens a file with "write binary" flag
file.write(data) #writes the decoded data into the file
file.close() #saves the file
fast_encode()
import tgcode
file = open('tgcode.test', 'rb') #opens the file with "read binary" flag
data = file.read() #reads the data
fast_encoded = tgcode.fast_encode(data) #fastly encodes the data
file.close() #closes the file
print('Fastly encoded data: {}'.format(fast_encoded)) #prints the encoded data
License
MIT license
Copyright (c) 2016
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \`\`\`notice and
this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Metadata
Release files for TGCode 0.3.0.post2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| TGCode-0.3.0.post2.zip | 8.7 kB | Without provenance | Details |
Release files / TGCode-0.3.0.post2.zip
| Download URL | TGCode-0.3.0.post2.zip |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af37577a24c570d7d34a8e9e2ca628751947abcb918a241d672334536e92cdca
|
|
BLAKE2b-256 checksum How to use checksums |
6c88dea0a710fff68c9c9aec32982682018c0795eefb590f553a8ef0dbf2efdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for TGCode 0.3.0.post2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.