Releases: cmu-delphi/delphi-epidata
PyPI version 0.0.12
This is an update to the PyPI package delphi-epidata
, which can be found at https://pypi.org/project/delphi-epidata/.
This version includes a minor change to the default async settings to reduce timeout errors.
It can be installed like this:
pip install delphi-epidata
Sample usage:
# import
from delphi_epidata import Epidata
from datetime import datetime, timedelta
start = datetime(2020, 9, 8)
dates = [(start + timedelta(days=i)) for i in range(60)]
params = [
{
'endpoint': 'covidcast',
'data_source': 'fb-survey',
'signals': 'smoothed_wearing_mask',
'time_type': 'day',
'geo_type': 'county',
'geo_value': '*',
'time_values': d.strftime("%Y%m%d")
} for d in dates
]
output = Epidata.async_epidata(params, batch_size=10)
Sample output:
[
(
{
"result": 1,
"epidata": [
{
"geo_value": "01000",
"signal": "smoothed_wearing_mask",
"time_value": 20200908,
"direction": null,
"issue": 20201209,
"lag": 92,
"value": 87.8745134,
"stderr": 1.7062192,
"sample_size": 366.0096
},
...],
"message": "success"
},
{
"endpoint": "covidcast",
"data_source": "fb-survey",
"signals": "smoothed_wearing_mask",
"time_type": "day",
"geo_type": "county",
"geo_value": "*",
"time_values": "20200908"
}
),
(
{
"result": 1,
"epidata": [
{
"geo_value": "01000",
"signal": "smoothed_wearing_mask",
"time_value": 20200909,
"direction": null,
"issue": 20201209,
"lag": 91,
"value": 84.1639592,
"stderr": 1.2342333,
"sample_size": 874.9399
},
...],
"message": "success"
},
{
"endpoint": "covidcast",
"data_source": "fb-survey",
"signals": "smoothed_wearing_mask",
"time_type": "day",
"geo_type": "county",
"geo_value": "*",
"time_values": "20200909"
}
),
...
]
PyPI version 0.0.11
This is an update to the PyPI package delphi-epidata
, which can be found at https://pypi.org/project/delphi-epidata/.
This version supports submitting many queries simultaneously using aiohttp.
It can be installed like this:
pip install delphi-epidata
Sample usage:
# import
from delphi_epidata import Epidata
from datetime import datetime, timedelta
start = datetime(2020, 9, 8)
dates = [(start + timedelta(days=i)) for i in range(60)]
params = [
{
'endpoint': 'covidcast',
'data_source': 'fb-survey',
'signals': 'smoothed_wearing_mask',
'time_type': 'day',
'geo_type': 'county',
'geo_value': '*',
'time_values': d.strftime("%Y%m%d")
} for d in dates
]
output = Epidata.async_epidata(params, batch_size=10)
Sample output:
[
(
{
"result": 1,
"epidata": [
{
"geo_value": "01000",
"signal": "smoothed_wearing_mask",
"time_value": 20200908,
"direction": null,
"issue": 20201209,
"lag": 92,
"value": 87.8745134,
"stderr": 1.7062192,
"sample_size": 366.0096
},
...],
"message": "success"
},
{
"endpoint": "covidcast",
"data_source": "fb-survey",
"signals": "smoothed_wearing_mask",
"time_type": "day",
"geo_type": "county",
"geo_value": "*",
"time_values": "20200908"
}
),
(
{
"result": 1,
"epidata": [
{
"geo_value": "01000",
"signal": "smoothed_wearing_mask",
"time_value": 20200909,
"direction": null,
"issue": 20201209,
"lag": 91,
"value": 84.1639592,
"stderr": 1.2342333,
"sample_size": 874.9399
},
...],
"message": "success"
},
{
"endpoint": "covidcast",
"data_source": "fb-survey",
"signals": "smoothed_wearing_mask",
"time_type": "day",
"geo_type": "county",
"geo_value": "*",
"time_values": "20200909"
}
),
...
]
PyPI version 0.0.9
This is an update to the PyPI package delphi-epidata
, which can be found at https://pypi.org/project/delphi-epidata/.
It can be installed like this:
pip install delphi-epidata
Sample usage:
# import
from delphi_epidata import Epidata
import json
# query
print(json.dumps(Epidata.covid_hosp_facility_lookup(city='scranton'), indent=2))
Sample output:
{
"result": 1,
"epidata": [
{
"hospital_pk": "390001",
"state": "PA",
"ccn": "390001",
"hospital_name": "GEISINGER-COMMUNITY MEDICAL CENTER",
"address": "1822 MULBERRY STREET",
"city": "SCRANTON",
"zip": "18510",
"hospital_subtype": "Short Term",
"fips_code": "42069",
"is_metro_micro": 1
},
{
"hospital_pk": "390119",
"state": "PA",
"ccn": "390119",
"hospital_name": "MOSES TAYLOR HOSPITAL",
"address": "700 QUINCY AVENUE",
"city": "SCRANTON",
"zip": "18510",
"hospital_subtype": "Short Term",
"fips_code": "42069",
"is_metro_micro": 1
},
{
"hospital_pk": "390237",
"state": "PA",
"ccn": "390237",
"hospital_name": "REGIONAL HOSPITAL OF SCRANTON",
"address": "746 JEFFERSON AVENUE",
"city": "SCRANTON",
"zip": "18501",
"hospital_subtype": "Short Term",
"fips_code": "42069",
"is_metro_micro": 1
}
],
"message": "success"
}
PyPI version 0.0.8
This is an update to the PyPI package delphi-epidata
, which can be found at https://pypi.org/project/delphi-epidata/.
It can be installed like this:
pip install delphi-epidata
It can be used like this:
# import
from delphi_epidata import Epidata
import json
# query
print(json.dumps(Epidata.covid_hosp("pa", 20201101), indent=2))
{
"result": 1,
"epidata": [
{
"state": "PA",
"issue": 20201118,
"date": 20201101,
"hospital_onset_covid": 39,
"hospital_onset_covid_coverage": 217,
[...]
"adult_icu_bed_covid_utilization": 0.11014884979702,
"adult_icu_bed_utilization": 0.75111812680873
}
],
"message": "success"
}
PyPI version 0.0.7
This is an update to the PyPI package delphi-epidata
, which can be found at https://pypi.org/project/delphi-epidata/.
It can be installed like this:
pip install delphi-epidata
It can be used like this:
# import
from delphi_epidata import Epidata
# query
print(Epidata.fluview('nat', 202016))
PyPI version 0.0.6
This is an update to the PyPI package delphi-epidata
, which can be found at https://pypi.org/project/delphi-epidata/.
It can be installed like this:
pip install delphi-epidata
It can be used like this:
# import
from delphi_epidata import Epidata
# query
print(Epidata.fluview('nat', 202016))
PyPI version 0.0.5
This is an update to the PyPI package delphi-epidata
, which can be found at https://pypi.org/project/delphi-epidata/.
It can be installed like this:
pip install delphi-epidata
It can be used like this:
# import
from delphi_epidata import Epidata
# query
print(Epidata.fluview('nat', 202016))
PyPI version 0.0.4
This is the first release of the PyPI package delphi-epidata
, which can be found at https://pypi.org/project/delphi-epidata/.
It can be installed like this:
pip install delphi-epidata
(or even better: pipenv install delphi-epidata
)
Then you can use it in your python code like this:
# import
from delphi_epidata import Epidata
# query
print(Epidata.fluview('nat', 201830))