-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
31 lines (18 loc) · 1.09 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Welcome to my Web-Scraper for gold and silver historical data.
- fetch.py is a program to fetch the historical prices and dates of gold and silver from these 2 URLs:
https://www.investing.com/commodities/gold-historical-data
https://www.investing.com/commodities/silver-historical-data
and store them locally in a csv file.
- app.py is a Flask REST API that Create an endpoint that will accept HTTP GET with the below arguments,
and returns a json time series, mean and variance computed over the specified period.
* start_date - required (iso format like 2017-05-10)
* end_date - required (iso format like 2017-05-22)
* commodity_type - required (gold, silver)
GET request example with curl:
curl 'http://0.0.0.0:8080/commodity?start_date=2019-04-04&end_date=2019-05-03&commodity_type=gold'
To create data locally, pulled from the two URLs above:
$ python3 fetch.py
To run Flask server:
$ python3 app.py
In the case that programs do not run because of dependencies:
$ pip3 install -r requirements.txt