opex-manifest-generator 1.1.12__py3-none-any.whl → 1.1.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,102 +1,102 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
-
3
- <ead:ead xmlns:ead="urn:isbn:1-931666-22-9" xmlns="urn:isbn:1-931666-22-9"
4
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:isbn:1-931666-22-9 http://www.loc.gov/ead/ead.xsd">
5
-
6
- <eadheader>
7
- <eadid></eadid>
8
- <filedesc>
9
- <titlestmt>
10
- <titleproper></titleproper>
11
- </titlestmt>
12
- </filedesc>
13
- <profiledesc>
14
- <creation>
15
- <date></date>
16
- </creation>
17
- <descrules></descrules>
18
- </profiledesc>
19
- </eadheader>
20
-
21
- <archdesc level="series">
22
- <did>
23
- <unittitle></unittitle>
24
- <unitdate label="Accumulation"></unitdate>
25
- <unitdate label="Created"></unitdate>
26
- <origination label="Creator"></origination>
27
- <physdesc></physdesc>
28
- <langmaterial></langmaterial>
29
- </did>
30
-
31
- <bioghist>
32
- <head>Biography or History</head>
33
- <p></p>
34
- </bioghist>
35
- <custodhist>
36
- <head>Custodial history</head>
37
- <p></p>
38
- </custodhist>
39
- <acqinfo>
40
- <head>Acquisition Information</head>
41
- <p></p>
42
- </acqinfo>
43
- <scopecontent>
44
- <head>Scope and content</head>
45
- <p></p>
46
- </scopecontent>
47
- <appraisal>
48
- <head>Appraisal Information</head>
49
- <p></p>
50
- </appraisal>
51
- <accruals>
52
- <head>Accruals</head>
53
- <p></p>
54
- </accruals>
55
- <arrangement>
56
- <head>Arrangement</head>
57
- <p></p>
58
- </arrangement>
59
- <accessrestrict>
60
- <head>Conditions governing access</head>
61
- <p></p>
62
- </accessrestrict>
63
- <userestrict>
64
- <head>Conditions Governing Use</head>
65
- <p></p>
66
- </userestrict>
67
- <phystech>
68
- <head>Physical Characteristics and Technical Requirements</head>
69
- <p></p>
70
- </phystech>
71
- <otherfindaid>
72
- <head>Other Finding Aid</head>
73
- <p></p>
74
- </otherfindaid>
75
- <originalsloc>
76
- <head>Location of Originals</head>
77
- <p></p>
78
- </originalsloc>
79
- <altformavail>
80
- <head>Alternative Form Available</head>
81
- <p></p>
82
- </altformavail>
83
- <relatedmaterial>
84
- <head>Related Material</head>
85
- <p></p>
86
- </relatedmaterial>
87
- <bibliography>
88
- <head>Bibliography</head>
89
- <p></p>
90
- </bibliography>
91
- <odd>
92
- <head>Other Descriptive Data</head>
93
- <note>
94
- <p></p>
95
- </note>
96
- </odd>
97
- <processinfo>
98
- <head>Processing Information</head>
99
- <p></p>
100
- </processinfo>
101
- </archdesc>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+
3
+ <ead:ead xmlns:ead="urn:isbn:1-931666-22-9" xmlns="urn:isbn:1-931666-22-9"
4
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:isbn:1-931666-22-9 http://www.loc.gov/ead/ead.xsd">
5
+
6
+ <eadheader>
7
+ <eadid></eadid>
8
+ <filedesc>
9
+ <titlestmt>
10
+ <titleproper></titleproper>
11
+ </titlestmt>
12
+ </filedesc>
13
+ <profiledesc>
14
+ <creation>
15
+ <date></date>
16
+ </creation>
17
+ <descrules></descrules>
18
+ </profiledesc>
19
+ </eadheader>
20
+
21
+ <archdesc level="series">
22
+ <did>
23
+ <unittitle></unittitle>
24
+ <unitdate label="Accumulation"></unitdate>
25
+ <unitdate label="Created"></unitdate>
26
+ <origination label="Creator"></origination>
27
+ <physdesc></physdesc>
28
+ <langmaterial></langmaterial>
29
+ </did>
30
+
31
+ <bioghist>
32
+ <head>Biography or History</head>
33
+ <p></p>
34
+ </bioghist>
35
+ <custodhist>
36
+ <head>Custodial history</head>
37
+ <p></p>
38
+ </custodhist>
39
+ <acqinfo>
40
+ <head>Acquisition Information</head>
41
+ <p></p>
42
+ </acqinfo>
43
+ <scopecontent>
44
+ <head>Scope and content</head>
45
+ <p></p>
46
+ </scopecontent>
47
+ <appraisal>
48
+ <head>Appraisal Information</head>
49
+ <p></p>
50
+ </appraisal>
51
+ <accruals>
52
+ <head>Accruals</head>
53
+ <p></p>
54
+ </accruals>
55
+ <arrangement>
56
+ <head>Arrangement</head>
57
+ <p></p>
58
+ </arrangement>
59
+ <accessrestrict>
60
+ <head>Conditions governing access</head>
61
+ <p></p>
62
+ </accessrestrict>
63
+ <userestrict>
64
+ <head>Conditions Governing Use</head>
65
+ <p></p>
66
+ </userestrict>
67
+ <phystech>
68
+ <head>Physical Characteristics and Technical Requirements</head>
69
+ <p></p>
70
+ </phystech>
71
+ <otherfindaid>
72
+ <head>Other Finding Aid</head>
73
+ <p></p>
74
+ </otherfindaid>
75
+ <originalsloc>
76
+ <head>Location of Originals</head>
77
+ <p></p>
78
+ </originalsloc>
79
+ <altformavail>
80
+ <head>Alternative Form Available</head>
81
+ <p></p>
82
+ </altformavail>
83
+ <relatedmaterial>
84
+ <head>Related Material</head>
85
+ <p></p>
86
+ </relatedmaterial>
87
+ <bibliography>
88
+ <head>Bibliography</head>
89
+ <p></p>
90
+ </bibliography>
91
+ <odd>
92
+ <head>Other Descriptive Data</head>
93
+ <note>
94
+ <p></p>
95
+ </note>
96
+ </odd>
97
+ <processinfo>
98
+ <head>Processing Information</head>
99
+ <p></p>
100
+ </processinfo>
101
+ </archdesc>
102
102
  </ead:ead>
