This is a Python CLI tool to query the WFP Data Library API and export the data into CSV files or an MS SQL database. It performs an ETL (Extract, Transform, Load) process to fetch data from the VAM Data Library, process the data, and load it into a database and/or save it to an Excel file.
- Queries the Data Library API to get information about users, surveys, resources, and container members.
- Exports data to CSV files.
- Uploads data to an MS SQL database.
- Clone this repository.
- Get an API key from your Data Library account.
- Rename the
.env-example
file to.env
. - Add the API key and database credentials to the
.env
file. - Run
python main.py
to query the API and export data. - Use the
--csv
flag to export data to CSV files (e.g.,python main.py --csv
). - Use the
--db
flag to upload data to a database (e.g.,python main.py --db
). - The output CSV files will be saved in the
output
folder.
- Python 3.x
- Packages listed in
requirements.txt
For more details on the Data Library API endpoints, see the API documentation.
Contributions to add more API querying/exporting functionality are welcome!
This project is licensed under the Affero GPL License - see the LICENSE file for details.