Skip to main content

Convert code image to text

Project description

Code Image to Text Converter

Convert code image into text.

For example, if you want to extract code from the image named images/carbon.png. image

Type:

python -m image_converter images/carbon.png .py

This will convert the image to text like below and save the code to the file named carbon.py.

class DataLoader:

	 def __init__(self, data_dir: str):
		 self.data_dir = data_dir

		 print("Instance is created")
	 def __call__(self):

		 print("Instance is called")

data_loader = DataLoader('my_data_dir')

data_loader()

Installation

Intall Tesseract

  • Linux
sudo apt-get update
sudo apt-get install tesseract-ocr
sudo apt-get install libtesseract-dev
  • Windows Install from here

Install code-image-to-text

pip install code-image-to-text

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code-image-to-text-0.1.4.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

code_image_to_text-0.1.4-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page