Implementation of a basic Productizer for random weather data using Python and FastAPI. Serves as an example of how to implement a working Productizer.
Do not use this codebase in production or with production data without careful understanding and consideration of the security and other consequences. This codebase is not suitable as-is for sensitive data.
Generic pre-requisites for development
To set up the pre-commit
hooks, run pre-commit install
in the repo. After it you can
manually run pre-commit
only for your changes or pre-commit run --all-files
for all
files.
Install dependencies:
poetry install
Then to run the application, use:
poetry run invoke dev
Make sure Docker is installed.
docker build -t example-productizer .
docker run -p 8000:8000 --rm -it example-productizer
curl -X POST -H "Content-Type: application/json" -d '{"lat":60.192059, "lon":24.945831}' http://localhost:8000/Weather/Current/Metric_v1.0
The API serves its own docs, if running as instructed above, can be found at
http://localhost:8000/docs
, and the OpenAPI 3.0 spec can be found at
http://localhost:8000/openapi.json
.
This code is released under the BSD 3-Clause license. Details in the LICENSE.md file.
Written guide for how to build a data source
You can also check out our YouTube tutorial:
Also join our IOXIO Community Slack