For implementing Anaplan Bulk API
Reason this release was yanked:
Code improvements
Project description
anaplan-api
Anaplan-API is a Python library wrapper for Anaplan Bulk API and Anaplan Authentication API.
Installation
Use the package manager pip to install Anaplan-API.
pip install anaplan_api
Usage
import anaplan_api as ap
from anaplan_api.AuthToken import AuthToken
from anaplan_api.KeystoreManager import KeystoreManager
from anaplan_api.AnaplanConnection import AnaplanConnection
# Generate Basic Auth token for API requests
auth = ap.generate_authorization('Basic', 'user', 'password')
# Generate Cert Auth token for API requests
keys = KeystoreManager('/path/to/keystore.jks', 'keystore_pass', 'key_alias', 'private_key_passphrase')
priv_key = keys.get_key()
pub_cert = keys.get_cert()
auth_req = ap.generate_authorization('Certificate', pub_cert, priv_key)
auth = AuthToken(authReq[0], authReq[1])
# Create connection object to interact with API
conn = AnaplanConnection(auth.get_auth_token(), "workspaceId", "modelId")
# Uploading a file
with open('file.csv', 'r') as file:
data = file.read()
ap.file_upload(conn, "113000000116", 5, data)
# Execute Anaplan action
# Returns a strint with task results and error dumps if any
result_arr = anaplan.execute_action(conn, "118000000007", 3)
#
for item in result_arr:
print(item)
Requirements
This library currently uses PyJKS library for handling Java Keystore files. This project does not appear to be actively developed, and there is a known error installing pycryptodomex and twofish - both dependencies for PyJKS. The core files required from this library are:
- jks.py
- rfc2898.py
- sun_crypto.py
- util.py
You can simply download, remove extraneous files, and drop the jks folder in your site-package directory to work around the error.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Project details
Release history Release notifications | RSS feed
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
Hashes for anaplan_api-0.1.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2db61d99b4b7d12f6244d478fc5315714e20e2a4fb397416943a90b930242d95 |
|
MD5 | c2490b9ed3485ebf2e6f3976134c00f2 |
|
BLAKE2b-256 | 591741e9e76afee41d5eb3c20ac4e816dde764d4bbd941122d7c3857f9c4d577 |