@@ -1,9 +1,9 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <gdpr xmlns="http://www.preservica.com/gdpr/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3
- <!-- The dates in this fragment should be ISO-8601 timestamps e.g. 2030-01-01T09:00:00Z -->
4
- <personaldata></personaldata>
5
- <recordobjected></recordobjected>
6
- <recordobjecteddate></recordobjecteddate>
7
- <recipientdisclosurecategory></recipientdisclosurecategory>
8
- <timelimitforerasure></timelimitforerasure>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <gdpr xmlns="http://www.preservica.com/gdpr/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3
+ <!-- The dates in this fragment should be ISO-8601 timestamps e.g. 2030-01-01T09:00:00Z -->
4
+ <personaldata></personaldata>
5
+ <recordobjected></recordobjected>
6
+ <recordobjecteddate></recordobjecteddate>
7
+ <recipientdisclosurecategory></recipientdisclosurecategory>
8
+ <timelimitforerasure></timelimitforerasure>
9
9
  </gdpr>
@@ -1,67 +1,67 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <mods xmlns="http://www.loc.gov/mods/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd" version="3.4">
3
- <recordInfo>
4
- <recordIdentifier></recordIdentifier>
5
- <recordOrigin></recordOrigin>
6
- <recordCreationDate></recordCreationDate>
7
- <descriptionStandard></descriptionStandard>
8
- </recordInfo>
9
- <titleInfo>
10
- <title></title>
11
- </titleInfo>
12
- <name>
13
- <namePart></namePart>
14
- <role>
15
- <roleTerm type="text"></roleTerm>
16
- </role>
17
- </name>
18
- <typeOfResource></typeOfResource>
19
- <originInfo>
20
- <dateCreated></dateCreated>
21
- <dateOther></dateOther>
22
- </originInfo>
23
- <language>
24
- <languageTerm></languageTerm>
25
- </language>
26
- <physicalDescription>
27
- <extent></extent>
28
- <form></form>
29
- <note type="arrangement" displayLabel="System of arrangement"></note>
30
- </physicalDescription>
31
- <note type="biographyHistory" displayLabel="Biography or History"></note>
32
- <note type="history" displayLabel="Custodial history"></note>
33
- <note type="acquisition" displayLabel="Acquisition Information"></note>
34
- <note type="appraisal" displayLabel="Appraisal Information"></note>
35
- <note type="accrual" displayLabel="Accrual Information"></note>
36
- <accessCondition type="access" displayLabel="Conditions governing access"></accessCondition>
37
- <accessCondition type="use" displayLabel="Conditions governing use"></accessCondition>
38
- <subject>
39
- <topic></topic>
40
- </subject>
41
- <relatedItem type="host" displayLabel="Other finding aids">
42
- <titleInfo>
43
- <title></title>
44
- </titleInfo>
45
- </relatedItem>
46
- <location>
47
- <physicalLocation type="original" displayLabel="Location of Originals"></physicalLocation>
48
- </location>
49
- <relatedItem type="otherVersion" displayLabel="Alternative Form Available">
50
- <titleInfo>
51
- <title></title>
52
- </titleInfo>
53
- </relatedItem>
54
- <relatedItem type="references" displayLabel="Material referenced">
55
- <titleInfo>
56
- <title></title>
57
- </titleInfo>
58
- </relatedItem>
59
- <relatedItem type="isReferencedBy" displayLabel="Referencing material">
60
- <titleInfo>
61
- <title></title>
62
- </titleInfo>
63
- </relatedItem>
64
- <note type="bibliography" displayLabel="Bibliography"></note>
65
- <note type="other" displayLabel="Other descriptive data"></note>
66
- <note type="processinfo" displayLabel="Processing Information"></note>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <mods xmlns="http://www.loc.gov/mods/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd" version="3.4">
3
+ <recordInfo>
4
+ <recordIdentifier></recordIdentifier>
5
+ <recordOrigin></recordOrigin>
6
+ <recordCreationDate></recordCreationDate>
7
+ <descriptionStandard></descriptionStandard>
8
+ </recordInfo>
9
+ <titleInfo>
10
+ <title></title>
11
+ </titleInfo>
12
+ <name>
13
+ <namePart></namePart>
14
+ <role>
15
+ <roleTerm type="text"></roleTerm>
16
+ </role>
17
+ </name>
18
+ <typeOfResource></typeOfResource>
19
+ <originInfo>
20
+ <dateCreated></dateCreated>
21
+ <dateOther></dateOther>
22
+ </originInfo>
23
+ <language>
24
+ <languageTerm></languageTerm>
25
+ </language>
26
+ <physicalDescription>
27
+ <extent></extent>
28
+ <form></form>
29
+ <note type="arrangement" displayLabel="System of arrangement"></note>
30
+ </physicalDescription>
31
+ <note type="biographyHistory" displayLabel="Biography or History"></note>
32
+ <note type="history" displayLabel="Custodial history"></note>
33
+ <note type="acquisition" displayLabel="Acquisition Information"></note>
34
+ <note type="appraisal" displayLabel="Appraisal Information"></note>
35
+ <note type="accrual" displayLabel="Accrual Information"></note>
36
+ <accessCondition type="access" displayLabel="Conditions governing access"></accessCondition>
37
+ <accessCondition type="use" displayLabel="Conditions governing use"></accessCondition>
38
+ <subject>
39
+ <topic></topic>
40
+ </subject>
41
+ <relatedItem type="host" displayLabel="Other finding aids">
42
+ <titleInfo>
43
+ <title></title>
44
+ </titleInfo>
45
+ </relatedItem>
46
+ <location>
47
+ <physicalLocation type="original" displayLabel="Location of Originals"></physicalLocation>
48
+ </location>
49
+ <relatedItem type="otherVersion" displayLabel="Alternative Form Available">
50
+ <titleInfo>
51
+ <title></title>
52
+ </titleInfo>
53
+ </relatedItem>
54
+ <relatedItem type="references" displayLabel="Material referenced">
55
+ <titleInfo>
56
+ <title></title>
57
+ </titleInfo>
58
+ </relatedItem>
59
+ <relatedItem type="isReferencedBy" displayLabel="Referencing material">
60
+ <titleInfo>
61
+ <title></title>
62
+ </titleInfo>
63
+ </relatedItem>
64
+ <note type="bibliography" displayLabel="Bibliography"></note>
65
+ <note type="other" displayLabel="Other descriptive data"></note>
66
+ <note type="processinfo" displayLabel="Processing Information"></note>
67
67
  </mods>
