lockdowndates
Retrieve the dates of the restrictions in countries imposed by governments around the world during the covid-19 pandemic.
Requirements
python version 3.8
Install
pip install lockdowndates
conda install -c seanyboi lockdowndates
How to use
Import
from lockdowndates.core import LockdownDates
Restrictions
Below are the restrictions you can add to the LockdownDates() restrictions parameter and their meanings. You must specifiy a restriction when initiating your class and can do so with a list: ["stay_at_home",...] or tuple: ("masks",...)
stay_at_home:
- NaN - No data available for that date.
- 1.0 - recommend not leaving house.
- 2.0 - require not leaving house with exceptions for daily exercise, grocery shopping, and 'essential' trips.
- 3.0 - require not leaving house with minimal exceptions (eg allowed to leave once a week, or only one person can leave at a time, etc.
masks:
- 0.0 - No policy.
- 1.0 - Recommended.
- 2.0 - Required in some specified shared/public spaces outside the home with other people present, or some situations when social distancing not possible.
- 3.0 - Required in all shared/public spaces outside the home with other people present or all situations when social distancing not possible.
- 4.0 - Required outside the home at all times regardless of location or presence of other people.
Single Country
ld = LockdownDates("Aruba", "2022-01-01", "2022-01-08", ("stay_at_home", "masks"))
lockdown_dates = ld.dates()
lockdown_dates
Fetching lockdown dates...
Fetched lockdown dates for: Aruba
| aruba_country_code | aruba_masks | aruba_stay_at_home | |
|---|---|---|---|
| timestamp | |||
| 2022-01-01 | ABW | 2.0 | 2.0 |
| 2022-01-02 | ABW | 2.0 | 2.0 |
| 2022-01-03 | ABW | 2.0 | 2.0 |
| 2022-01-04 | ABW | 2.0 | 2.0 |
| 2022-01-05 | ABW | 2.0 | 2.0 |
| 2022-01-06 | ABW | 2.0 | 2.0 |
| 2022-01-07 | ABW | 2.0 | 2.0 |
| 2022-01-08 | ABW | 2.0 | 2.0 |
Multiple Countries
ld2 = LockdownDates(["Canada", "Denmark"], "2022-01-01", "2022-01-08", ("stay_at_home", "masks"))
lockdown_dates = ld2.dates()
lockdown_dates
Fetching lockdown dates...
Fetched lockdown dates for: Canada, Denmark
| canada_country_code | denmark_country_code | canada_masks | denmark_masks | canada_stay_at_home | denmark_stay_at_home | |
|---|---|---|---|---|---|---|
| timestamp | ||||||
| 2022-01-01 | CAN | DNK | 3.0 | 2.0 | 1.0 | 0.0 |
| 2022-01-02 | CAN | DNK | 3.0 | 2.0 | 1.0 | 0.0 |
| 2022-01-03 | CAN | DNK | 3.0 | 2.0 | 1.0 | 0.0 |
| 2022-01-04 | CAN | DNK | 3.0 | 2.0 | 1.0 | 0.0 |
| 2022-01-05 | CAN | DNK | 3.0 | 2.0 | 1.0 | 0.0 |
| 2022-01-06 | CAN | DNK | 3.0 | 2.0 | 1.0 | 0.0 |
| 2022-01-07 | CAN | DNK | 3.0 | 2.0 | 1.0 | 0.0 |
| 2022-01-08 | CAN | DNK | 3.0 | 2.0 | 1.0 | 0.0 |
Available Countries
| Country |
|---|
| Afghanistan |
| Albania |
| Algeria |
| Andorra |
| Angola |
| Argentina |
| Aruba |
| Australia |
| Austria |
| Azerbaijan |
| Bahamas |
| Bahrain |
| Bangladesh |
| Barbados |
| Belarus |
| Belgium |
| Belize |
| Benin |
| Bermuda |
| Bhutan |
| Bolivia |
| Bosnia and Herzegovina |
| Botswana |
| Brazil |
| Brunei |
| Bulgaria |
| Burkina Faso |
| Burundi |
| Cambodia |
| Cameroon |
| Canada |
| Cape Verde |
| Central African Republic |
| Chad |
| Chile |
| China |
| Colombia |
| Comoros |
| Congo |
| Costa Rica |
| Cote d'Ivoire |
| Croatia |
| Cuba |
| Cyprus |
| Czech Republic |
| Democratic Republic of Congo |
| Denmark |
| Djibouti |
| Dominica |
| Dominican Republic |
| Ecuador |
| Egypt |
| El Salvador |
| Eritrea |
| Estonia |
| Eswatini |
| Ethiopia |
| Faeroe Islands |
| Fiji |
| Finland |
| France |
| Gabon |
| Gambia |
| Georgia |
| Germany |
| Ghana |
| Greece |
| Greenland |
| Guam |
| Guatemala |
| Guinea |
| Guyana |
| Haiti |
| Honduras |
| Hong Kong |
| Hungary |
| Iceland |
| India |
| Indonesia |
| Iran |
| Iraq |
| Ireland |
| Israel |
| Italy |
| Jamaica |
| Japan |
| Jordan |
| Kazakhstan |
| Kenya |
| Kiribati |
| Kosovo |
| Kuwait |
| Kyrgyz Republic |
| Laos |
| Latvia |
| Lebanon |
| Lesotho |
| Liberia |
| Libya |
| Liechtenstein |
| Lithuania |
| Luxembourg |
| Macao |
| Madagascar |
| Malawi |
| Malaysia |
| Mali |
| Malta |
| Mauritania |
| Mauritius |
| Mexico |
| Moldova |
| Monaco |
| Mongolia |
| Morocco |
| Mozambique |
| Myanmar |
| Namibia |
| Nepal |
| Netherlands |
| New Zealand |
| Nicaragua |
| Niger |
| Nigeria |
| Norway |
| Oman |
| Pakistan |
| Palestine |
| Panama |
| Papua New Guinea |
| Paraguay |
| Peru |
| Philippines |
| Poland |
| Portugal |
| Puerto Rico |
| Qatar |
| Romania |
| Russia |
| Rwanda |
| San Marino |
| Saudi Arabia |
| Senegal |
| Serbia |
| Seychelles |
| Sierra Leone |
| Singapore |
| Slovak Republic |
| Slovenia |
| Solomon Islands |
| Somalia |
| South Africa |
| South Korea |
| South Sudan |
| Spain |
| Sri Lanka |
| Sudan |
| Suriname |
| Sweden |
| Switzerland |
| Syria |
| Taiwan |
| Tajikistan |
| Tanzania |
| Thailand |
| Timor-Leste |
| Togo |
| Tonga |
| Trinidad and Tobago |
| Tunisia |
| Turkey |
| Turkmenistan |
| Uganda |
| Ukraine |
| United Arab Emirates |
| United Kingdom |
| United States |
| United States Virgin Islands |
| Uruguay |
| Uzbekistan |
| Vanuatu |
| Venezuela |
| Vietnam |
| Yemen |
| Zambia |
| Zimbabwe |
Roadmap
- More restrictions
Contributions
If there are any restrictions or policies you wish to be added to the package please let me know!
Issues and pull requests are always welcome.
Acknowledgements
A huge massive thanks to Oxford University for open sourcing their data that they've been collecting since the pandemic began. Without them this package wouldn't be possible so please go check them out!
Repo - https://github.com/OxCGRT/covid-policy-tracker
COVID-19 Government Response Tracker - www.bsg.ox.ac.uk/covidtracker
Metadata
Release files for lockdowndates 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lockdowndates-0.0.4.tar.gz | 14.2 kB | Without provenance | Details for lockdowndates-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lockdowndates-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for lockdowndates-0.0.4-py3-none-any.whl |
Total release size: 25.5 kB
Release files / lockdowndates-0.0.4.tar.gz
| Download URL | lockdowndates-0.0.4.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32557fc0c5ca9e9b78b954c3c7a8c3a86d54f5ce11ec43fcb445bcd029c26813
|
|
BLAKE2b-256 checksum How to use checksums |
1daadd003bf4dc28e260faca4361a5c62f2a79464191944b58e6d95842e7c7f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.13
|
Release files / lockdowndates-0.0.4-py3-none-any.whl
| Download URL | lockdowndates-0.0.4-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
011f467de2f78bf0bba020aa41a1fdd8502870853b0de47e9098bb8543de9b70
|
|
BLAKE2b-256 checksum How to use checksums |
d91ba6183333502757908c867d9a387176082a986077e89ce60f8894b47be9aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.13
|
Security for lockdowndates 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.