python package which brings a "Facade" interface for using official covid19 israeli data gov data.
Project description
covid19-il
python package which brings a "Facade" interface for using official covid19 israeli data gov's data.
Dependencies
- pandas
- numpy
- requests
How to Use
Requirements: Python must already be installed.
- Install requirements via CMD/Terminal:
pip install -r requirements.txt
- Install covid19-il package via CMD/Terminal:
pip install covid19-il
Example
Simple example of using the package's API:
from covid19_il.api_handler.api_factory.api_enum import ApiEnum
from covid19_il.api_handler.api_factory.api_factory import ApiFactory
from covid19_il.data_handler.data_handlers_factory.data_handler_factory import DataHandlerFactory
from covid19_il.data_handler.enums.resource_id import ResourceId
api_client = ApiFactory.create_api_client(ApiEnum.api_data_il)
if api_client:
data = api_client.get_data_by_resource_id(enum_resource_id=ResourceId.CITIES_POPULATION_RESOURCE_ID,
limit=1000,
include_total=True)
cities_data_handler = DataHandlerFactory.get_instance(
ResourceId.CITIES_POPULATION_RESOURCE_ID,
data)
# Printing results from a generator function
for city in cities_data_handler.top_cases_in_cities():
print(city)
Output:
('Cumulative_verified_cases', defaultdict(<class 'int'>, {'אבו סנאן': 587, 'אבו גוש': 223, "אבו ג'ווייעד (שבט)": 14}))
('Cumulated_recovered', defaultdict(<class 'int'>, {'אבו סנאן': 564, 'אבו גוש': 215, "אבו ג'ווייעד (שבט)": 14}))
('Cumulated_deaths', defaultdict(<class 'int'>, {'אבו סנאן': 14, "אבו ג'ווייעד (שבט)": 0, 'אבו גוש': 0}))
('Cumulated_number_of_tests', defaultdict(<class 'int'>, {'אבו סנאן': 7608, 'אבו גוש': 5139, "אבו ג'ווייעד (שבט)": 290}))
('Cumulated_number_of_diagnostic_tests', defaultdict(<class 'int'>, {'אבו סנאן': 7130, 'אבו גוש': 4965, "אבו ג'ווייעד (שבט)": 288}))
# TODO:
- Documentation of the package's API for ease of use using Sphinx.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
covid19_il-0.0.1.4.tar.gz
(20.1 kB
view hashes)
Built Distribution
Close
Hashes for covid19_il-0.0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 612c4de62e1c6e543920f52b6bee41802e6a945a98f13c135f943a22712a3b8e |
|
MD5 | 7d4cd16e2cc46a66d14693008fd0a4c3 |
|
BLAKE2b-256 | 5266e3f50482ebddb9b712fe825c47526f69721df0e5e410abd38e4f32c56ada |