You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-15Lines changed: 26 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,32 @@
1
-
# Data Library API tool
1
+
# Data Library API Tool
2
+
This is a Python tool to query the WFP Data Library API and export the data into CSV files.
2
3
3
-
This is a simple Python tool to get data from the [RAM Data Library API]((https://datalib.vam.wfp.org)) in CSV format.
4
+
## Features
5
+
Queries the Data Library API to get:
6
+
- List of users
7
+
- List of survey codes
8
+
- Complete information on all surveys (name, code, country, etc.)
9
+
- Exports the API data into CSV files
10
+
- Provides helper functions to get info on using the API
11
+
## Usage
12
+
- Clone this repo
13
+
- Get an API key from your Data Library account
14
+
- Add the API key to a .env file or pass it directly when instantiating the DataLibrary class
15
+
- Run python main.py to query the API and export CSV files
16
+
- The output CSV files will be saved in the output folder.
4
17
5
-
Currently this tools query three API endpoints:
6
-
-**```user_list```**: Get list of users registered in Data Library
7
-
-**```package_list```**: Get survey codes (YYMM_ISO3_SURVEYTYPE) for all surveys available in the platform
8
-
-***```current_package_list_with_resources```**: Complete information about surveys in Data Library, including name of survey, survey code, country and uploader
18
+
## Requirements
19
+
Python 3.x
20
+
Requests library
21
+
Pandas library
22
+
Python Dotenv library
9
23
10
-
For more information on the RAM Data Library API, consult the [documentation](https://docs.ckan.org/en/2.9/api/)
24
+
## Documentation
25
+
For more details on the Data Library API endpoints, see the API documentation.
11
26
12
-
## How to use it
27
+
## Contributing
28
+
Contributions to add more API querying/exporting functionality are welcome!
13
29
14
-
1. Make sure you have Python installed on your machine.
15
-
2. Get an API key from your [Data Library](https://datalib.vam.wfp.org) account
16
-
3. Add your API key to the api_key.py file. Do not forget to add this file to the .gitignore!
17
-
4. Run main.py
30
+
## License
31
+
This project is licensed under the MIT License - see the LICENSE file for details.
18
32
19
-
>> **Quick tip**
20
-
>>
21
-
>> If you're stuck, use the help() function in the DataLibraryData class for information about
0 commit comments