Overview# This is an example of how to create AIPs using Archivematica for files in Alfresco.
Below is a demo video of the deliverable.
https://youtu.be/7WCO7JoMnWc
System Configuration# For this project, I used the following system configuration. There is no particular significance to using multiple cloud services.
Alfresco was built on Azure, referencing the following article.
Archivematica and object storage use mdx.jp, and the analysis environment uses GakuNin RDM.
Uploading Files to Object Storage# Downloading Files from Alfresco# For downloading files from Alfresco, the REST API is used.
https://docs.alfresco.com/content-services/6.0/develop/rest-api-guide/
It conforms to OpenAPI, and I referenced the following:
https://api-explorer.alfresco.com/api-explorer/
For example, by loading the Alfresco username, password, and hostname from environment variables, I was able to retrieve metadata and download content as follows:
# f i i f # c r m m r l % o p p o % a % m o o m % s r r s d d d d d t t b e e e e a A f f f f t o r s / p n e s e e n i " A " s # l # s s s s } # c e s } s } _ " A " i g " A R " u s t e e g " A " u s } r b o w s } b n q 6 b C _ " r " e o e e e e ) r n e e ) d " r " f e " r e " r e r x x e " r " r e ) e i s i e ) s u 4 s l i " g " l . a 環 l l l l B e c l l e " g " t " g t " l l y c c t " g " l l s n . t l / e / i n A s f e d 境 f f f f a d o f f b デ s s _ ノ s u f : e e _ ノ s f p a m h f 0 i s i 0 e i l : v . n _ 変 . . . . " " " s e d . ' ' . " " u バ : m d e p i n ー : n r d = . r r r p s r p s r n ー : n o = . " " o r a f . " " 0 m t m 0 n t f e v v d 数 u p t _ u p t i n e h a a _ a a g ッ e a l r f o ド o n i _ e e e t e e t e e o ド o u _ u o n y k o i _ s p _ p s p _ t _ r r e の o の s a a d s a a c t d e c u d c u ( グ s t f i d I d s c f d s s t l t l t d の d t f d r u s _ e p l d i a c o o c : _ e b r 読 t 取 e s r e e s r 認 i _ a c t e c t s 情 s a . n d e D e : t " e p p u r f u r f u e コ e p " e l t e d d e e e z t o r r o ( s o b み e 得 r s g b r s g 証 a c d e h b e h e 報 a v t a f s で _ : { b o u h t o r e . r e . r s ン _ u { b " p a i n . b e h r t t r s c s o 込 n w e u " w e の l r e p o u p o l を g ( e ( t o _ ノ i s u n r e i n n q _ n q _ n _ テ i t s u : u = t r ( w u " " e e e o e s み v = o t g : o t ヘ s e r t r g t r f 出 e d r f a r n ー d ノ e g s l a m s u d u d n ン d _ e g t a s o r g : : . l b . l e ( r _ ( r _ ッ d s ' i ( " i , 力 i b " : o ド ー l ( e , d e e r e e N e e N o ツ p l ( u _ r ( u i ( i o 6 i f A ( o o d h " s d h ダ = e : z " : z す ( c o 🔍 k p d 情 ( ド f " e o . e s b o s b o d を ( a f " r p e = o t t " l o p a 4 p , P b = v s o 環 e " o ー n = a ヘ a m る s t s e r e 報 s 情 . A = r u r s t u n t u n e 取 s t . A l a q s p e フ e u y d e y I o e . = s 境 l : s を f t ' t ッ s t e t , e { y i I を t 報 t P s t a p s g e s g e I 得 t h t P , t u r . u ( ァ n t n _ n n v o v r g t 変 f t 作 " i { a i ダ e i s r : m , n d 取 r a I r = = i o . ( . ( d す r a I h e e p t b イ ( p b d c b e C l e r e o 数 . " " 成 { a p o ー l o s ) o e t ( 得 ) r リ e s f s n e " e " _ る ) ( r リ " s s a _ i ル b u o o r l ) r i t s = の u * : s l p n の f n a : p s v ( s す : g ク q e l e s x エ x エ c : s g ク : t p t p n 保 i t 3 t d 4 b i : b d e . 設 s " e s l ' 設 . " g t s a f e る e エ u l o _ e c ラ c ラ o t e エ s o h a a 存 n _ e e o e o e n g o 定 e s l i : 定 h : e メ i a l " l ノ t ス e f a f . e ー e ー n ノ r t ス o . n . t r 完 a p n s n デ s = v e s : r e f = c : e : ッ o g u f ー _ ト s . t o j p : p : t ー ) _ ト u g s d h y 了 r a v e t バ e T ( t . " , l . a f " a " セ n e e , ド h : t h ( r s t " t " e ド : h : t e e i , _ : y t = ッ r ' e g , l f u b t ' , d B s ー a } - I o " s e 3 _ o i , i , n I o " p t . r d " _ h F グ u A n e e . s 6 i B e a t ジ l " i n D s , . a 0 s n o o t D 出 s , u ( c n " a , d a 情 e L v t { n t e 4 o a { r s r ) ) n { o t g d ) t ( n { n { ( 力 t t u o a w t a l 報 ) F ( e ( a r e n s s i , : k d } { e e a ) s " s " s パ } { _ r n m b a { t s を _ ' n s r } n / i [ c d e e / " t r t . t . t e ス / p l t e " ) a e 出 U A v e g : c j c ' d 追 a y _ a u ( s u T y R y l a a , e ( ) ) ) 力 S L ( l e { o s a a 加 t } i l r , s i p e p f l t n o , : す E F ' f t s d o { c t の a : d f l ( m e q e , f h h t u a る R _ A . _ e e n e c * a デ . : r " ) e " u " r e t s か ' P L p h l ( ' n e " : ー i { e : o : e : n e a p ど ) A F a o f c , c p タ t v s s u s o s d u f う S _ s s . r o t d e a t c u t " t " d c e t i か S T s t p e d ' i m l r o r : t E r e o r _ l W A w a d e ] c s u ) / l i x e _ / s p e O R o s e d , t ( e : a } m c q i a = a : R G r s n _ ) } p ) e e u d p s t D E d w t c = : " i o p e : i e h ' T ) o i r ) / u t s / l ) ) _ r a e N - t i t s - f , H i d l d o d " o " t d . O f } s e n e , n , r e h e S " . n e f , f e x T s e t ) a " a " a a i ' e n i : u m s m o u d s ) l c a l e e u l e t f o l t s e s t t r _ . d s - s : s p - s o p e } / a a u / ) k a ( ' p g g t p = s ) u e e _ u T s ) b " " p b r w . l : : a l u o d i t i e r e c " s h c ) d c / リ t : / o a ク r a e d l エ ( s l l e f ス e t f s ( r ト ) r r e ) e が } ) e s タ ) : s N c イ c o o ム o n / ア / e v ウ v , e ト e r し r s ま s i し i o た o n " n s } s / ) / 1 1 / / n n o o d d e e s s / / { { n n o o d d e e _ _ i i d d } } " / c o n t e n t " Uploading Files to Object Storage# Using boto3 along with the object storage ENDPOINT_URL, ACCESS_KEY, SECRET_KEY, and BUCKET_NAME, files can be uploaded (and downloaded).
i f i # c m r m l p o p % a o m o % s r r s d d d t d t e e e o M f f f o t b / d s e o n x " M A " s # l # e a s s s u " フ A " t e d " フ A " s n t b C _ " d r " e o n c e e e p " ァ r " r x o " ァ r " e v o s l i " x g " l l a 環 d c c l l l " イ g " y c w " イ g " l 3 / i n C s f o d 境 p e r f f o ル s : e n ル s f i 0 e i l : v . a _ 変 o s e . ' e a a . a を : f o s p p r l を : o f . m 4 n t i e v d d 数 i s t s s n w w b d ア i b e t r a o ダ b i s p _ t _ e r e o を n _ _ 3 3 d s s u ( ッ l j l i i a ウ j l 3 o m : _ n b r . t 取 t k k _ ' p _ _ c s プ e e f E n s d ン e e _ r d ( t o b e e 得 _ e e c , o a s k e ロ _ c . f s o x t e ( ロ c _ c t x s の s o n n u y y l i c e e l ー p t s i e b c ( s ー t p l . e 初 e s v v r i n c c t f ド a _ 3 l l j e f e ド _ a i l i l 期 e ( l = = e t e r _ , す t n _ e f e p " l す n t e o p f 化 ( o n _ s e n る h a c _ . c t ❌ f る a h n a y , b = v = o o t u s t a f m l p b t i , m t d n o e s s r _ _ m i ( e i a u _ o U e ( . _ b v o v r o . . = l k a e l s e t c n n p o s d d e l e r s g g = e c e t ( n h k a l b ( t o o 4 r ) r i . e e b e y c = _ r s t , e m a o j s r w t b : b d g t t o n _ e p ) t . t e s a e t ) n e o o e e e e t d i s o a : r u _ , d c r : l n s デ s = t n n o p d s s t ) p n e t ) o v e バ e T e v v 3 o = _ . h フ : l a : f _ : フ a = ッ r n ( ( . i a k g , ァ o m a n ァ d F グ u v " " c n c e e イ オ a e i a オ イ _ a 情 e ( M M l t c y t o ル ブ d , l m ブ ル f l 報 ) " D D i _ e = e b パ ジ _ e e ジ パ i s を M X X e u s s n j ス ェ f d , ェ ス l e 出 D _ _ n r s e v e ク i : ク e ) 力 X A S t l _ c ( c ト l f ト ( : す _ C E ( , k r " t 名 e { i 名 s る E C C e e M _ ( e l e か N E R y t D n } e l ど D S E , _ X a " _ f う P S T k _ m ) p . か O _ _ e B e a b I K K y U ) t u N E E , C : h c T Y Y K ) k _ " " E : e U ) ) T t R _ _ L N n " A a ) M m E e " , ) o b j e c t _ n a m e , f i l e _ p a t h ) However, using the latest version of boto3 at the time of writing this article caused the following error:
https://github.com/boto/boto3/issues/4401
Using boto3==1.35.99 was a workaround that avoided the error for now.
Creating and Storing AIPs with Archivematica# Referencing the following article, a transfer is started based on the specified processing_config option.
For example, this can be achieved using Archivematica’s HOST, USER, API_KEY, along with the /api/v2beta/package/ method:
i f i f i # c m r m r m l p o p o p % a o m o m o % s r r r s d d t d t . t e e o c A f f o t r o b / m s e e r a n C " A A " s # l s a # s } A } A } t " A R " u # l i e # d } # i i r r n q e s b l _ " m r " e o e p e p ) p ) r " r e " r o f n a f f e e v u e s i i " C g " l l a l i A l i i a " g t " l l c c デ t ア s t e i 6 / e n l s f o d f _ P f C C s A s u o a s o ー a ク a s p u i s m 4 0 n i i : v . a _ . k I . " " l " " l " " f r : l n p t a p r d = c t e A } d タ " " " " セ c d e A o r m t p 2 t t e e v d d h e キ h A C i h a i A C e c o a a r c r n i a i l p ) e の = n t p p ッ c a l p n n p s o _ : _ n r e o o y ー e u o e o p e u o r h c m t a c o s c f t o f i d 準 a y a r シ e t f i s o r a _ t b r . t s の a t n n s i n t n ( i a e h n e c : t " i n . C _ 備 { m p t o ョ s a . C e r r t m ( の o b e e t = 形 d h t t t _ t h t s v t s s e : { o _ v l " " p e e h c ン s [ v l e t . s 初 s o n n 式 e o e . " k . o e e e i ( ( f s s s n p e i l p a " " " e 番 i " e i = s A i e 期 e s v v = o を r r n d : e d r n l m o s s e i s A e _ a r e o a t : : : s 号 o a r e p l p p l 化 e ( s 修 s i t e y e i t f a n t t r o i P l u t b n c t h s が n c b n r o o i y f ( o o . 正 z - b s " b z - , t _ r r _ n n I f u h o t a h n t e i 指 : c o t e n a C n , b = v s g = a T u e : u a T i u ) ) t g . i s . t " = a r n n 定 e s . q s d l b o e . e t y g l g t y l c u : : y ( _ レ h d = e d i : m a c g さ s e d u e _ i v o v r g t { i p ( f " ( i p o a i p s c ス o と : e o b e n o _ れ s : e e . d e 4 e l e r e e o e " . * " o e c で d 転 転 e t o ポ s p f b n p a , s d c て i b s j o n r ) r i t n n " 環 h * ヘ n " a 転 送 送 r n ン t a " u _ a s f e o い o u t s t t b : b d e v " : 境 o * ッ " : t 送 ( の す ( , f ス } t { g u t e e d n る n g s o e o o e n ( : 変 s " ダ : i を s 名 る s i / h l ( u h 6 r _ f 場 " ( . n n s デ s = v " " 数 t ー s o 開 t 前 フ t o g a を o " i 4 _ p i 合 ] " p ( v e バ e T ( A f a の , の " e n 始 r ァ r p p 組 c l d . t a g は 転 o ) = ッ r " M " p 設 設 A l _ す ) イ , t ( i み a o " b y t " 追 = 送 s F グ u A _ A p 定 定 p f u る : ル i s / 合 t c : 6 p h : 加 デ t a 情 e M U p l : : i . u の o o t v わ i a 4 e , a ー ( l 報 ) _ S i i " " K h i ロ パ p n r 2 せ o t l e , p c タ u s を H E K c , , e e d ケ ス t a , b て n i o n r c : r e 出 O R e a y a : ー i l e b _ o c c o e " l ) 力 S " y t { { d シ o ) o t a u n a o c s , , : す T ) i e s ョ n : p a s u _ t d e s る " { o r t ン a t / e i p i e s i d h か ) + a n * s r の l ア i p 6 d a o ( s o a e ど p / " [ , U ) ク o a 4 } t n l i n t a う " i j , " n U : セ n c エ : h _ o n a d か : _ s C a I ッ a k ン { : u c g ) e " k o o m D 転 シ l a コ p " u a _ r e n n e 送 ョ ) g ー a , i t c s + y " t : タ ン : e ド t d i o = } e イ 番 / h { , o n s o " n s プ 号 処 " } n f e s , t t . 理 " _ i l . - r 設 p g f g T , デ 定 a . e y フ t h t p p ォ h e e e a ル . a n " t ト e d v ] h は n e ( : c r " " o s A s s d , M t t e _ r a ( j A , n ) s P d ) o I t a . n _ r r d = K a d e d E n " c a Y s o t " f d a ) e e ) r ( _ ) t y p e : s t r = " s t a n d a r d " , a c c e s s i o n : s t r = N o n e , p r o c e s s i n g _ c o n f i g : s t r = N o n e ) : AIP Visualization# For visualizing the created AIPs, I used the tool introduced in the following article.
Creating a Web Application# Below is an example of a Gradio app that uses the above series of processes.
i f d # d d m r e e e p o f G m m o m r o o r d " A R " t e a f i ] o ] t d e ] a . t a o " r e " r x d = n n , u , i e x , l l l w " g t " y c i = p t t s a l a g f n フ s u : e o g d u p l c m o u r r l ァ : t r s c o o r ] p # r イ r o t g u g g e r p [ w n a e o イ a n t l u u e t e ン . w s r t r r = i l " _ c d s a ル s s r i t t t エ t タ I n = . s . . " p e a f h i c d I k : : e p p u E ラ u ー n l [ T = F T A t s 2 l ( o o _ D _ n u u r o f x ー r N f フ t o e l p i [ i e l i = 9 a ) . t に i 処 t t t n u " c 時 n o " ェ e a x a l n l x f o [ 5 g a t a 基 d 理 _ _ t ✅ e : n ❌ ー r d t b a f e t r n a g s a s づ 結 = d p [ p p ( e ス f _ b e c o ( b e = 2 i s k い ( 果 i a u フ t ( , エ の a t o l e = l o s " a n g k ( て s の T r t t ァ i N ラ 作 c a x = h " a x c フ 0 g r t フ t メ a h _ イ o o ー 成 e s ( " o A b ( o ァ - = i a ァ r ッ s = p ル n n が ( k フ l I e l イ f " m s イ ) セ k = a e 発 , ァ d P l a A ル 7 n p k ル : ー C f t { a , 生 イ e を = b I I 9 e o _ を ジ l " c h t s し ル r 作 " e P D d v r i ダ フ i . l , a エ ま I = 成 ダ l ダ を - e t d ウ ァ e / i s e ラ し D " し ウ = ウ 入 4 r : ン イ n t e k : ー た " 例 た ン " ン 力 f " T ロ ル t m n _ メ : , : い ロ 実 ロ し 0 a s ー の ( p t i ッ フ ー 行 ー て c s t ド I v / . d セ { 7 ァ ド 結 ダ 、 - k r す D e { d } ー s b イ フ 果 " 対 9 C ) る r t o ジ t b ル ァ " , 応 5 l : b a w の ) r 7 の イ ) す a i o s n A ( 0 I ル る 2 e s k l I e 4 D " フ - n e _ o P ) a を ) ァ a t = i a の } 2 入 , イ 0 T d d 作 " - 力 ル f r } ( 成 4 し の 7 u " t が 0 て A 9 e a 完 b く I d ) s 了 5 だ P 0 k し - さ を f _ ま 4 い ダ 0 i し d " ウ c d た 5 ン b , 。 3 ロ 0 " - ー " o b ド ] u 7 し t 0 ま p 4 す u - 。 t a " _ 2 , d 4 i 0 r b ) 5 3 d 5 3 9 0 " ,
Summary# There are likely many areas where considerations are insufficient, but I hope this serves as a useful reference for using Archivematica via APIs.