Skip to main content

amclient

GitHub CI codecov

AMClient is an Archivematica API client library and Python package for making it easier to talk to Archivematica from your Python scripts. AMClient also acts as a command line application which can easily be combined with shell-scripts to perform the same functions as a Python script might.

AMClient brings together the majority of the functionality of the two primary Archivematica components:

Basic usage:

amclient.py <subcommand> [optional arguments] <positional argument(s)>

E.g.:

amclient.py close-completed-transfers \
    --am-user-name test 234deffdf89d887a7023546e6bc0031167cedf6

To see a list of all commands and how they are used, then run amclient.py without any arguments.

To understand how to use an individual subcommand, simply run: amclient.py <subcommand>, the output will describe the input parameters for that command:

E.g.:

usage: amclient extract-file [-h] [--ss-user-name USERNAME] [--ss-url URL]
                              [--directory DIR]
                              [--saveas-filename SAVEASFILENAME]
                              ss_api_key package_uuid relative_path

Calling the module from Python:

E.g.:

from amclient import AMClient

am = AMClient()
am.ss_url = "http://127.0.0.1:62081"
am.ss_user_name = "test"
am.ss_api_key = "test"
am.list_storage_locations()
# ...json is output here...

Idempotent transfer submission

Archivematica can safely replay transfer submissions when the client supplies an idempotency key. The caller must choose a stable key and reuse it with the same transfer parameters for every retry:

from amclient import AMClient

am = AMClient(
    am_url="http://127.0.0.1:62080",
    am_user_name="test",
    am_api_key="test",
    transfer_directory="/path/to/transfer",
    transfer_name="example-transfer",
    transfer_type="standard",
    processing_config="automated",
    idempotency_key="workflow-123-transfer",
)
result = am.create_package()

The option is also available to the command-line client:

amclient create-package API_KEY /path/to/transfer \
    --idempotency-key workflow-123-transfer

Archivematica accepts keys containing 1-255 visible ASCII characters without whitespace. It returns HTTP 409 while an identical request is still in progress and HTTP 422 when the key is reused with different transfer parameters. Python callers can set enhanced_errors=True to inspect these responses through the returned error object's status_code and message attributes.

Python API status

CONTRIBUTING

For information about contributing to this project please see the AMClient CONTRIBUTING.md

Metadata

Release files for amclient 1.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amclient 1.7.1
File Size Uploaded
amclient-1.7.1.tar.gz 72.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for amclient 1.7.1
File Interpreter ABI Platform
amclient-1.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 115.8 kB

Release files / amclient-1.7.1.tar.gz

Download URL amclient-1.7.1.tar.gz
Size 72.6 kB
Tags Source
SHA-256 checksum
How to use checksums
67128a01f8e6bc0ca3450a57503f63c827fea2cb168dd45cc628e6cfc4d65504
BLAKE2b-256 checksum
How to use checksums
224f297b8a7ec238a90511e23f529673533f729369d689337808611c82e367e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

Release files / amclient-1.7.1-py3-none-any.whl

Download URL amclient-1.7.1-py3-none-any.whl
Size 43.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f326c1aa6814392ae5a576117aef4d27b3236da28ea3cdfd86d4373793f42fe
BLAKE2b-256 checksum
How to use checksums
32c8d6e697f6a31e53b1b11d76c05fa889f7dfbf00e68a3b077a34deb83442b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page