pyPreservica
Python language binding for the Preservica API
This library provides a Python class for working with the Preservica Rest API
https://developers.preservica.com/api-reference
Wiki with example scripts https://github.com/carj/pyPreservica/wiki
Quick Start
Fetch an asset and browse its parent folder:
from pyPreservica import *
client = EntityAPI()
# Fetch an asset by its UUID
asset = client.asset("dc949259-2c1d-4658-8eee-c17b27a8823d")
print(asset.title) # LC-USZ62-20901
print(asset.security_tag) # open
# List all children of a folder
folder = client.folder(asset.parent)
for child in client.children(folder.reference):
print(child.title, child.entity_type)
Upload a file as a new asset into an existing folder:
from pyPreservica import *
upload = UploadAPI()
folder_ref = "ae108c8f-b058-4228-b099-6049175d2f0c"
package = simple_asset_package(preservation_file="picture.tiff", parent_folder=folder_ref)
upload.upload_zip_package(package)
Search the repository:
from pyPreservica import *
content = ContentAPI()
for hit in content.simple_search_list("London"):
print(hit)
Credentials can also be passed as constructor arguments or stored in a credentials.properties file.
See the full documentation for all authentication options.
Documentation
The full documentation is available at: https://pypreservica.readthedocs.io/
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/carj/pyPreservica
For announcements about new versions and discussion of pyPreservica please subscribe to the google groups forum https://groups.google.com/g/pypreservica
License
The package is available as open source under the terms of the Apache License 2.0
Installation
pyPreservica is available from the Python Package Index (PyPI)
https://pypi.org/project/pyPreservica/
To install pyPreservica, simply run this simple command in your terminal of choice:
$ pip install pyPreservica
Metadata
Release files for pyPreservica 4.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pypreservica-4.0.4.tar.gz | 116.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pypreservica-4.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 224.7 kB
Release files / pypreservica-4.0.4.tar.gz
| Download URL | pypreservica-4.0.4.tar.gz |
|---|---|
| Size | 116.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d592ce6081c51b9d6a50d7e9c2cc93432972b1db93fec7f29b08a0d2adb5433
|
|
BLAKE2b-256 checksum How to use checksums |
aa30b4e636aeb181946a870756365e2e17b239e5f26821aef388ae0c4b1cabd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Release files / pypreservica-4.0.4-py3-none-any.whl
| Download URL | pypreservica-4.0.4-py3-none-any.whl |
|---|---|
| Size | 108.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ae60e41488cda9f34c77e84fe8782ba30b5ea972f41829b456feac428c21588
|
|
BLAKE2b-256 checksum How to use checksums |
f2dc5d49d860b7f1ff846b5d55df68a903a5f57222f7b2ffa40d6d3f408094ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|