Clients to retrieve, add, and modify records from archival management systems.
Project description
agentarchives
Clients to retrieve, add, and modify records from archival management systems.
Installation
Agentarchives is on PyPI!
pip install agentarchives
Or you can install it directly from git
pip install git+https://github.com/artefactual-labs/agentarchives.git
Dependency issue on MacOs
Agentarchvies depends on the mysqlclient
package which has a bug which can
possibly fail an install when using homebrew on MacOs computers. A solution
suggested on the mysqlclient site is to change mysql_config on or about line
112:
# Create options
libs="-L$pkglibdir"
libs="$libs -l "
to
# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"
See also this blog.
Usage
This library can be used to interact with Archivists Toolkit, ArchivesSpace, and Access To Memory (AtoM).
ArchivesSpace
First, you need to import the module in your Python script:
from agentarchives import archivesspace
Then, initiate a new client, passing in the URL, user name, password, port and repository for your AS instance:
client = archivesspace.ArchivesSpaceClient('http://localhost', 'admin', 'admin', 8089, 2)
Using your client, call one of the included functions (documented in client.py).
For example, the following:
resource = client.get_record('/repositories/2/resources/1')
print resource
will return:
{
"classifications": [],
"create_time": "2015-11-17T00:23:19Z",
"created_by": "admin",
"dates": [
{
"create_time": "2015-11-17T00:23:19Z",
"created_by": "admin",
"date_type": "bulk",
"expression": "maybe 1999",
"jsonmodel_type": "date",
"label": "creation",
"last_modified_by": "admin",
"lock_version": 0,
"system_mtime": "2015-11-17T00:23:19Z",
"user_mtime": "2015-11-17T00:23:19Z"
}
],
"deaccessions": [],
"extents": [
{
"create_time": "2015-11-17T00:23:19Z",
"created_by": "admin",
"extent_type": "cassettes",
"jsonmodel_type": "extent",
"last_modified_by": "admin",
"lock_version": 0,
"number": "1",
"portion": "whole",
"system_mtime": "2015-11-17T00:23:19Z",
"user_mtime": "2015-11-17T00:23:19Z"
}
],
"external_documents": [],
"external_ids": [],
"id_0": "blah",
"instances": [],
"jsonmodel_type": "resource",
"language": "aar",
"last_modified_by": "admin",
"level": "collection",
"linked_agents": [],
"linked_events": [],
"lock_version": 0,
"notes": [],
"publish": false,
"related_accessions": [],
"repository": {
"ref": "/repositories/2"
},
"restrictions": false,
"revision_statements": [],
"rights_statements": [],
"subjects": [],
"suppressed": false,
"system_mtime": "2015-11-17T00:23:19 Z",
"title": "blah",
"tree": {
"ref": "/repositories/2/resources/1/tree"
},
"uri": "/repositories/2/resources/1",
"user_mtime": "2015-11-17T00:23:19 Z"
}
Access To Memory (AtoM)
First, you need to import the module in your Python script:
from agentarchives import atom
Then, initiate a new client, passing in the URL, REST API access token, password, and port for your AtoM instance:
client = atom.AtomClient('http://localhost', '68405800c6612599', 80)
Using your client, call one of the included functions (documented in client.py).
For example, the following:
resource = client.get_record('test-fonds')
print resource
Will return:
{
"dates": [
{
"begin": "2014-01-01",
"end": "2015-01-01",
"type": "Creation"
}
],
"level_of_description": "Fonds",
"notes": [
{
"content": "Note content",
"type": "general"
}
],
"publication_status": "Draft",
"reference_code": "F2",
"title": "Test fonds"
}
Current AtoM client limitations (versus the ArchivesSpace client):
- Identifier wildcard search not supported
- Creation of multiple notes not supported
- Nested digital objects not supported
- The ability to add/list notes with no content isn't supported
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentarchives-0.10.0.tar.gz.
File metadata
- Download URL: agentarchives-0.10.0.tar.gz
- Upload date:
- Size: 69.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1584d14872ecab794bcd3459f2d4870211b57845288523156e8a6b30ae5af1b9
|
|
| MD5 |
82f7f9b1c695d4ae4d37ee34c5b31c59
|
|
| BLAKE2b-256 |
20663e2b1eafd670b02b624073b55c7f4d1af4a6f7344844a30438a2364fbe25
|
Provenance
The following attestation bundles were made for agentarchives-0.10.0.tar.gz:
Publisher:
release.yml on artefactual-labs/agentarchives
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentarchives-0.10.0.tar.gz -
Subject digest:
1584d14872ecab794bcd3459f2d4870211b57845288523156e8a6b30ae5af1b9 - Sigstore transparency entry: 159331587
- Sigstore integration time:
-
Permalink:
artefactual-labs/agentarchives@90179cef8ba22728c4e12812ac69c9e26f39cb03 -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/artefactual-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@90179cef8ba22728c4e12812ac69c9e26f39cb03 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file agentarchives-0.10.0-py3-none-any.whl.
File metadata
- Download URL: agentarchives-0.10.0-py3-none-any.whl
- Upload date:
- Size: 50.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34fca1957e788bd720461d5c4fef89e2415b33dd899500f7e1245bba5e6cd268
|
|
| MD5 |
41519de5d2ab718f2d7b28f6f633f9a3
|
|
| BLAKE2b-256 |
3c886d763c9d7af51523767c1bbdec1e27df30bce81720620ac59b950887a66a
|
Provenance
The following attestation bundles were made for agentarchives-0.10.0-py3-none-any.whl:
Publisher:
release.yml on artefactual-labs/agentarchives
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentarchives-0.10.0-py3-none-any.whl -
Subject digest:
34fca1957e788bd720461d5c4fef89e2415b33dd899500f7e1245bba5e6cd268 - Sigstore transparency entry: 159331588
- Sigstore integration time:
-
Permalink:
artefactual-labs/agentarchives@90179cef8ba22728c4e12812ac69c9e26f39cb03 -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/artefactual-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@90179cef8ba22728c4e12812ac69c9e26f39cb03 -
Trigger Event:
workflow_dispatch
-
Statement type: