Metadata-Version: 2.1
Name: code-image-to-text
Version: 0.1.0
Summary: Convert code image to text
Home-page: https://github.com/khuyentran1401/code_image_to_text
License: Apache-2.0
Keywords: computer vision,code
Author: khuyentran1401
Author-email: khuyentran1476@gmail.com
Requires-Python: >=3.7.1,<4.0.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: opencv-python (>=4.5.2,<5.0.0)
Requires-Dist: pytesseract (>=0.3.7,<0.4.0)
Requires-Dist: rich (>=10.2.2,<11.0.0)
Requires-Dist: typer (>=0.3.2,<0.4.0)
Project-URL: Repository, https://github.com/khuyentran1401/code_image_to_text
Description-Content-Type: text/markdown

# 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](images/carbon.png)

Type:
```bash
python -m image_converter images/carbon.png .py
```
will convert the image to text like below and save the code to the file named `carbon.py`.

```python
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
```bash
sudo apt-get update
sudo apt-get install tesseract-ocr
sudo apt-get install libtesseract-dev
```

* Windows
Install from [here](https://github.com/UB-Mannheim/tesseract/wiki)
## Install code-image-to-text
```bash
pip install code-image-to-text
```




