diff --git a/docs/index.html b/docs/index.html index 1db64e9..8ffd230 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,88 +1,101 @@ - + -
-

Text and Binary

-
-    
+      
+ Text and binary +
+

Text and Binary

+
+    
     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
+    print(converted_word) 
+    
+    #Output: 1101000 1100101 1101100 1101100 1101111
     
     # Convert binary to text
     binary = "1101000 1100101 1101100 1101100 1101111"
@@ -90,14 +103,12 @@
     print(converted_binary)  # Output: hello
     
 
- -
- - - -
-

JSON and Base64

-
+        
+ Text and binary end + JSON and Base64 +
+

JSON and Base64

+
     
     from textbin.textbin import *
     textbin_obj = textbin.Textbin()
@@ -113,32 +124,183 @@
     print(converted_binary)  # Output: {'foo': 'bar'}
     
 
+
+ JSON and Base64 end +
+
+ +
+

Inside textbin

+

What does it look like inside textbin?

+

+ Inside the textbin.py, there is a 'Textbin()' class which has the + methods: +

+ +
+ +

Note!! The docs is still under development. Check again soon.

+

Help us develop it faster.

+ + + --> + + + + + + + PyTextBin + + + +
+ Profile Picture +

PyTextBin-0.0.3

+

pip install PyTextBin-0.0.3

+

pip install PyTextBin-0.0.3

+
+ +
+
+

About PyTextBin

+

+ 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. +

+
+ +
+

Usage

+

Inside the textbin.py, there is a 'Textbin()' class which has the methods:

+
    +
  • to_binary: Converts text to binary representation.
  • +
  • to_text: Converts binary representation to text.
  • +
  • json_to_base64: Converts a JSON object to a base64-encoded string.
  • +
  • base64_to_json: Converts a base64-encoded string to a JSON object.
  • +
  • csv_to_json: Converts a CSV string to a JSON object.
  • +
  • json_to_csv: Converts a JSON object to a CSV string.
  • +
  • xml_to_json: Converts an XML string to a JSON object
  • +
  • json_to_xml: Converts a JSON object to an XML string
  • +
  • xml_to_csv: Converts an XML string to a CSV file.
  • +
+ + To begin, import the pytextbin module then create an object from the + Textbin() class, which you'll use to access all the methods. +
+                  
+                  # import textbin
+                  from textbin.textbin import *
+                  # create textbin_obj instance 
+                  textbin_obj = textbin.Textbin()
+                  
+              
+
+ +
+

Skills

+
    +
  • Full Stack Developement
  • +
  • Open-Source contributor
  • +
  • React JS
  • +
  • Nextjs
  • +
  • Node JS
  • +
  • React-Native
  • +
  • Django
  • +
  • Flask
  • +
  • Robotics and IOT
  • +
+
+ +
+

Interests

+
    +
  • Learning new things
  • +
  • Watching movies
  • +
  • Reading
  • +
  • Listening to music
  • +
  • Playing video games
  • +
  • Writing Code
  • - - +
+
+
+

Get in Touch

+
+
+
+ + Github +
+ +
+ + Twitter +
+ +
+ + Devpost +
+
-
+
+
+ + Discord +
+
+ + + + + LinkedIn +
-
+
-
-

Inside textbin

-

What does it look like inside textbin?

-

Inside the textbin.py, there is a 'Textbin()' class which has the methods:

-
    -
  • to_binary: Converts text to binary representation.
  • -
  • to_text: Converts binary representation to text.
  • -
  • json_to_base64: Converts a JSON object to a base64-encoded string.
  • -
  • base64_to_json: Converts a base64-encoded string to a JSON object.
  • -
  • csv_to_json: Converts a CSV string to a JSON object.
  • -
  • json_to_csv: Converts a JSON object to a CSV string.
  • -
-
+ + Website +
+ + + + +
+
-

Note!! The docs is still under development. Check again soon.

-

Help us develop it faster.

