Skip to main content

Helper library for consuming the Unmand API

Project description

Unmand Python Library


The Unmand Python library provides convenient access to the Unmand APIs from applications written in the Python language.

For more help, see our docs.


Python 3+


Install the package with:

pip install unmand

Example Usage

from unmand import Job, ExfilAPI

document_path = 'Sample.pdf'

exfil = ExfilAPI(token)
with open(document_path, 'rb') as file_data:
    job = exfil.queue(file_data)
    if job.status != "FAILED":
        if job.status == 'FINISHED':

ExfilAPI and Job

The main class is ExfilAPI. Instantiate this with your token argument. Use the optional argument test to direct your queries to the test API instead of the production API. For example:

exfil_test = ExfilAPI(token, test=True) # This aims at the test API
exfil = ExfilAPI(token) # This aims at the production API

Submit a job by attaching the binary file data from your system to the queue method of ExfilAPI. This will return an instance of the Job class.

job = exfil.queue(file_data)

At any time, you can get the status of the job:

print(job) # or

Once a job is queued, call the poll method of the ExfilAPI class to be updated when the job is finished. Use the optional argument suppress_output to stop updates printing to screen.

exfil.poll(job=job) # or
exfil.poll(job=job, suppress_output=True)

Once finished, the results of the job are saved as a dictionary under the result attribute.


Swarm Tasks

There is a SwarmAPI class so that swarm tasks can be uploaded for display in the UI. An example usage is shown below. Be careful, the token for a Swarm project will be different.

swarm = SwarmAPI(token, test=True)

start_time = datetime.utcnow()
finish_time = datetime.utcnow()
response_details = {'Some data': 1, 'Some other data': 2, "an array": [1,2,3,4]}
status = 'SUCCESS' # or 'FAILURE'

task = Task('UniqueTestId', start_time, finish_time , status, 'PROD', 'Short Response', response_details , "First Identifier", "Second Identifier", "Third Identifier")

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

unmand-1.0.1.tar.gz (17.0 kB view hashes)

Uploaded source

Built Distribution

unmand-1.0.1-py3-none-any.whl (16.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page