Package: kentik-api
Kentik API Python libraryThis is a Python client library forKentik APIs.
It is distributed askentik-apiPyPI package.Installation with pipInstall the library using pip:pip3 install kentik-apiCheck installation successful - no errors should be reported:python3 -c "import kentik_api"Run an example (optional):exportKTAPI_AUTH_EMAIL=<yourkentikapicredentialsemail>exportKTAPI_AUTH_TOKEN=<yourkentikapicredentialstoken>
python3examples/sites_example.pyGetting startedThe best way to get started coding with the SDK is to study providedexamples.Interfaces for manipulating all Kentik API resources are available under theKentikAPIobject.Every Kentik API resource is represented by a public class, and all related data types are located in the same source
file or directory as the implementation of the class:CustomApplicationCustomDimensionDeviceLabelDeviceManualMitigationPlanQueryObjectQuerySQLSavedFilterSiteSynthetic TestsTagTenantUserAdditional utilities available in theutilssub-moduleAuthentication supportget_credentials: function for retrieving authentication credentials from the environment or a profile stored on
the disk. API authentication credentials can be provided via environment variablesKTAPI_AUTH_EMAILandKTAPI_AUTH_TOKENor via named profile (specified as argument to theget_credentialsfunctions, defaulting
todefault) which is a JSON file with following format:{"email":"<email address>","api-key":"<the API key>"}Path to the profile file can be provided inKTAPI_CFG_FILE. Otherwise, it is first searched in${KTAPI_HOME}/<profile_name>and then in${HOME}/.kentik/<profile_name>.Support for caching of device dataTheDeviceCacheclass allows caching of device related data obtained from the Kentik API. It internally builds
index of devices bynameand byid. Devices are represented by theDeviceclass which
internally builds dictionary of device interfaces  (represented by theDeviceInterfaceclass) byname.Analytic supportTheanalyticspackage provides support for processing Kentik time series data using Pandas Dataframes.
ThepandasandPyYAMLmodules are required by theanalyticssub-module and are automatically installed with thekentik-api[analytics]option.
Seeanalytics readmefor more details.Available Examplesalerting_example.py- create Manual Mitigationapplications_example.py- create/update/delete Custom Applicationbulk_user_create.py- create users from YAML filedevices_example.py- create/update/get/delete/list Devicesdimensions_example.py- create/update/get/delete/list Custom Dimensions,
create/update/delete Populatorlabels_example.py- create/update/get/delete/list Device Labelsmy_kentik_portal_example.py- get/list Tenants, create/delete Tenant Userplans_example.py- list plansqueries_example.py- query for SQL/URL/data/chartsaved_filters_example.py- create/update/get/delete/list Saved Filterssites_example.py- create/update/get/delete/list Sitestags_example.py- create/update/get/delete/list Tagsusers_example.py- create/update/get/delete/list Userserror_handling_example.py- handling errors raised by the libraryanalytics_example_sql.py- use ofSQLQueryDefinition,flatness_analysismethods and theDeviceCacheanalytics_example_topx.py- use ofDataQueryDefinition,flatness_analysismethods and theDeviceCache(see alsoanalytics readme)synthetics_example.py- interact with synthetics APIcloud_export_example.py- interact with cloud export APIDevelopmentInstructions for developersOpen-source librariesThis software uses the following open-source libraries:daciteby Konrad Hałas - MIT Licenserequestsby Kenneth Reitz - Apache Software License (Apache 2.0)typing-extensionsby  Guido van Rossum, Jukka Lehtosalo, Lukasz Langa,
Michael Lee - PSFL Licensepandassupported by NumFOCUS - BSD 3-Clause Licensepyyamlby Ingy döt Net and Kirill Simonov - MIT license