nppes api的api包装器

npyi的Python项目详细描述


https://badge.fury.io/py/npyi.svghttps://travis-ci.com/andyh1203/npyi.svg?branch=masterhttps://codecov.io/gh/andyh1203/npyi/branch/master/graph/badge.svghttps://img.shields.io/badge/License-BSD%203--Clause-blue.svghttps://img.shields.io/pypi/pyversions/npyi.svgUpdates

npyi

API wrapper around the NPPES API. https://npiregistry.cms.hhs.gov/registry/help-api

安装

pip install npyi

示例

from npyi import npi

# sample search by first_name / last_name
response = npi.search(search_params={'first_name': 'Andrew', 'last_name': 'Jackson'})
print(response.keys()) # dict_keys(['result_count', 'results'])
first_entry = response['results'][0]
print(first_entry['basic']['first_name']) # ANDREW
print(first_entry['basic']['last_name']) # JACKSON

# sample search by NPI number
response = search(search_params={'number': '1417367343'})
print(response['result_count']) # 1
print(response['results'][0]['number']) # 1417367343

# sample search by city
response = search(search_params={'city': 'San Francisco'})
first_entry = response['results'][0]
print(len(first_entry['addresses'])) # 2 (different address purposes - LOCATION and MAILING)
print(first_entry['addresses'][0]['city']) # SAN FRANCISCO

# limit example
response = search(search_params={'first_name': 'Andrew', 'city': 'New York'}, limit=50)
print(response['result_count']) # 50
response = search(search_params={'first_name': 'Andrew', 'city': 'New York'}, limit=1000)
print(response['result_count']) # 200 (200 is the max)
response = search(search_params={'first_name': 'Andrew', 'city': 'New York'})
print(response['result_count']) # 10 (10 is the default)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
二进制字符串的java NumberFormatExceprion   java如何在Neo4j中查找/匹配/选择标识符名称   java哪一年的日期与原始年份相同?   java什么时候JAXB可以用于Json而不是XML?   java使用PayPal权限API进行PayPal支付   java Getting error在使用安卓 vision api扫描二维码时加载图像失败   java直接突出显示RichTextFX中的一个文本范围   java Resolve@RegisteredAuth2AuthorizedClient,其令牌在spring Security 5.2的spring server之外获得。十、   yyyymmddhhmmss的Java正则表达式   java我试图将google recaptcha与spring mvc集成,但GreCaptCharResponse总是返回false。这里有一些代码   java使用JsonPath将文本转换为json   java无法解析符号。Maven依赖项已就位,但代码为红色   java使用循环查找范围内具有不同数字的数字   java这个SwingWorker是否不重用ThreadPoolExecutor中的线程?