swh.deposit.api.private.deposit_read module

swh.deposit.api.private.deposit_read.aggregate_tarballs(extraction_dir, archive_paths)[source]
Aggregate multiple tarballs into one and returns this new archive’s

path.

Parameters
  • extraction_dir (path) – Path to use for the tarballs computation

  • archive_paths ([str]) – Deposit’s archive paths

Returns

Tuple (directory to clean up, archive path (aggregated or not))

class swh.deposit.api.private.deposit_read.SWHDepositReadArchives[source]

Bases: swh.deposit.api.private.SWHPrivateAPIView, swh.deposit.api.common.SWHGetDepositAPI, swh.deposit.api.private.DepositReadMixin

Dedicated class to read a deposit’s raw archives content.

Only GET is supported.

ADDITIONAL_CONFIG = {'extraction_dir': ('str', '/tmp/swh-deposit/archive/')}
process_get(request, collection_name, deposit_id)[source]
Build a unique tarball from the multiple received and stream that

content to the client.

Parameters
  • request (Request) –

  • collection_name (str) – Collection owning the deposit

  • deposit_id (id) – Deposit concerned by the reading

Returns

Tuple status, stream of content, content-type

class swh.deposit.api.private.deposit_read.SWHDepositReadMetadata[source]

Bases: swh.deposit.api.private.SWHPrivateAPIView, swh.deposit.api.common.SWHGetDepositAPI, swh.deposit.api.private.DepositReadMixin

Class in charge of aggregating metadata on a deposit.

ADDITIONAL_CONFIG = {'provider': ('dict', {'provider_type': 'deposit_client', 'metadata': {}}), 'tool': ('dict', {'name': 'swh-deposit', 'version': '0.0.1', 'configuration': {'sword_version': '2'}})}
metadata_read(deposit)[source]
Read and aggregate multiple data on deposit into one unified data

dictionary.

Parameters

deposit (Deposit) – Deposit concerned by the data aggregation.

Returns

Dictionary of data representing the deposit to inject in swh.

process_get(request, collection_name, deposit_id)[source]

Routine to deal with the deposit’s get processing.

Returns

Tuple status, stream of content, content-type