{"id":18919397,"url":"https://github.com/nf1s/covid","last_synced_at":"2025-04-05T01:08:17.736Z","repository":{"id":44866470,"uuid":"246299970","full_name":"nf1s/covid","owner":"nf1s","description":"Python package to fetch information regarding the novel corona virus provided by Johns Hopkins university and worldometers.info","archived":false,"fork":false,"pushed_at":"2025-03-06T03:52:54.000Z","size":3770,"stargazers_count":42,"open_issues_count":3,"forks_count":25,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T00:09:28.985Z","etag":null,"topics":["coronavirus","covid","covid-19","covid-2019","covid-api","covid-virus","python","python36"],"latest_commit_sha":null,"homepage":"https://ahmednafies.github.io/covid/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nf1s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-10T12:51:45.000Z","updated_at":"2024-07-20T08:57:17.000Z","dependencies_parsed_at":"2024-07-20T00:40:43.982Z","dependency_job_id":"03a06597-c0bd-4f58-9333-de3e4faddeb6","html_url":"https://github.com/nf1s/covid","commit_stats":{"total_commits":232,"total_committers":4,"mean_commits":58.0,"dds":0.2068965517241379,"last_synced_commit":"8491b3ef230b9a44febf295f7c27dfd066f0c147"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nf1s%2Fcovid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nf1s%2Fcovid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nf1s%2Fcovid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nf1s%2Fcovid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nf1s","download_url":"https://codeload.github.com/nf1s/covid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271530,"owners_count":20911587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coronavirus","covid","covid-19","covid-2019","covid-api","covid-virus","python","python36"],"created_at":"2024-11-08T10:37:36.771Z","updated_at":"2025-04-05T01:08:17.719Z","avatar_url":"https://github.com/nf1s.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Covid\n\n[![CircleCI](https://circleci.com/gh/nf1s/covid.svg?style=shield)](https://circleci.com/gh/nf1s/covid) [![codecov](https://codecov.io/gh/nf1s/covid/branch/master/graph/badge.svg)](https://codecov.io/gh/nf1s/covid) ![Pypi locked Python version](https://img.shields.io/pypi/pyversions/covid) [![Downloads](https://pepy.tech/badge/covid)](https://pepy.tech/project/covid) ![GitHub](https://img.shields.io/github/license/nf1s/covid)\n\n## Description\n\nPython package to get information regarding the novel corona virus provided\nby Johns Hopkins university and worldometers.info\n\nFull Documentation can be found [here](https://nf1s.github.io/covid/)\n\n![corona.jpeg](docs/img/corona.jpeg)\n\n## Requirements\n\n    python \u003e= 3.10\n\n## How to install\n\n    pip install covid\n\n## Dependencies\n\n    pydantic\n    requests\n\n## How to use\n\n## Getting data from Worldometers.info (default)\n\n![worldometers](docs/img/worldometers.png)\n\n```python\ncovid = Covid()\n```\n\n### Get Data\n\n```python\ncovid.get_data()\n```\n\n#### Result\n\n```python\n[\n    {\n        'country': 'USA',\n        'confirmed': 311637,\n        'new_cases': 280,\n        'deaths': 8454,\n        'recovered': 14828,\n        'active': 288355,\n        'critical': 8206,\n        'new_deaths': 2,\n        'total_tests': 1656897,\n        'total_tests_per_million': Decimal('0'),\n        'total_cases_per_million': Decimal('941'),\n        'total_deaths_per_million': Decimal('26')\n    },\n    {\n        'active': 1376,\n        'confirmed': 81669,\n        'country': 'China',\n        'critical': 295,\n        'deaths': 3329,\n        'new_cases': 30,\n        'new_deaths': 3,\n        'recovered': 76964,\n        'total_cases_per_million': Decimal('57'),\n        'total_deaths_per_million': Decimal('2'),\n        'total_tests': 0,\n        'total_tests_per_million': Decimal('0')\n    }\n    ...\n]\n\n```\n\n### Get Status By Country Name\n\n```python\ncovid.get_status_by_country_name(\"italy\")\n```\n\n#### Result\n\n```python\n{\n    'active': 88274,\n    'confirmed': 124632,\n    'country': 'Italy',\n    'critical': 3994,\n    'deaths': 15362,\n    'new_cases': 0,\n    'new_deaths': 0,\n    'recovered': 20996,\n    'total_cases_per_million': Decimal('2061'),\n    'total_deaths_per_million': Decimal('254'),\n    'total_tests': 657224,\n    'total_tests_per_million': Decimal('0')\n }\n```\n\n### List Countries\n\n```python\ncountries = covid.list_countries()\n```\n\n#### Result\n\n```python\n[\n    'china',\n    'italy',\n    'usa',\n    'spain',\n    'germany',\n...\n]\n```\n\n### Get Total Active cases\n\n```python\nactive = covid.get_total_active_cases()\n```\n\n### Get Total Confirmed cases\n\n```python\nconfirmed = covid.get_total_confirmed_cases()\n```\n\n### Get Total Recovered cases\n\n```python\nrecovered = covid.get_total_recovered()\n```\n\n### Get Total Deaths\n\n```python\ndeaths = covid.get_total_deaths()\n```\n\n## CLI 2.0 (New)\n\n```bash\ncovid --help\n```\n### Get all data\n\n#### Worldometers source (default)\n\n```bash\ncovid\n```\n\nor\n\n```bash\ncovid -s worldometers\n```\n\n#### John Hopkins source (deprecated)\n\n```bash\ncovid -s john_hopkins\n```\n\n\n### List Countries\n\nThis comes in handy when you need to know the available names of countries\nwhen using `covid -s 'source' -c 'country_name'`, eg. \"The Republic of Moldova\" or just \"Moldova\"\nSo use this when you need to know the country exact name that you can use.\n\n```bash\ncovid -s worldometers --list-countries\n```\n\n### Get Status By Country Name\n\n```bash\ncovid -s worldometers -c sweden\n```\n\n### Get Total Active cases\n\n```bash\ncovid -s worldometers -o active\n```\n\n### Get Total Confirmed cases\n\n```bash\ncovid -s worldometers -o confirmed\n```\n\n### Get Total Recovered cases\n\n```bash\ncovid -s worldometers -o recovered\n```\n\n### Get Total Deaths\n\n```bash\ncovid -s worldometers -o deaths\n```\n\n## John Hopkins University API (Deprecated)\n\n![john_hopkins](docs/img/john_hopkins.png)\n\n### Get All Data\n\n```python\nfrom covid import Covid\n\ncovid = Covid()\ncovid.get_data()\n```\n\n#### Result\n\n```python\n[\n    {\n        'id': '53',\n        'country': 'China',\n        'confirmed': 81020,\n        'active': 9960,\n        'deaths': 3217,\n        'recovered': 67843,\n        'latitude': 30.5928,\n        'longitude': 114.3055,\n        'last_update': 1584097775000\n    },\n    {\n        'id': '115',\n        'country': 'Italy',\n        'confirmed': 24747,\n        'active': 20603,\n        'deaths': 1809,\n        'recovered': 2335,\n        'latitude': 41.8719,\n        'longitude': 12.5674,\n        'last_update': 1584318130000\n    },\n    ...\n]\n```\n\n### List Countries\n\nThis comes in handy when you need to know the available names of countries\nwhen using `get_status_by_country_name`, eg. \"The Republic of Moldova\" or just \"Moldova\"\nSo use this when you need to know the country exact name that you can use.\n\n```python\ncountries = covid.list_countries()\n```\n\n#### Result\n\n```python\n[\n    {'id': '53', 'country': 'China'},\n    {'id': '115', 'country': 'Italy'}\n    ...\n]\n```\n\n### Get Status By Country ID\n\n```python\nitaly_cases = covid.get_status_by_country_id(115)\n```\n\n#### Result\n\n```python\n{\n    'id': '115',\n    'country': 'Italy',\n    'confirmed': 24747,\n    'active': 20603,\n    'deaths': 1809,\n    'recovered': 2335,\n    'latitude': 41.8719,\n    'longitude': 12.5674,\n    'last_update': 1584318130000\n}\n```\n\n### Get Status By Country Name\n\n```python\nitaly_cases = covid.get_status_by_country_name(\"italy\")\n```\n\n#### Result\n\n```python\n{\n    'id': '115',\n    'country': 'Italy',\n    'confirmed': 24747,\n    'active': 20603,\n    'deaths': 1809,\n    'recovered': 2335,\n    'latitude': 41.8719,\n    'longitude': 12.5674,\n    'last_update': 1584318130000\n}\n```\n\n### Get Total Confirmed cases\n\n```python\nconfirmed = covid.get_total_confirmed_cases()\n```\n\n### Get Total Deaths\n\n```python\ndeaths = covid.get_total_deaths()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnf1s%2Fcovid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnf1s%2Fcovid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnf1s%2Fcovid/lists"}