Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1006 Bytes

File metadata and controls

27 lines (18 loc) · 1006 Bytes

Python App Exercise

Exercise

  • Use the ApiService to fetch TODOs from an API and save them into the storage folder
    • TODOs can be accessed from this URL: https://jsonplaceholder.typicode.com/todos/
    • Each TODO should be saved on a single file in CSV format
    • The filename must contain the TODO "id" prefixed with the current date.
      • Example: 2021_04_28_123.csv

Extra points

  • Use requests library from PyPI

Run the script

  • Install required dependencies pip install -r requirements.txt

  • Run the main script python main.py

  • Some environment variables that affect the execution of the program:

    • API_ENDPOINT: Endpoint where the data will be retrieved from. Default: https://jsonplaceholder.typicode.com/todos/
    • ID_FIELD: Field in the data that will be used as ID in the saved filename. Default: id

Running tests

  • Install dev dependencies pip install -r requirements-dev.txt
  • Run pytest pytest