xzy 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xzy-1.0.0/LICENSE +23 -0
- xzy-1.0.0/PKG-INFO +9 -0
- xzy-1.0.0/README.md +44 -0
- xzy-1.0.0/setup.cfg +4 -0
- xzy-1.0.0/setup.py +9 -0
- xzy-1.0.0/xzy.egg-info/PKG-INFO +9 -0
- xzy-1.0.0/xzy.egg-info/SOURCES.txt +8 -0
- xzy-1.0.0/xzy.egg-info/dependency_links.txt +1 -0
- xzy-1.0.0/xzy.egg-info/top_level.txt +1 -0
- xzy-1.0.0/xzy.py +56 -0
xzy-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
XZY Non-Commercial License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 XZY Developments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted to use, copy, modify, and distribute this software
|
|
6
|
+
for personal, educational, and non-commercial purposes only.
|
|
7
|
+
|
|
8
|
+
Commercial use is strictly prohibited without explicit written permission
|
|
9
|
+
from XZY Developments.
|
|
10
|
+
|
|
11
|
+
Users may not sell, sublicense, monetize, or include this software in any
|
|
12
|
+
commercial product or service without authorization.
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice must be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
xzy-1.0.0/PKG-INFO
ADDED
xzy-1.0.0/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# XZY
|
|
2
|
+
|
|
3
|
+
Encoding, decoding, and utility tools by XZY.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install xzy
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from xzy import encode, decode
|
|
15
|
+
|
|
16
|
+
text = "hello"
|
|
17
|
+
|
|
18
|
+
encoded = encode(text)
|
|
19
|
+
|
|
20
|
+
print(encoded)
|
|
21
|
+
|
|
22
|
+
decoded = decode(encoded)
|
|
23
|
+
|
|
24
|
+
print(decoded)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Example Output
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
x5xx0xx1xx1xx16x
|
|
31
|
+
hello
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
- Encode text
|
|
37
|
+
- Decode encoded text
|
|
38
|
+
- Lightweight
|
|
39
|
+
- Easy to use
|
|
40
|
+
- Expandable for future tools
|
|
41
|
+
|
|
42
|
+
## Author
|
|
43
|
+
|
|
44
|
+
XZY Developments
|
xzy-1.0.0/setup.cfg
ADDED
xzy-1.0.0/setup.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
xzy
|
xzy-1.0.0/xzy.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
convert = {
|
|
2
|
+
"a":"7","b":"19","c":"2","d":"14","e":"0",
|
|
3
|
+
"f":"23","g":"11","h":"5","i":"17","j":"8",
|
|
4
|
+
"k":"25","l":"1","m":"21","n":"9","o":"16",
|
|
5
|
+
"p":"4","q":"13","r":"20","s":"6","t":"24",
|
|
6
|
+
"u":"10","v":"18","w":"3","x":"22","y":"15","z":"12"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
reverse = {v: k for k, v in convert.items()}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def encode(text):
|
|
13
|
+
encoded = ""
|
|
14
|
+
|
|
15
|
+
for char in text.lower():
|
|
16
|
+
|
|
17
|
+
if char in convert:
|
|
18
|
+
encoded += f"x{convert[char]}x"
|
|
19
|
+
|
|
20
|
+
else:
|
|
21
|
+
encoded += char
|
|
22
|
+
|
|
23
|
+
return encoded
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def decode(text):
|
|
27
|
+
decoded = ""
|
|
28
|
+
|
|
29
|
+
i = 0
|
|
30
|
+
|
|
31
|
+
while i < len(text):
|
|
32
|
+
|
|
33
|
+
if text[i] == "x":
|
|
34
|
+
|
|
35
|
+
end = text.find("x", i + 1)
|
|
36
|
+
|
|
37
|
+
if end != -1:
|
|
38
|
+
|
|
39
|
+
code = text[i + 1:end]
|
|
40
|
+
|
|
41
|
+
if code in reverse:
|
|
42
|
+
decoded += reverse[code]
|
|
43
|
+
else:
|
|
44
|
+
decoded += "x" + code + "x"
|
|
45
|
+
|
|
46
|
+
i = end + 1
|
|
47
|
+
|
|
48
|
+
else:
|
|
49
|
+
decoded += text[i]
|
|
50
|
+
i += 1
|
|
51
|
+
|
|
52
|
+
else:
|
|
53
|
+
decoded += text[i]
|
|
54
|
+
i += 1
|
|
55
|
+
|
|
56
|
+
return decoded
|