@@ -309,6 +309,7 @@ class OpexManifestGenerator():
309
309
  """
310
310
  Composes the data into an xml file.
311
311
  """
312
+ print(self.metadata_dir)
312
313
  for xml_file in self.xml_files:
313
314
  list_xml = xml_file.get('data')
314
315
  localname = xml_file.get('localname')
@@ -336,10 +337,10 @@ class OpexManifestGenerator():
336
337
  val = datetime.datetime.strftime(val, "%Y-%m-%dT%H:%M:%S.000Z")
337
338
  if self.metadata_flag in {'e','exact'}:
338
339
  n = path.replace(localname + ":", f"{{{ns}}}")
339
- elem = xml_new.find(f'/{n}')
340
+ elem = xml_new.find(f'./{n}')
340
341
  elif self.metadata_flag in {'f', 'flat'}:
341
342
  n = name.split(':')[-1]
342
- elem = xml_new.find(f'//{{{ns}}}{n}')
343
+ elem = xml_new.find(f'.//{{{ns}}}{n}')
343
344
  elem.text = str(val)
344
345
  except KeyError as e:
345
346
  print('Key Error: please ensure column header\'s are an exact match...')
@@ -418,10 +419,19 @@ class OpexDir(OpexManifestGenerator):
418
419
  self.folder_path = folder_path.replace(u'\\\\?\\', "")
