Skip to main content

API wrapper around the NPPES API

Project description

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

NPyI

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

Install

pip install npyi

Examples

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for npyi, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size npyi-0.1.3-py3-none-any.whl (6.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size npyi-0.1.3.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page