Skip to content

textbin is a python package that helps you convert text to binary and binary to text

License

Notifications You must be signed in to change notification settings

PB2204/textbin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

textbin

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.

Installation

You can install textbin using pip from PyPI:

pip install textbin

Alternatively, you can find the project on GitHub:

GitHub Repository

Usage

Text and Binary

from textbin.textbin import *

# Convert text to binary
word = "hello"
converted_word = textbin.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.to_text(binary)
print(converted_binary)  # Output: hello

JSON and Base64

from textbin.textbin import json_to_base64, base64_to_json

# Encode a JSON object to base64
word = {"foo": "bar"}
converted_word = json_to_base64(word)
print(converted_word)  # Output: eyJmb28iOiAiYmFyIn0=

# Decode a base64 string to a JSON object
base64_string = "eyJmb28iOiAiYmFyIn0="
converted_binary = base64_to_json(base64_string)
print(converted_binary)  # Output: {'foo': 'bar'}

Contributions

Contributions to textbin are welcome! You can find the project's GitHub repository and contribute to its development.

Contributors

Your contributions are highly appreciated! We hope that textbin proves helpful to you. Thank you for using it.

I hope it be of help to you thank you. c-o-m-o-n

About

textbin is a python package that helps you convert text to binary and binary to text

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%