A service to receive price information from NAMDEVCO
The AgriMarketWatcher is an initiative within the AgriNeTT project that seeks to provide pricing information of agricultural commodities within Trinidad and Tobago to various stakeholder of the industry. The AgriNeTT project is multi-discipline team within the University of the West Indies and other stakeholder that attempt to find ways to use technology to improve the operations of farmers and policy makers within the agricultural industry of Trinidad and Tobago.
The code within this repository is python-based server application that is used to extract the price data for commodities from the NAMDEVCO's Namis System and the Trinidad and Tobago Open Data repository.
The server code provides the following features:
- Checks the NAMIS system periodically to determine changes in the prices of the commodities tracked by NAMDEVCO
- Converts the Excel dataset into a simple reusable JSON-based API
- Runs on Python 3.9
- Listed in the requirements.txt file
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
using multipack for heroku installatin https://github.com/Stibbons/heroku-buildpack-libffi
- We recommend a linux/unix environment. If using windows, the Linux Subsystem might be better than powershell or cmd
- Install Git for your platform
- Generate an SSH Key and Add you machine SSH key to your github profile. (we recommend using git over https for authenticating Git repo)
- Install pyenv to manage python enviornment
- Install poetry
- Install Visual Studio Code
- Adding the Visual Studio Code python plugin
If using a mac, we recommend installing poetry with pipx https://pypa.github.io/pipx/installation/
- Clone the Repo
- Install the Heroku CLI
- Install the Heroku Repo Plugin
heroku plugins:install heroku-repo
- Log-in to Heroku
heroku login
- Verify you can view the app from the CLI
heroku config --app agrimarketwatch
- Connect remote deployment with the URI
heroku git:remote --app agrimarketwatch
- Verify remote added succesfully (should see a
heroku
andorigin
remote listing)git remote -v
- Use pyenv to setup an environment matching python version in
runtime.txt
and is a supported runtime in Herokupyenv install 3.9.16 pyenv local 3.9.16 # Activate Python 3.9 for the current project poetry env use -- $(which python) poetry install
- Ensure to use the
pyenv local 3.9.16
before starting development in each
Run redis in the background
- First use:
docker run --name redis-dev -p 6379:6379 -d redis
- Subsequent use:
docker container start redis-dev