This FastAPI utility provides an API to convert binary files to text using the BinaryToText class. It supports uploading files and converting them to plain text.
- Health Check Endpoint: Check the status of the API.
- File Conversion Endpoint: Upload a file and convert it to plain text.
- URL:
/health - Method:
GET - Response: JSON object indicating the status of the API.
- URL:
/to_text - Method:
POST - Request: Upload a file using multipart/form-data.
- Response: Plain text content of the converted file.
To run the API using docker, use the following command in the root directory of the repo :
docker build -f web-apps/api/dockerfile -t api .
docker run -p 8000:8000 apiConnect to http://localhost:8000/health to see if the service is running.
You can try with example files stored in web-apps/api/test/data
Run the following command
curl -X POST "http://localhost:8000/to_text" -H "accept: text/plain" -H "Content-Type: multipart/form-data" -F "file=@test.docx"And change the file at your convenience.