Skip to content

Commit e3014b3

Browse files
committed
update readme
1 parent e852e73 commit e3014b3

File tree

2 files changed

+55
-28
lines changed

2 files changed

+55
-28
lines changed

README.md

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,54 @@
1-
# textbin
1+
# PyTextBin
22

3-
**textbin** is a Python package that provides text-to-binary and binary-to-text conversion, as well as JSON-to-base64 and base64-to-JSON encoding and decoding.
4-
See the [documentaion](https://c-o-m-o-n.github.io/textbin/) for more information
3+
**PyTextBin** is a versatile Python library facilitating seamless conversion between text, binary, JSON, base64, xml and CSV formats with ease.'
4+
See the [documentaion](https://github.com/Comon-tech/Pytextbin/) for more information
55

66

77
## Installation
88

9-
You can install **textbin** using pip from PyPI:
9+
You can install **PyTextBin** using pip from PyPI:
1010

1111
```bash
12-
pip install textbin
12+
pip install PyTextBin
1313
```
1414

1515
Alternatively, you can find the project on GitHub:
1616

17-
[GitHub Repository](https://github.com/C-o-m-o-n/textbin)
17+
[GitHub Repository](https://github.com/C-o-m-o-n/PyTextBin)
1818

1919
## Usage
2020

2121
### Text and Binary
2222

2323
```python
24-
from textbin.textbin import *
24+
# Import everything from textbin
25+
from pytextbin import *
2526

26-
# Convert text to binary
27-
word = "hello"
28-
converted_word = textbin.to_binary(word)
29-
print(converted_word) # Output: '1101000 1100101 1101100 1101100 1101111'
27+
#To begin, create an object from the Textbin() class, which you'll use to access all the methods.
3028

31-
# Convert binary to text
32-
binary = "1101000 1100101 1101100 1101100 1101111"
33-
converted_binary = textbin.to_text(binary)
34-
print(converted_binary) # Output: hello
35-
```
3629

37-
### JSON and Base64
30+
# 0) create textbin_obj instance
31+
textbin_obj = pytextbin.Textbin()
3832

39-
```python
40-
from textbin.textbin import json_to_base64, base64_to_json
33+
# 1) convert text to binary
34+
text = 'hello world'
35+
converted = textbin_obj.to_binary(text)
36+
print("to_binary>>", converted)
37+
38+
# 2) convert json data to a base64 string
39+
json_data = { 'id' : 12 , 'name' : 'Collins' }
40+
converted = textbin_obj.json_to_base64(json_data)
41+
print("json_to_base64>>", converted)
4142

42-
# Encode a JSON object to base64
43-
word = {"foo": "bar"}
44-
converted_word = json_to_base64(word)
45-
print(converted_word) # Output: eyJmb28iOiAiYmFyIn0=
43+
base64_data = 'eyJpZCI6IDEyLCAibmFtZSI6ICJDb2xsaW5zIn0='
44+
converted = textbin_obj.base64_to_json(base64_data)
45+
print("base64_to_json>>", converted)
4646

47-
# Decode a base64 string to a JSON object
48-
base64_string = "eyJmb28iOiAiYmFyIn0="
49-
converted_binary = base64_to_json(base64_string)
50-
print(converted_binary) # Output: {'foo': 'bar'}
5147
```
5248

5349
## Contributions
5450

55-
Contributions to **textbin** are welcome! You can find the project's GitHub repository and contribute to its development.
51+
Contributions to **PyTextBin** are welcome! You can find the project's GitHub repository and contribute to its development.
5652

5753
- [GitHub Repository](https://github.com/C-o-m-o-n/textbin)
5854

setup.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from setuptools import setup, find_packages
2+
import codecs
3+
import os
4+
5+
here = os.path.abspath(os.path.dirname(__file__))
6+
7+
with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
8+
long_description = "\n" + fh.read()
9+
10+
VERSION = '0.0.2'
11+
DESCRIPTION = 'PyTextBin is a versatile Python library facilitating seamless conversion between text, binary, JSON, base64, xml and CSV formats with ease.'
12+
13+
# Setting up
14+
setup(
15+
name="PyTextBin",
16+
version=VERSION,
17+
author="Collins O. Odhiambo",
18+
author_email="<[email protected]>",
19+
description=DESCRIPTION,
20+
packages=find_packages(),
21+
install_requires=['opencv-python', 'pyautogui', 'pyaudio'],
22+
keywords=['python', 'csv', 'xmml', 'base64', 'text', 'json', 'binary'],
23+
classifiers=[
24+
"Development Status :: 1 - Planning",
25+
"Intended Audience :: Developers",
26+
"Programming Language :: Python :: 3",
27+
"Operating System :: Unix",
28+
"Operating System :: MacOS :: MacOS X",
29+
"Operating System :: Microsoft :: Windows",
30+
]
31+
)

0 commit comments

Comments
 (0)