diff --git a/docs/index.html b/docs/index.html index 8ffd230..9af9501 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,174 +1,3 @@ - @@ -197,7 +26,13 @@
+ You can install textbin through your terminal using pip from PyPI
+
+ pip install textbin
+
+
Inside the textbin.py, there is a 'Textbin()' class which has the methods:
-
+
# import textbin
from textbin.textbin import *
# create textbin_obj instance
@@ -223,41 +58,56 @@ Usage
+
+ from textbin.textbin import *
+ textbin_obj = textbin.Textbin()
+
+ # Convert text to binary
+ word = "hello"
+ converted_word = textbin_obj.to_binary(word)
+ print(converted_word)
+
+ #Output: 1101000 1100101 1101100 1101100 1101111
+
+ # Convert binary to text
+ binary = "1101000 1100101 1101100 1101100 1101111"
+ converted_binary = textbin_obj.to_text(binary)
+ print(converted_binary) # Output: hello
+
+
+
+
+ from textbin.textbin import *
+ textbin_obj = textbin.Textbin()
+
+ # Encode a JSON object to base64
+ word = {"foo": "bar"}
+ converted_word = textbin_obj.json_to_base64(word)
+ print(converted_word) # Output: eyJmb28iOiAiYmFyIn0=
+
+ # Decode a base64 string to a JSON object
+ base64_string = "eyJmb28iOiAiYmFyIn0="
+ converted_binary = textbin_obj.base64_to_json(base64_string)
+ print(converted_binary) # Output: {'foo': 'bar'}
+
+
+