Skip to content

Commit 52b975d

Browse files
committed
Improved README
1 parent f163248 commit 52b975d

1 file changed

Lines changed: 57 additions & 32 deletions

File tree

README.md

Lines changed: 57 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<h1 align="center">CodExt <a href="https://twitter.com/intent/tweet?text=CodExt%20-%20Encoding%2Fdecoding%20anything.%0D%0APython%20library%20extending%20the%20native%20codecs%20library%20with%20many%20new%20encodings%20and%20providing%20CLI%20tools%20with%20a%20guess%20feature%20based%20on%20AI.%0D%0Ahttps%3a%2f%2fgithub%2ecom%2fdhondta%2fpython-codext%0D%0A&hashtags=python,programming,encodings,codecs,cryptography,morse,base,ctftools"><img src="https://img.shields.io/badge/Tweet--lightgrey?logo=twitter&style=social" alt="Tweet" height="20"/></a></h1>
2+
<h3 align="center">Encode/decode anything.</h3>
3+
14
[![PyPi](https://img.shields.io/pypi/v/codext.svg)](https://pypi.python.org/pypi/codext/)
25
[![Read The Docs](https://readthedocs.org/projects/python-codext/badge/?version=latest)](https://python-codext.readthedocs.io/en/latest/?badge=latest)
36
[![Build Status](https://travis-ci.com/dhondta/python-codext.svg?branch=master)](https://travis-ci.com/dhondta/python-codext)
@@ -7,88 +10,105 @@
710
[![Known Vulnerabilities](https://snyk.io/test/github/dhondta/python-codext/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/dhondta/python-codext?targetFile=requirements.txt)
811
[![License](https://img.shields.io/pypi/l/codext.svg)](https://pypi.python.org/pypi/codext/)
912

10-
## Introduction
11-
1213
This library extends the native [`codecs`](https://docs.python.org/3/library/codecs.html) library (namely for adding new custom encodings and character mappings) and provides a myriad of new encodings (static or parametrized, like `rot` or `xor`), hence its named combining *CODecs EXTension*.
1314

14-
15-
16-
## Setup
17-
1815
```sh
1916
$ pip install codext
2017
```
2118

22-
**Note**: Some encodings are available in Python 3 only.
23-
24-
## Demonstrations
19+
## :mag: Demonstrations
2520

2621
<p align="center"><img src="https://raw.githubusercontent.com/dhondta/python-codext/master/docs/demos/using-codext.gif" alt="Using CodExt from the command line"></p>
2722
<p align="center"><img src="https://raw.githubusercontent.com/dhondta/python-codext/master/docs/demos/using-bases.gif" alt="Using base tools from the command line"></p>
2823
<p align="center"><img src="https://raw.githubusercontent.com/dhondta/python-codext/master/docs/demos/using-debase.gif" alt="Using the debase command line tool"></p>
2924

30-
## Usage (CLI tool)
25+
## :computer: Usage (main CLI tool) <a href="https://twitter.com/intent/tweet?text=CodExt%20-%20Encode%2Fdecode%20anything.%0D%0APython%20tool%20for%20encoding%20and%20decoding%20almost%20anything,%20including%20a%20guess%20feature%20based%20on%20AI.%0D%0Ahttps%3a%2f%2fgithub%2ecom%2fdhondta%2fpython-codext%0D%0A&hashtags=python,encodings,codecs,cryptography,morse,base,stegano,steganography,ctftools"><img src="https://img.shields.io/badge/Tweet%20(codext)--lightgrey?logo=twitter&style=social" alt="Tweet on codext" height="20"/></a>
3126

32-
```sh
27+
```session
3328
$ codext -i test.txt encode dna-1
3429
GTGAGCGGGTATGTGA
30+
3531
$ echo -en "test" | codext encode morse
3632
- . ... -
37-
```
38-
39-
Python 3 (includes Ascii85, Base85, Base100 and braille):
4033
41-
```sh
4234
$ echo -en "test" | codext encode braille
4335
⠞⠑⠎⠞
36+
4437
$ echo -en "test" | codext encode base100
4538
👫👜👪👫
4639
```
4740

48-
Using codecs chaining:
41+
Chaining codecs:
4942

5043
```sh
5144
$ echo -en "Test string" | codext encode reverse
5245
gnirts tseT
46+
5347
$ echo -en "Test string" | codext encode reverse morse
5448
--. -. .. .-. - ... / - ... . -
49+
5550
$ echo -en "Test string" | codext encode reverse morse dna-2
5651
AGTCAGTCAGTGAGAAAGTCAGTGAGAAAGTGAGTGAGAAAGTGAGTCAGTGAGAAAGTCAGAAAGTGAGTGAGTGAGAAAGTTAGAAAGTCAGAAAGTGAGTGAGTGAGAAAGTGAGAAAGTC
52+
5753
$ echo -en "Test string" | codext encode reverse morse dna-2 octal
5854
101107124103101107124103101107124107101107101101101107124103101107124107101107101101101107124107101107124107101107101101101107124107101107124103101107124107101107101101101107124103101107101101101107124107101107124107101107124107101107101101101107124124101107101101101107124103101107101101101107124107101107124107101107124107101107101101101107124107101107101101101107124103
55+
5956
$ echo -en "AGTCAGTCAGTGAGAAAGTCAGTGAGAAAGTGAGTGAGAAAGTGAGTCAGTGAGAAAGTCAGAAAGTGAGTGAGTGAGAAAGTTAGAAAGTCAGAAAGTGAGTGAGTGAGAAAGTGAGAAAGTC" | codext -d dna-2 morse reverse
6057
test string
6158
```
6259

63-
## Usage (Python)
60+
## :computer: Usage (base CLI tool) <a href="https://twitter.com/intent/tweet?text=Debase%20-%20Decode%20any%20multi-layer%20base-encoded%20string.%0D%0APython%20tool%20for%20decoding%20any%20base-encoded%20string,%20even%20when%20encoded%20with%20multiple%20layers.%0D%0Ahttps%3a%2f%2fgithub%2ecom%2fdhondta%2fpython-codext%0D%0A&hashtags=python,base,encodings,codecs,cryptography,stegano,steganography,ctftools"><img src="https://img.shields.io/badge/Tweet%20(debase)--lightgrey?logo=twitter&style=social" alt="Tweet on debase" height="20"/></a>
61+
62+
```session
63+
$ echo "Test string !" | base122
64+
*.7!ft9�-f9Â
65+
66+
$ echo "Test string !" | base91
67+
"ONK;WDZM%Z%xE7L
68+
69+
$ echo "Test string !" | base91 | base85
70+
B2P|BJ6A+nO(j|-cttl%
71+
72+
$ echo "Test string !" | base91 | base85 | base36 | base58-flickr
73+
QVx5tvgjvCAkXaMSuKoQmCnjeCV1YyyR3WErUUErFf
74+
75+
$ echo "Test string !" | base91 | base85 | base36 | base58-flickr | base58-flickr -d | base36 -d | base85 -d | base91 -d
76+
Test string !
77+
```
78+
79+
```session
80+
$ echo "Test string !" | base91 | base85 | base36 | base58-flickr | debase -m 3
81+
Test string !
82+
83+
$ echo "Test string !" | base91 | base85 | base36 | base58-flickr | debase -f Test
84+
Test string !
85+
```
86+
87+
## :computer: Usage (Python)
6488

6589
Getting the list of available codecs:
6690

6791
```python
6892
>>> import codext
93+
6994
>>> codext.list()
7095
['ascii85', 'base85', 'base100', 'base122', ..., 'tomtom', 'dna', 'html', 'markdown', 'url', 'resistor', 'sms', 'whitespace', 'whitespace-after-before']
71-
```
72-
73-
Usage examples:
7496

75-
```python
7697
>>> codext.encode("this is a test", "base58-bitcoin")
7798
'jo91waLQA1NNeBmZKUF'
99+
78100
>>> codext.encode("this is a test", "base58-ripple")
79101
'jo9rA2LQwr44eBmZK7E'
102+
80103
>>> codext.encode("this is a test", "base58-url")
81104
'JN91Wzkpa1nnDbLyjtf'
82-
```
83105

84-
```python
85106
>>> codecs.encode("this is a test", "base100")
86107
'👫👟👠👪🐗👠👪🐗👘🐗👫👜👪👫'
108+
87109
>>> codecs.decode("👫👟👠👪🐗👠👪🐗👘🐗👫👜👪👫", "base100")
88110
'this is a test'
89-
```
90111

91-
```python
92112
>>> for i in range(8):
93113
print(codext.encode("this is a test", "dna-%d" % (i + 1)))
94114
GTGAGCCAGCCGGTATACAAGCCGGTATACAAGCAGACAAGTGAGCGGGTATGTGA
@@ -101,22 +121,21 @@ GAGTGCCTGCCGGATATCTTGCCGGATATCTTGCTGTCTTGAGTGCGGGATAGAGT
101121
CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
102122
>>> codext.decode("GTGAGCCAGCCGGTATACAAGCCGGTATACAAGCAGACAAGTGAGCGGGTATGTGA", "dna-1")
103123
'this is a test'
104-
```
105124

106-
```python
107125
>>> codecs.encode("this is a test", "morse")
108126
'- .... .. ... / .. ... / .- / - . ... -'
127+
109128
>>> codecs.decode("- .... .. ... / .. ... / .- / - . ... -", "morse")
110129
'this is a test'
130+
111131
>>> with open("morse.txt", 'w', encoding="morse") as f:
112132
f.write("this is a test")
113133
14
134+
114135
>>> with open("morse.txt",encoding="morse") as f:
115136
f.read()
116137
'this is a test'
117-
```
118138

119-
```python
120139
>>> codext.decode("""
121140
=
122141
X
@@ -140,9 +159,7 @@ o
140159
o
141160
z """, "whitespace-after+before")
142161
'CSC{not_so_invisible}'
143-
```
144162

145-
```python
146163
>>> print(codext.encode("An example test string", "baudot-tape"))
147164
***.**
148165
. *
@@ -169,7 +186,7 @@ o
169186
* .*
170187
```
171188

172-
## List of codecs
189+
## :page_with_curl: List of codecs
173190

174191
**Codec** | **Conversions** | **Comment**
175192
:---: | :---: | ---
@@ -231,3 +248,11 @@ A few variants are also implemented.
231248
`southpark-icase` | text <-> Kenny's language | same as `southpark` but case insensitive
232249
`whitespace_after_before` | text <-> lines of whitespaces[letter]whitespaces | encodes characters as new characters with whitespaces before and after according to an equation described in the codec name (e.g. "`whitespace+2*after-3*before`")
233250

251+
252+
## :clap: Supporters
253+
254+
[![Stargazers repo roster for @dhondta/python-codext](https://reporoster.com/stars/dark/dhondta/python-codext)](https://github.com/dhondta/python-codext/stargazers)
255+
256+
[![Forkers repo roster for @dhondta/python-codext](https://reporoster.com/forks/dark/dhondta/python-codext)](https://github.com/dhondta/python-codext/network/members)
257+
258+
<p align="center"><a href="#"><img src="https://img.shields.io/badge/Back%20to%20top--lightgrey?style=social" alt="Back to top" height="20"/></a></p>

0 commit comments

Comments
 (0)