Note:While all of these scripts have been tested and found to be fully functional, due to the vast amount of potential use cases, Anaplan does not explicitly support custom scripts built by our customers. This article is for information only and does not suggest any future product direction. This library is a work in progress, and will be updated with new features once they have been tested.
The attached Python library serves as a wrapper for interacting with the Anaplan API. This article will explain how you can use the library automate many of the requests that are available in our Apiary, which can be found athttps://anaplan.docs.apiary.io/#.
This article assumes you have the requests and pyOpenSSL modules installed as well as the Python 3 version 3.7. Please make sure you are installing these modules with Python 3, and not for an older version of Python. For more information on these modules, please see their respective websites:
Python(If you are using a Python version older or newer than 3.7 we cannot guarantee validity of the article)
To build a dictionary of other resources, replace "files" with the desired resource: actions, exports, imports, processes.
Note: This library is currently designed to work only with flat files, later versions will include "streamed" data.
You can upload a file of any size, and define a chunk size up to 50mb. The library loops through the file, reading chunks of the specified size and uploading to the Anaplan model.
upload = anaplan.file_upload(conn, "<file ID>", <chunkSize (1-50)>, "<path to file>")
You can run any Anaplan action with this script, and define a number of times to retry the request if there's a problem. In order to execute an Anaplan action the ID is required. To execute, all that is required is the following: