Skip to content

Commit

Permalink
add end(ish)-to-end transfer feature
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-butcher committed Jun 12, 2024
1 parent 62b38b4 commit 98276fa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/transferrer/transfer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import logging
import os
import tempfile
from transferrer.download import download_shoot
from transferrer.make_zip import create_born_digital_zips
from transferrer.upload import upload


def transfer_shoot(shoot_number, accession_number):
with tempfile.TemporaryDirectory() as tmpfolder:
source_folder = os.path.join(tmpfolder, "source")
target_folder = os.path.join(tmpfolder, "target")
download_shoot(shoot_number, source_folder)
for zipfile in create_born_digital_zips(source_folder, target_folder, accession_number, shoot_number, 250):
upload(zipfile)


if __name__ == "__main__":
import sys
transfer_shoot(sys.argv[1], "2754")

0 comments on commit 98276fa

Please sign in to comment.