+ diff --git a/docs/style.css b/docs/style.css index 66fc86d..8553180 100644 --- a/docs/style.css +++ b/docs/style.css @@ -1,4 +1,4 @@ -*{ +/* *{ margin: 0; padding: 0; font-family: sans-serif; @@ -6,54 +6,48 @@ body{ color: aliceblue; - background-color:#272a34; + } nav,.menu, .logo{ - background-color: rgb(255, 255, 255, 0.6); - box-shadow: gray 5px 5px 10px; - border-radius: 20px; - padding: 7px; display: flex; justify-content: space-between; align-items: center; } - -.logo{ - padding: 3px; - background-color: #a56262; - color: #bac2db; - padding: 5px 5px; +.header{ + background-color:#272a34; + height: 50vh; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; } .menu .link-item a{ margin: 0 5px; text-decoration: none; } - -.about-install{ +.usage{ + + background-color: #10151b91; display: flex; - justify-content: space-around; + text-align: center; + justify-content: center; align-items: center; + flex-direction: column; + text-wrap: wrap; } -.about-textbin, -.installation, -.usage, .inside-textbin, +.instantiate, .text-bin, .json-base{ - margin: 30px; + margin: 10px; background-color: #10151b91; max-width: 400px; - padding: 5px 15px; - border: 2px solid #81ca4d; - box-shadow: #81ca4d 5px 5px 10px; - display: flex; - justify-content: center; - align-items: flex-start; - flex-direction: column; - text-wrap: wrap; - border-radius: 30px; + + border-radius: 10px; + text-align: center; } .installation{ @@ -63,7 +57,112 @@ nav,.menu, .logo{ max-width:100%; } -.code-area{ + + */ + + + + body { + flex:1; + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + margin: 0; + padding: 0; + /* border: 14px solid #333; */ +} +.section-title{ + background-color: #4d3820; + color: #fff; + padding: 1rem; + text-align: center; + transition: 1s; + +} +.section-title:hover{ + background-color: #f7b800; + color: #333; +} +header { + /* background-color: #4d3820; */ + color: #4d3820; + padding: 1rem; + text-align: center; +} +header h1 { + margin: 0; +} +header img { + + border-radius: 50%; + /* height: 10rem; */ + width: 10rem; +} +main { + padding: 1rem; +} +main section { + margin-bottom: 2rem; +} +main section h2 { + margin: 0; +} +.socials { + color: #333; + display: flex; + flex-direction: row; + justify-content: space-evenly; +} +.socials div{ display: flex; - flex-wrap: wrap; + align-items: center; + margin: 1rem; +} +.socials .left, .right{ + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} + +.socials div a{ + color: #333; + text-decoration: none; + margin-left: 1rem; +} +footer { + background-color: #4d3820; + color: #fff; + padding: 1rem; + text-align: center; +} +footer p { + margin: 0; +} +@media screen and (min-width: 768px) { + body { + display: flex; + flex-direction: column; + /* height: 100vh; */ + } + main { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + } + main section { + width: 50%; + } + main section ul { + margin-left: 2rem; + } + main section ul li { + margin-bottom: 1rem; + } + main section p { + margin-left: 2rem; + } + footer { + flex-shrink: 0; + } } \ No newline at end of file diff --git a/examples.py b/examples.py index 1b73073..1d1e7b2 100644 --- a/examples.py +++ b/examples.py @@ -21,19 +21,43 @@ textbin_obj = pytextbin.Textbin() # 1) convert text to binary +print("convert text to binary") text = 'hello world' converted = textbin_obj.to_binary(text) -print("to_binary>>", converted) +print(converted) + +print("************************************************************\n") # 2) convert json data to a base64 string +print("convert json to base64") json_data = { 'id' : 12 , 'name' : 'Collins' } converted = textbin_obj.json_to_base64(json_data) -print("json_to_base64>>", converted) +print(converted) + +print("************************************************************\n") +# 3) convert base64 data to json +print("convert to base64 to json") base64_data = 'eyJpZCI6IDEyLCAibmFtZSI6ICJDb2xsaW5zIn0=' converted = textbin_obj.base64_to_json(base64_data) -print("base64_to_json>>", converted) +print(converted) + +print("************************************************************\n") + +#convert json to csv +print("convert json to csv") +json_list = [{ 'id' : 12 , 'name' : 'Collins' }] +converted = textbin_obj.json_to_csv(json_list) +print(converted) + +print("************************************************************\n") +#convert json to xml +print("convert json to xml") +json_list = [{ 'id' : 12 , 'name' : 'Collins' }] +converted = textbin_obj.json_to_xml(json_list) +print(converted) +print("************************************************************\n") diff --git a/pytextbin/__pycache__/__init__.cpython-311.pyc b/pytextbin/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..9a960fd Binary files /dev/null and b/pytextbin/__pycache__/__init__.cpython-311.pyc differ diff --git a/pytextbin/__pycache__/pytextbin.cpython-311.pyc b/pytextbin/__pycache__/pytextbin.cpython-311.pyc new file mode 100644 index 0000000..9fd1a0c Binary files /dev/null and b/pytextbin/__pycache__/pytextbin.cpython-311.pyc differ