Syneton Admin Consult SDK - REST API Wrapper
Project description
Admin Consult Python SDK
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
Built Distribution
File details
Details for the file adminconsult_sdk-1.0.3.tar.gz
.
File metadata
- Download URL: adminconsult_sdk-1.0.3.tar.gz
- Upload date:
- Size: 51.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4851081c56de3cf34b0be75d2caa46f56d5f32627aa18e276a50ff12e2ed3cd0 |
|
MD5 | e0dc6db5efb1770f6f8a15e8aaae75fc |
|
BLAKE2b-256 | a862032d52fd6e99ed372e6d9c6fd700a333cc9971420d50d2abed74d7ce4347 |
File details
Details for the file adminconsult_sdk-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: adminconsult_sdk-1.0.3-py3-none-any.whl
- Upload date:
- Size: 90.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bac2ffd87e04ec93e2d3a8882e035e6064434b34aedf4e5f94b26e024597c360 |
|
MD5 | 35eaedf152d69f3dd819ceb7aac64daf |
|
BLAKE2b-256 | 18f0024736e114870eb20be5f51003a59f77ad44cb0d165d1d31c0984d4edcc2 |