Skip to main content

Syneton Admin Consult SDK - REST API Wrapper

Project description

Admin Consult Python SDK

Syneton Hermes Consult API Version

This sdk implements interaction with a Syneton Admin Consult client via the API endpoints as well as via direct SQL access.

Support

For support on this Python library or questions regarding interfacing options with Admin Consult, please contact ward.cornette@num3rix.fr.

Example usage REST API

To setup and configure the Admin Consult REST API, please consult the documentation by Syneton.

from examples.api.auth.auth import get_cred
from adminconsult.api.clientcredentials import ClientCredentials
from adminconsult.api.customer import Customer

admin_cred: ClientCredentials = get_cred()

# Get one customer
admin_customer = Customer(admin_cred)
admin_customer.get(id=9580)
print(admin_customer.name)

Example usage SQL

For use of SQL implementation, you must have SQL Anywhere driver installed: download SQL Anywhere (Sybase). Also, you need to request a DB user with read access via Syneton Support.

from examples.sql.auth.auth import get_cred
from adminconsult.sql import DbEngine

admin_cred_sql = get_cred()
admin_db = DbEngine(admin_cred_sql)

df_customers = admin_db.sql_query_df('''
                                     SELECT *
                                     FROM DBA.CUSTOMER c
                                     WHERE c.COMPANY LIKE '%A' ''')

print('{} customers'.format(df_customers.shape[0]))

Authentication methods

Use or create a subclass of the ClientCredentials class for API or SQL authentication. This object reads and writes tokens using external storage.

Use one of the pre-implemented storage methods:

  • json file
  • hvac vault

Run examples

The examples in this repo use credentials stored in a local json files. Create a .env file which contains the path to the folder with these local json files. The .env file should look like this:

credentials_dir='C:\..'

API dependant improvements

Developments which might be improved but require an extension/change of the Admin Consult API are marked with #IMPROV#

Project details


Download files

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

Source Distribution

adminconsult_sdk-1.0.1.tar.gz (51.8 kB view details)

Uploaded Source

Built Distribution

adminconsult_sdk-1.0.1-py3-none-any.whl (90.7 kB view details)

Uploaded Python 3

File details

Details for the file adminconsult_sdk-1.0.1.tar.gz.

File metadata

  • Download URL: adminconsult_sdk-1.0.1.tar.gz
  • Upload date:
  • Size: 51.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.7

File hashes

Hashes for adminconsult_sdk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d0b120573576d2f0f7c9ee4ad67b86b428c878957da5f357dbd40059a1baba65
MD5 50bc0e37da6ea44ff9b3db580e278942
BLAKE2b-256 203a5ef1e546cc5f88e2608d045fba039ca96fad80d84803ab9c14965c4f0096

See more details on using hashes here.

File details

Details for the file adminconsult_sdk-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for adminconsult_sdk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b86b90ef7bb8ce3e4509834a2fd824a84ec6c5a15c29239c68929d4c493f8df
MD5 822e2d2bb6010fe2fb214a0ce44aca93
BLAKE2b-256 e337b3a7fcb1d4702842c680c18121078ac66147a623bf84d938c3a7a723e1b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page