s3_start_transfer/src/archivematica.py
def start_transfer(name, path, processing_config, accession_number=None):
    """
    Start an Archivematica transfer using the automated workflow

    :param name: Name of transfer
    :param key: Path of transfer, of the form b'<location_uuid>:<target_path>'

    :returns: transfer uuid
    """
    # Archivematica processing configs don't support dashes, so replace with underscores
    # See https://wiki.archivematica.org/Archivematica_API#Package
    data = {
        "name": name,
        "type": "zipfile",
        "path": base64.b64encode(path).decode(),
        "processing_config": processing_config.replace("-", "_"),
        "auto_approve": True,
    }

    if accession_number is not None:
        data["accession"] = accession_number

    response_json = am_api_post_json("/api/v2beta/package", data)
    if "error" in response_json:
        raise StartTransferException(
            "Error starting transfer: %s" % response_json["message"]
        )
    return response_json["id"]

    Start an Archivematica transfer using the automated workflow

    :param name: Name of transfer
    :param key: Path of transfer, of the form b'<location_uuid>:<target_path>'

    :returns: transfer uuid
    
Start an Archivematica transfer using the automated workflow
Start an Archivematica transfer using the automated workflow
def start_transfer(name, path, processing_config, accession_number=None):
    data = {
        "name": name,
        "type": "zipfile",
        "path": base64.b64encode(path).decode(),
        "processing_config": processing_config.replace("-", "_"),
        "auto_approve": True,
    }
    if accession_number is not None:
        data["accession"] = accession_number
    response_json = am_api_post_json("/api/v2beta/package", data)
    if "error" in response_json:
        raise StartTransferException(
            "Error starting transfer: %s" % response_json["message"]
        )
    return response_json["id"]
def start_transfer ( name , path , processing_config , accession_number = None ) : data = { "name" : name , "type" : "zipfile" , "path" : base64 . b64encode ( path ) . decode ( ) , "processing_config" : processing_config . replace ( "-" , "_" ) , "auto_approve" : True , } if accession_number is not None : data [ "accession" ] = accession_number response_json = am_api_post_json ( "/api/v2beta/package" , data ) if "error" in response_json : raise StartTransferException ( "Error starting transfer: %s" % response_json [ "message" ] ) return response_json [ "id" ]
Start an Archivematica transfer using the automated workflow
Start an Archivematica transfer using the automated workflow
"""
    Start an Archivematica transfer using the automated workflow

    :param name: Name of transfer
    :param key: Path of transfer, of the form b'<location_uuid>:<target_path>'

    :returns: transfer uuid
    """ # Archivematica processing configs don't support dashes, so replace with underscores # See https://wiki.archivematica.org/Archivematica_API#Package
None
name
Name of transfer
Name of transfer
path
processing_config
accession_number
key
Path of transfer, of the form b':'
Path of transfer of the form b ' : '