Skip to main content

Syneton Admin Consult SDK - REST API Wrapper

Project description

Admin Consult Python SDK

Syneton Hermes Consult API Version

This SDK facilitates interaction with a Syneton Admin Consult client through both API endpoints and direct SQL access.

Support

For support on this Python library or questions regarding interfacing options with Admin Consult, please feel free to contact the repository owner 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.4.tar.gz (51.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adminconsult_sdk-1.0.4-py3-none-any.whl (90.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: adminconsult_sdk-1.0.4.tar.gz
  • Upload date:
  • Size: 51.9 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.4.tar.gz
Algorithm Hash digest
SHA256 bcc3052a4087be9a6f25b9b0c4ed497b32e8b12af35daa26099b381412798ae2
MD5 15af131c1fcd2b334c34b2b2bdea703b
BLAKE2b-256 8649c8f3939844014d4f1b1b6401a246452961b4ad47c5c34c167604a6e8f9a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adminconsult_sdk-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2de456835e9a2ce1416f0bf3c88e6f19417cf2b524129bca68036385830b4b28
MD5 46d391d739ebec9488f92f0195423c53
BLAKE2b-256 61a9be1d5b07c3f7bfdde51599746fd7565fb24e8c434b0caa1fdb111dede761

See more details on using hashes here.

Supported by

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