API Documentation¶
Collections¶
Contains models that deal with collections.
-
class
augeias.collections.model.
Collection
(name, object_store, **kwargs)[source]¶ A collection is a set of containers that can have separate logic and configuration applied to it.
- Currently a collection allows making two chief distinctions:
Where data whilebe stored, by setting the object_store
How URI’s for the collection and it’s contents will be generated by setting a uri_generator
Stores¶
Errors¶
This module contains exceptions that can be generated by stores.
Store Interface¶
This module defines the interface every store needs to adhere to.
-
class
augeias.stores.StoreInterface.
IStore
[source]¶ This interface handles object-storage. Implementations of this interface can be made for different object-storages Currently this interface is only implemented for PairTreeFileSystemStore
-
abstract
create_container
(container_key)[source]¶ Create a new container in the data store.
- Parameters
container_key (str) – Key of the container to create.
-
abstract
create_object
(container_key, object_key, object_data)[source]¶ Save a new object in the data store
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the container could not be found.
-
abstract
delete_container
(container_key)[source]¶ Delete a container and all it’s objects in the data store.
- Parameters
container_key (str) – Key of the container to delete.
- Raises
augeias.stores.error.NotFoundException – When the container could not be found.
-
abstract
delete_object
(container_key, object_key)[source]¶ Delete an object from the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
abstract
get_container_data
(container_key, translations=None)[source]¶ Find a container and return a zip file of its contents.
- Parameters
container_key – Key of the container which must be retrieved.
translations – Dict of object IDs and file names to use for them.
- Returns
a zip file containing all files of the container.
-
abstract
get_object
(container_key, object_key)[source]¶ Retrieve an object from the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
abstract
get_object_info
(container_key, object_key)[source]¶ Retrieve object info (mimetype, size, time last modification) from the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
abstract
list_object_keys_for_container
(container_key)[source]¶ List all object keys for a container in the data store.
- Parameters
container_key (str) – Key of the container to list the objects for.
- Returns
A list of container keys.
- Return type
lst
- Raises
augeias.stores.error.NotFoundException – When the container could not be found.
-
abstract
update_object
(container_key, object_key, object_data)[source]¶ Update an object in the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
abstract
Implementations¶
This module provide a simple filesystem based store
-
class
augeias.stores.PairTreeFileSystemStore.
PairTreeFileSystemStore
(store_dir, uri_base='urn:x-vioe:')[source]¶ Provides a filesystem based store.
Will store your digital objects on disk using a PairTree.
-
create_container
(container_key)[source]¶ Create a new container in the data store.
- Parameters
container_key (str) – Key of the container to create.
-
create_object
(container_key, object_key, object_data)[source]¶ Save a new object in the data store
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the container could not be found.
-
delete_container
(container_key)[source]¶ Delete a container and all it’s objects in the data store.
- Parameters
container_key (str) – Key of the container to delete.
- Raises
augeias.stores.error.NotFoundException – When the container could not be found.
-
delete_object
(container_key, object_key)[source]¶ Delete an object from the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
get_container_data
(container_key, translations=None)[source]¶ Find a container and return a zip file of its contents.
- Parameters
container_key – Key of the container which must be retrieved.
translations – Dict of object IDs and file names to use for them.
- Returns
a zip file containing all files of the container.
-
get_object
(container_key, object_key)[source]¶ Retrieve an object from the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
get_object_info
(container_key, object_key)[source]¶ Retrieve object info (mimetype, size, time last modification) from the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
list_object_keys_for_container
(container_key)[source]¶ List all object keys for a container in the data store.
- Parameters
container_key (str) – Key of the container to list the objects for.
- Returns
A list of container keys.
- Return type
lst
- Raises
augeias.stores.error.NotFoundException – When the container could not be found.
-
update_object
(container_key, object_key, object_data)[source]¶ Update an object in the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
-
class
augeias.stores.CephStore.
CephStore
[source]¶ -
create_container
(container_key)[source]¶ Create a new container in the data store.
- Parameters
container_key (str) – Key of the container to create.
-
create_object
(container_key, object_key, object_data)[source]¶ Save a new object in the data store
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the container could not be found.
-
delete_container
(container_key)[source]¶ Delete a container and all it’s objects in the data store.
- Parameters
container_key (str) – Key of the container to delete.
- Raises
augeias.stores.error.NotFoundException – When the container could not be found.
-
delete_object
(container_key, object_key)[source]¶ Delete an object from the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
get_container_data
(container_key, translations=None)[source]¶ Find a container and return a zip file of its contents.
- Parameters
container_key – Key of the container which must be retrieved.
translations – Dict of object IDs and file names to use for them.
- Returns
a zip file containing all files of the container.
-
get_object
(container_key, object_key)[source]¶ Retrieve an object from the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
get_object_info
(container_key, object_key)[source]¶ Retrieve object info (mimetype, size, time last modification) from the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
list_object_keys_for_container
(container_key)[source]¶ List all object keys for a container in the data store.
- Parameters
container_key (str) – Key of the container to list the objects for.
- Returns
A list of container keys.
- Return type
lst
- Raises
augeias.stores.error.NotFoundException – When the container could not be found.
-
update_object
(container_key, object_key, object_data)[source]¶ Update an object in the data store.
- Parameters
- Raises
augeias.stores.error.NotFoundException – When the object or container could not be found.
-
Uri¶
This module provides utilities for working with URIS.
-
class
augeias.uri.
DefaultUriGenerator
(pattern='https://storage.onroerenderfgoed.be/')[source]¶ Generate a URI specific to storageprovider.
Used for providers that do not implement a specific
UriGenerator
.-
generate_collection_uri
(collection)[source]¶ Generate a URI for collections based on parameters passed.
- Parameters
collection – The collection.
- Return type
string
-
-
class
augeias.uri.
UriGenerator
[source]¶ An abstract class for generating URIs.
-
abstract
generate_collection_uri
(collection)[source]¶ Generate a URI for a collection based on parameters passed.
-
abstract
-
class
augeias.uri.
UriPatternGenerator
(pattern, separator='/')[source]¶ Generate a URI based on a simple pattern.
-
generate_collection_uri
(collection)[source]¶ Generate a URI for a collection based on parameters passed.
- Parameters
collection – The collection.
- Return type
string
-