Skip to main content

A simple Python package to facilitate interactions with Tangier's API

Project description

88888888888    d8888888b    888 .d8888b. 888888888888888888888888b.                d88888888888b.8888888
    888       d888888888b   888d88P  Y88b  888  888       888   Y88b              d88888888   Y88b 888
    888      d88P88888888b  888888    888  888  888       888    888             d88P888888    888 888
    888     d88P 888888Y88b 888888         888  8888888   888   d88P            d88P 888888   d88P 888
    888    d88P  888888 Y88b888888  88888  888  888       8888888P"            d88P  8888888888P"  888
    888   d88P   888888  Y88888888    888  888  888       888 T88b            d88P   888888        888
    888  d8888888888888   Y8888Y88b  d88P  888  888       888  T88b          d8888888888888        888
    888 d88P     888888    Y888 "Y8888P8888888888888888888888   T88b88888888d88P     888888      8888888


A simple Python package to facilitate interactions with Tangier’s SOAP API.


Tangier API is a client library for using Python to interact with the Tangier’s SOAP API.

Here, we will only be discussing methods that allow the user to perform queries from the API. All of the necessary methods to Create and Update via the API are also available in this library, but they will not be covered here.

You can check the API documentation for more information on those methods.


to install the latest version, you can just run

pip install tangier-api


You will need to have an active API account for Tangier and a config file that looks like the below

username = api_user
password = api_password
schedule_endpoint =
provider_endpoint =
location_endpoint =
testing_site = TESTING-SITE-ID
testing_npi = 0000000000
log_dir =

You can store this file anywhere, but you need to make its location known to the interpreter that calls the API via the environment variable TANGIER_CONF_FILE.


Logging In

import os
os.environ['TANGIER_CONF_FILE'] = 'C:/path/to/tangier_api.conf'

from tangier_api import ProviderConnection, LocationConnection, ScheduleConnection
pconn = ProviderConnection()
lconn = LocationConnection()
sconn = ScheduleConnection()

That’s it. You have three authenticated clients, one for each of these services.

Raw API Calls

Each of the above classes, ProviderConnection, LocationConnection, ScheduleConnection, im- plement a direct connection to Tangier’s SOAP endpoints. That means you could just use raw XML if you really wanted to. For example:

from tangier_api import settings
import xmlmanip
lconn = LocationConnection()
xml = """
    <tangier version="1.0" method="location.request">
            <location action="info">

response_xml = lconn.MaintainLocations(xml)

This should make it fairly simple for you to write your own custom API calls if necessary.

Get Schedule

sconn = ScheduleConnection()

# you can do this by emp_id or site_id
response_xml = sconn.get_schedule(
# returns a list of xml strings, used in other methods
response_xml_list = sconn.get_schedules(
# list of all of the shifts between the given dates for the given site ids
scheduled_shifts = sconn.get_schedule_values_list(
    site_ids=['YOUR-SITE-ID', 'YOUR-SITE-ID-2']

Provider Maintenance

pconn = ProviderConnection()
# returns xml corresponding to providers in Tangier with Primary Key in their Database of 1 and 2
response_xml = pconn.get_provider_info(
    # do not include this variable if you want all_providers
    # you should just use this all the time
    # bug, this field shouldn't be needed to prevent fetching of all but it is
# wrapper around get_provider_info that returns a list of dicts instead of raw xml
provider_list = pconn.provider_info_values_list(
    # do not include this variable if you want all_providers
    # you should just use this all the time
    # bug, this field shouldn't be needed to prevent fetching of all but it is

Location Maintenance

lconn = LocationConnection()
response_xml = lconn.get_locations_info(
    # do not include variable if you want all sites
# no arguments means all sites in a list
location_list = lconn.location_info_values_list()

I am not going to demonstrate any of the below, but you can see them in the API documentation if necessary.


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 tangier_api, version 1.2.3.dev0
Filename, size File type Python version Upload date Hashes
Filename, size tangier_api-1.2.3.dev0.tar.gz (16.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page