419
420
  else:
420
421
  self.folder_path = folder_path
421
- if self.OMG.autoclass_flag not in {None, "g","generic"}:
422
- index = self.OMG.index_df_lookup(self.folder_path)
422
+ if any([self.OMG.input,
423
+ self.OMG.autoclass_flag in {"c","catalog","a","accession","b","both","cg","catalog-generic","ag","accession-generic","bg","both-generic"},
424
+ self.OMG.ignore_flag,
425
+ self.OMG.remove_flag,
426
+ self.OMG.sourceid_flag,
427
+ self.OMG.title_flag,
428
+ self.OMG.description_flag,
429
+ self.OMG.security_flag]):
430
+ index = self.OMG.index_df_lookup(self.folder_path)
431
+ elif self.OMG.autoclass_flag in {None, "g","generic"}:
432
+ index = None
423
433
  else:
424
- index = None
434
+ index = None
425
435
  if self.OMG.ignore_flag or self.OMG.remove_flag:
426
436
  if self.OMG.ignore_flag:
427
437
  self.ignore = self.OMG.ignore_df_lookup(index)
@@ -531,6 +541,8 @@ class OpexFile(OpexManifestGenerator):
531
541
  index = self.OMG.index_df_lookup(self.file_path)
532
542
  elif self.OMG.autoclass_flag is None or self.OMG.autoclass_flag in {"g","generic"}:
533
543
  index = None
544
+ else:
545
+ index = None
534
546
  if self.OMG.ignore_flag:
535
547
  self.ignore = self.OMG.ignore_df_lookup(index)
536
548
  if self.ignore:
@@ -1,13 +1,13 @@
1
- [options]
2
-
3
- INDEX_FIELD = FullName
4
- TITLE_FIELD = Title
5
- DESCRIPTION_FIELD = Description
6
- SECUIRTY_FIELD = Security
7
- IDENTIFIER_FIELD = Identifier
8
- IDENTIFIER_DEFAULT = code
9
- REMOVAL_FIELD = Removals
10
- IGNORE_FIELD = Ignore
11
- SOURCEID_FIELD = SourceID
12
- HASH_FIELD = Hash
1
+ [options]
2
+
3
+ INDEX_FIELD = FullName
4
+ TITLE_FIELD = Title
5
+ DESCRIPTION_FIELD = Description
6
+ SECUIRTY_FIELD = Security
7
+ IDENTIFIER_FIELD = Identifier
8
+ IDENTIFIER_DEFAULT = code
9
+ REMOVAL_FIELD = Removals
10
+ IGNORE_FIELD = Ignore
11
+ SOURCEID_FIELD = SourceID
12
+ HASH_FIELD = Hash
13
13
  ALGORITHM_FIELD = Algorithm