Made in python using FastApi, Openpyxl, Weasyprint
Use app.py for Flask
virtualenv venv
venv/Scripts/activate
pip install -r requirements.txt
For weasyprint setup check docs here
- Create keys.py file and put api keys in a set named API_KEYS
- Generate api keys using key_gen.py and put it in API_KEYS, like...
API_KEYS = {"something...."}
Run the api
- Dev
fastapi dev main.py
- Prod
uvicorn main:app --host 0.0.0.0 --port 80
- Converts JSON to XLSX
/json-to-xlsx/{method_id}?api_key=...
- Converts XLSX to JSON
/xlsx-to-json?api_key=....
- Converts HTML to PDF
/html-to-pdf/{method_id}?api_key=...
Test cases are written in tests.py
method_id = 1 for getting the data stream
method_id = 2 for getting the url of the file
files are saved on the disk for 60sec
- JSON to XLSX
- XLSX to JSON
- Test for JSON <-> XLSX
- HTML to PDF
- Test for HTML -> PDF
- API key auth
- Add logger