一个包装器,允许用户从 Covid Act Now 数据库中获取特定的基于州的 COVID 统计数据。
项目描述
Covid Act Now 数据库包装器
这个包是 Covid Act Now 的 COVID-19 相关信息数据库的一个非常简单的包装器。在此处查看 PyPi 项目,并在此处查看原始帖子页面。
用法很简单。使用pip install covidactnow.
使用您的 API 密钥作为参数实例化一个用户对象。您可以在此处轻松生成 API 密钥。
import covidactnow
api = covidactnow.User(api_key = 'yourapikey')
washingtonInfectionRate = api.infRate('WA')
massachussettsVaxRate = api.vaxRate('MA')
print(f"{washingtonInfectionRate = }")
print(f"{massachussettsVaxRate = }")
这将导致(当然,使用不同的数据):
washingtonInfectionRate = 1.16
massachussettsVaxRate = 76.3
要查看特定函数的文档字符串(解释器),请使用covidactnow.User.infRate.__doc__whereinfRate可以替换为任何其他函数。例如,运行print(covidactnow.User.freeBedPercentage.__doc__)将返回:Get's the percentage of free hospital beds by state.根据您的 IDE,将鼠标悬停在编辑器中的某个函数上将显示该函数的文档字符串(适用于 VS Code)。
import covidactnow
if __name__ == "__main__":
print(covidactnow.User.infRate.__doc__)
print(covidactnow.User.freeBedPercentage.__doc__)
""" Result:
>>> Gets today's COVID infection rate by state.
>>> Get's the percentage of free hospital beds by state.
"""
----
For more information on how the wrapper works, particularly how it was redesigned to be package-friendly, read the "Updated for Distribution" section of this [page](https://covidinfo.preritdas.com). Note that this version has been updated to get data from within a `User` class allowing individual API keys to be used (as opposed to defining a state as an object and defining statistics as object attributes).
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
covidactnow-1.1.76.tar.gz
(3.1 kB
查看哈希)
内置分布
covidactnow-1.1.76-py3-none-any.whl
(3.2 kB
查看哈希)
关
covidactnow -1.1.76.tar.gz 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | e21152c47eaf4d52fdd82c81db7f7aecf790586576623bd8a88ff7bb9547bf1c |
|
| MD5 | ebdf71d203bbcf534fd337a6e7c38917 |
|
| 布莱克2-256 | ce2089fd7d7556f6e4487f9059cd95e1e83c50c98f516d218a07b93ee479ac0f |
关
covidactnow -1.1.76-py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 159446c2b6fbcaa60fbf7f691f8e0b9ab8406940f0af4e7395bc2e5de8ae5e6e |
|
| MD5 | 88924e8b1651f27e44ceb509933efee2 |
|
| 布莱克2-256 | 3a52c6424d1bd72e2f3b07eef5d0547715bcb639dc2b6d8b22c32f9e0bbcfe09 |