Skip to main content

Python library for the Preservica API

Project description

pyPreservica

Supported Versions CodeQL PyPI Downloads

Python language binding for the Preservica API

https://preservica.com/

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/

Documentation Status

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

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

pypreservica-4.0.0.tar.gz (88.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypreservica-4.0.0-py3-none-any.whl (81.5 kB view details)

Uploaded Python 3

File details

Details for the file pypreservica-4.0.0.tar.gz.

File metadata

  • Download URL: pypreservica-4.0.0.tar.gz
  • Upload date:
  • Size: 88.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for pypreservica-4.0.0.tar.gz
Algorithm Hash digest
SHA256 1a6c679a3c5d5aac9559c1ead211d849ed0a48c64c93538d3fb53c97762bbd52
MD5 5f5f05794b14d61b8b5e0135bcd67139
BLAKE2b-256 47de4e3e36465d85d664ef886bb3ffc12c6e361520ff1cf02f5b5dfa3df34dc0

See more details on using hashes here.

File details

Details for the file pypreservica-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: pypreservica-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 81.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for pypreservica-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ba2199c72323ac0a0decb5f59eab6ab077aeadffceb93b94c58e439a7ddd088
MD5 0b6c13c901b0e2ae09a2f9af91c3fe09
BLAKE2b-256 ab283dde4c09aee7a9529d0c1ad4114c359f9e70a6e0dee381c5eff861975634

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page