opex-manifest-generator 1.3.5__py3-none-any.whl → 1.3.7__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,557 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: opex_manifest_generator
3
- Version: 1.3.5
4
- Summary: An Opex Manifest Generator tool for use with OPEX Files, as designed by Preservica
5
- Author-email: Christopher Prince <c.pj.prince@gmail.com>
6
- License-Expression: Apache-2.0
7
- Project-URL: Homepage, https://github.com/CPJPRINCE/opex_manifest_generator
8
- Project-URL: Issues, https://github.com/CPJPRINCE/opex_manifest_generator/issues
9
- Keywords: archiving,archives,digital archiving,opex,Preservica,opex generator
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Operating System :: OS Independent
12
- Classifier: Topic :: System :: Archiving
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE.md
15
- Requires-Dist: auto_reference_generator
16
- Requires-Dist: pandas
17
- Requires-Dist: openpyxl
18
- Requires-Dist: lxml
19
- Provides-Extra: addex
20
- Requires-Dist: odfpy; extra == "addex"
21
- Provides-Extra: dev
22
- Requires-Dist: pytest>=7.0; extra == "dev"
23
- Dynamic: license-file
24
-
25
- # Opex Manifest Generator Tool
26
-
27
- [![Supported Versions](https://img.shields.io/pypi/pyversions/opex_manifest_generator.svg)](https://pypi.org/project/opex_manifest_generator)
28
- [![CodeQL](https://github.com/CPJPRINCE/opex_manifest_generator/actions/workflows/codeql.yml/badge.svg)](https://github.com/CPJPRINCE/opex_manifest_generator/actions/workflows/codeql.yml)
29
-
30
- The Opex Manifest Generator is a Python programme for generating OPEX files for use with Preservica and system's compatible with the OPEX standard. It will recursively go through a 'root' directory and generate an OPEX files for each folder or, depending on specified options, files.
31
-
32
- ## Why use this tool?
33
-
34
- This tool was primarily intended to allow users, to undertake larger uploads safely utilising bulk ingests, utilising the Opex Ingest Workflow, with Folder Manifest's checked to ensure safe transfer. However, it has been tested as functioning with:
35
- - Bulk / Opex Ingest Workflow
36
- - PUT Tool / Auto Ingest Workflows
37
- - Manual Ingest
38
- - Starter/UX2 Ingest uploads (Both File and Folder)
39
-
40
- ## Features
41
-
42
- There are a number of features including:
43
- - Generating Fixities for files, with SHA1, MD5, SHA256, SHA512 (Default is SHA1).
44
- - Generate Multiple Fixities.
45
- - Generate PAX fixities.
46
- - OPEX's can be cleared out, for repeated / ease of use.
47
- - OPEX's can be zipped with the file, for imports use with Starter/UX2/Manual ingest methods.
48
-
49
- The Program also makes use of the Auto Reference Generator, allowing for:
50
- - Reference's can be automatically generated and embedded into the Opex, with assignable prefixes.
51
- - This can be utilised either in Catalog or Accession modes, or both.
52
- - Clear and log empty folders.
53
- - Remove and log Files / Folders.
54
- - Ignore specific Files / Folders.
55
- - Sorting!
56
- - Keyword assignment!
57
-
58
- A key feature of the program, is that the Auto Ref spreadsheet can also act as an input, meaning you can utilise the generated spreadsheet to assign metadata to your files and folders. Currently this allows:
59
- - Assignment of title, description, and security status fields.
60
- - Assignment of standard and custom xml metadata templates.
61
- - These fields are all 'drop-in', so only the fields as they are required need to be added.
62
-
63
- All these features can be combined to create extensive and robust Opex files for file transfers.
64
-
65
- ## Prerequisites
66
-
67
- Python Version 3.8+ is recommended; the program is OS independent and works on Windows, MacOS and Linux.
68
-
69
- The following modules are utilised and installed with the package:
70
- - auto_reference_generator
71
- - pandas
72
- - openpyxl
73
- - lxml
74
-
75
- Please ensure that Python is also added to your System's environmental variables.
76
-
77
- ## Installation / Updates
78
-
79
- To install the package, simply run: `pip install -U opex_manifest_generator`. To update it simply run the same command.
80
-
81
- ## Usage
82
-
83
- Usage of the program is from a command line interface / terminal program, such as PowerShell on Windows, Terminal on Mac, or one of the many terminal programs on Linux.
84
-
85
- ### Folder Manifest Generation
86
-
87
- The basic version of the program will generate only folder manifests, this acts recursively, so every folder within that folder will have an Opex generated.
88
-
89
- To run open up a terminal and run the command:
90
-
91
- `opex_generate "{path/to/your/folder}"`
92
-
93
- Replacing `{path/to/your/folder}` with your folder path in quotations; for instance, on Windows this looks like:
94
-
95
- `opex_generate "C:\Users\Christopher\Downloads"`
96
-
97
- ### Fixity Generation
98
-
99
- To generate a fixity for each file within a given folder and create an opex file. this also creates a text document of Fixities. To use the `-fx` option to enable this.
100
-
101
- `opex_generate "C:\Users\Christopher\Downloads\" -fx`
102
-
103
- By default this will run with the SHA-1 algorithm. You can also utilise MD5, SHA-1, SHA-256, SHA-512 algorithms. Specify it like so:
104
-
105
- `opex_generate "C:\Users\Christopher\Downloads\" -fx SHA-256`
106
-
107
- You can also generate multiple fixities, by comma separation - Shout-out to Andrew Doty for adding this:
108
-
109
- `opex_generate "C:\Users\Christopher\Downloads\" -fx SHA-256,SHA-1`
110
-
111
- You can also enable PAX Fixity generation to generate fixity checks for individual files in PAXes. This is done, as detailed [here (see PAX section)](https://developers.preservica.com/documentation/open-preservation-exchange-opex#opex-sections):
112
-
113
- `opex_generate "C:\Users\Christopher\Downloads\" -fx SHA-256 --pax-fixity`
114
-
115
- *Side-note, you can also generate multiple fixities for PAX files*
116
-
117
- ### Continuous Generation
118
-
119
- If dealing with a large amount of files / large sized files the program is in built with the ability to continue where you left off.
120
-
121
- By default, the program won't override any previously generated OPEXes. This means you can end the program (using Ctrl + C) and rerun the same (or a different) command and not worry about losing any progress.
122
-
123
- ### Clearing Opex's
124
-
125
- Of course if you do make a mistake you or wish to start over, can utilise the clear option will remove all existing Opex's in a directory.
126
-
127
- `opex_generate "C:\Users\Christopher\Downloads\" -clr`
128
-
129
- Running this command with no additional options will end the program after clearing the Opex's; if other options are enabled it will proceed with a new generation.
130
-
131
- ### Zipping
132
-
133
- You can also utilise the zip option to bundle the opex and content into a zip file. For use with manual ingests or for Starter / UX2 users.
134
-
135
- `opex_generate "C:\Users\Christopher\Downloads\" -fx SHA-1 -z`
136
-
137
- Currently, no files will be removed after the zipping. **Be aware that because of this running this command multiple times in row can lead to lots of zips... Ensure you're at an end point before running this, as there's no easy way to undo this!**
138
-
139
- ### Removing Empty Directories
140
-
141
- You can also clear any empty directories by using the `-rme` or `--remove-empty` option. This will remove any empty directories and generate a simple text document listing the directories that were removed. This process is not reversible and you will be asked to confirm your choice.
142
-
143
- ### Filtering
144
-
145
- Currently 2 filters are applied across all generations.
146
-
147
- 1) Hidden directories / files, either by the hidden attribute in Windows or by a starting '.' in MacOS / Linux, are not included.
148
- 2) Folder's titled `meta` are not included.
149
-
150
- Hidden files and directories can be included by utilising the `--hidden` option. `meta` folders currently can not be included except by changing their name.
151
-
152
- ## Note on 'meta' folders
153
-
154
- Meta folders will be generated automatically when used with the `--fixity` and `-rme` options, as well as when some options from the Auto Reference Generator. You can redirect the path of the generated folder using the `-o` option: `-fx -o {/path/to/meta/output}`. Or you can also disable the generation of 'meta' folder using the `-dmd` option.
155
-
156
- ## Use with the Auto Reference Generator
157
-
158
- The Opex Manifest generator becomes much more powerful when utilised with another tool: the Auto Reference Generator, see [here](https://github.com/CPJPRINCE/auto_reference_generator) for further details.
159
-
160
- This is built-in to the Opex Manifest Generator and can be utilised to embed identifiers and metadata directly to an Opex or through the use of an Excel spreadsheet or CSV file.
161
-
162
- The Opex Manifest Generator makes use of the auto_reference_generator as a module, therefore it's behaviour differs a little different when compared to utilising the standalone command `auto_ref.exe`.
163
-
164
- ### Identifier Generation
165
-
166
- To generate an auto reference code, call on `-c` option with `catalog` choice. You can also assign a prefix using `-p "ARCH"`:
167
-
168
- `opex_generate -c catalog -p "ARCH" C:\Users\Christopher\Downloads`
169
-
170
- This will generate Opex's with an identifier `code` for each of the files / folders. As described in the Auto Ref module, the reference codes will take the hierarchy of the directories. You can also use the `-s` option to set a starting reference.
171
-
172
- You can alternatively utilise the "Accession" / running number mode of generating a code using `-c accession` with the prefix "2024". You can also utilise the `--accession-mode` option to determine whether to have a running number for `file, folder, both`.
173
-
174
- `opex_generate -c accession -p "2024" C:\Users\Christopher\Downloads --accession-mode file`
175
-
176
- To note: when using the `catalog` option, the key `code` is set by default, when using `accession` the default key is `accref`. *The default identifier can be set by the options.property file (accref cannot be changes)*
177
-
178
- There are also options to generate `both` (Accession and Catalog references); or generate a `generic` set of metadata which will take the XIP metadata for the Title and Description fields, from the basename of the folder/file. It will also set the Security Status to "open": `opex_generate -c generic C:\Users\Christopher\Downloads`
179
-
180
- You can also combine the generic options, like so: `catalog-generic, accession-generic, both-generic` to generate an identifier alongside generic data: `opex_generate -c catalog-generic C:\Users\Christopher\Downloads`
181
-
182
- ## Use of Input Override option.
183
-
184
- This program also supports utilising an Auto Ref spreadsheet as an 'input override', utilising the data added into said spreadsheet instead of generating them ad hoc like above.
185
-
186
- Using this method XIP Metadata fields can be set on Ingest, including:
187
-
188
- - Title
189
- - Description
190
- - Security Status
191
- - Identifiers
192
- - SourceID
193
-
194
- XML metadata template data, from both the default templates and custom templates can also be set.
195
-
196
- <details>
197
- <summary>
198
- **Click to find out more!**
199
- </summary>
200
-
201
- ### XIP metadata - Title, Description and Security Status
202
-
203
- To use an input override, we need to first create a spreadsheet with the path of. You can utilise the `auto_ref` tool installed alongside the Opex Generator, like so:
204
-
205
- `auto_ref -p "ARCH" "C:\Users\Christopher\Downloads"`
206
-
207
- In the resultant spreadsheet, add in "Title", "Description", and "Security" as new columns. The column headers are case-sensitive and have to match exactly. These fields would then be filled in with the relevant data.
208
-
209
- ![ScreenshotXIPColumns](assets/Column%20Headers.png)
210
-
211
- Once the cells are filled in with data, run a generation like so: `opex_generate -i "{/path/to/your/spreadsheet.xlsx}" "{/path/to/root/directory}"`
212
-
213
- Ensure that the root directory matches the original directory of the export. In the above case this would be: `opex_generate -i "C:\Users\Christopher\Downloads\meta\Downloads_AutoRef.xlsx" "C:\Users\Christopher\Downloads"`
214
-
215
- ### Headers Note
216
-
217
- The column headers are drop-in, drop-out, meaning you can the columns as and when you need them. You can also leave cell's blank if you don't want them to have any data in that field.
218
-
219
- To note: When assigning the `Security` field, the tag must be a match to an existing tag in your system. This is case-sensitive, so "Closed" will NOT match to a tag called "closed".
220
-
221
- ### Another Important Note
222
-
223
- If there are any changes to the hierarchy data, such as a file/folder (not including a 'meta' folder) being removed or added after the export of the spreadsheet, the data may not be assigned correctly, or it may be assigned as "ERROR", or the program may simply fail.
224
-
225
- ### XIP Metadata - Identifiers
226
-
227
- Custom Identifiers can be added by adding the columns: `"Archive_Reference", "Accession_Reference", "Identifier", or "Identifier:Keyname"`.
228
-
229
- ![Identifier Screenshot](assets/Identifiers%20Headers.png)
230
-
231
- `Archive_Reference` or `Identifier` will default to the keyname `code`; `Accession_Reference` will default to `accref`. When using the Auto Reference Generator it will always generate a column called `Archive_Reference`, but you can simply rename or remove this column as necessary.
232
-
233
- To add a custom identifier import, do so like: `Identifier:{YourIdentifierName}`, without the curly brackets IE: `Identifier:MyCode`. Multiple identifiers can be added as needed.
234
-
235
- No additional parameter's need to be set in the command line when using Identifier's, addition is enabled by default. Leaving a cell blank will not add an identifier.
236
-
237
- ### XIP Metadata - Hashes
238
-
239
- If you utilise the Auto Reference's tool for generating Hashes; when utilising the `-fx` option in combination with `-i`, if both the columns `Hash` and `Algorithm` are present, the program will read the hashes from the spreadsheet instead of generating them.
240
-
241
- ![Hash Screenshot](assets/Hash%20Headers.png)
242
-
243
- *Be aware that interruption / resuming is not currently supported with the Auto Ref Tool; also doesn't support multiple hashes*
244
-
245
- ### XML Metadata - Basic Templates
246
-
247
- DC, MODS, GPDR, and EAD templates are supported alongside installation of the package.
248
-
249
- After exporting an Auto Ref spreadsheet, you can add in additional columns to the spreadsheet and fill it out with data for an import. Like the XIP data, all fields are optional, and can added on a 'drop-in' basis.
250
-
251
- ![XML Headers](assets/XML%20Headers.png)
252
-
253
- The column header's can be added in either of two ways, what I term: `exactly` or `flatly`. (There are probably better words to describe this).
254
-
255
- An `exactly` match requires that the full path of the tag in the XML document is added to the column header. With each parent and child separated by a `/`; 'flatly' requires only the matching end tag.
256
-
257
- To give an example, from the mods template:
258
-
259
- ```
260
- Exactly:
261
- mods:recordInfo/mods:recordIdentifier
262
-
263
- Flatly:
264
- mods:recordIdentifier
265
- ```
266
-
267
- Both cases match to the field `recordIdentifier`. Note that header includes both the namespace and tag, and is also case sensitive.
268
-
269
- While using the `flatly` method is easier, be aware that if there's non-unique tags, such as `mods:note` in the Mods template. This method will only import to the first match, which might not be it's intended destination. Using the `exactly` method resolves this issue.
270
-
271
-
272
- Once you have added in your headers and the necessary data to create the OPEX's simply add the `-m` option, with the chosen method of import `flat|exact`, so:
273
- `opex_generate -i "{/path/to/your/spreadsheet.xlsx}" "{/path/to/root/directory}" -m flat` or
274
- `opex_generate -i "{/path/to/your/spreadsheet.xlsx}" "{/path/to/root/directory}" -m exact`
275
-
276
- ### XML Metadata - Quick Note
277
-
278
- When you have non-unique tags, again, such as `mods:note`, you will need add an index in square brackets `[0]` to indicate which tag to assign the data to, like: `mods:note[1] mods:notes[2] ...` The number of field will simply be the order they appear in the XML.
279
-
280
- For convenience I've included the full templates for DC, MODS, GDPR and EAD, with the `exact` names in the headers [here](https://github.com/CPJPRINCE/opex_manifest_generator/tree/master/samples/spreads). I also created the `--print-xmls` function to display this info (including square bracket placement).
281
-
282
- Also be aware that when using `-m` option and column headers for that XML document are present in the spreadsheet, it will add a metadata template to the OPEX, even if all the cells are left blank. As this is a useful function (adding blank templates to your import), I will leave this for now, but may adjust this in the future.
283
-
284
- ### XML Metadata Templates - Custom Templates
285
-
286
- Any custom XML template, that is functioning in Preservica will work with this method. All XML's in a given `metadata` directory are checked when enabling the `-m` option.
287
-
288
- The default location will be in the installation path of the program, typically under `/path/to/ptyhoninstall/Lib/site-packages/opex_manifest_generator/metadata`. However, you can also utilise the `-mdir` option to set this to a specific folder, to have a dedicated section.
289
-
290
- After the xml is added to that directory, all that's required is to add the matching column headers into your spreadsheet. You can also utilise `--print-xmls` to obtain this.
291
-
292
- ### Additional Information for Auto Reference
293
- #### SourceID
294
-
295
- A SourceID can also be set by adding a `SourceID` header. The behaviour of this is not fully tested, likely won't be as I don't really utilise SourceIDs in my work :\).
296
-
297
- #### Ignore
298
-
299
- Ignoring Files can also be set by adding an `Ignore` header. When this is set to `TRUE` this will skip the generation of an Opex for the specified File or Folder; when done for folder's, the folder Opex will still include any ignored file's in its manifest.
300
-
301
- #### Removals
302
-
303
- Removing Files or Folders is also possible, by adding a `Removals` header. When this is set to `TRUE`, the specified File or Folder will be removed from the system. As a safeguard this must be enabled by adding the parameter `-rm, --remove`, and confirming the deletion when prompted.
304
-
305
- #### Keywords
306
-
307
- You can utilise keywords to replace reference numbers with abbreviated characters for instance: `--keywords "Secret Metadata Folder"` will replace the reference number with `"SMF"`. You can also set different modes with `--keywords-mode`. `initialise` will take the initials of each letter like in the previous example; `firstletters` will take the first x number of letters. So the above becomes `"SEC"`. You can set multiple keywords with by comma separation. If `--keywords` is set without any set strings it will be applied to every word.
308
-
309
- There are further details in the Options Section.
310
-
311
- #### Sorting
312
-
313
- You can also sort utilising `--sort-by`. There are currently two options: `foldersfirst` and `alphabetical`. Folders first sorts folders first, then files (both alphabetically); alphabetically sorts both folders and files alphabetically.
314
-
315
- #### Options File
316
-
317
- You can utilise your own option-file to change the default column headers for the Input override method. See the option `--option-file path/to/file`. Defaults are:
318
-
319
- ```[options]
320
-
321
- INDEX_FIELD = FullName
322
- TITLE_FIELD = Title
323
- DESCRIPTION_FIELD = Description
324
- SECURITY_FIELD = Security
325
- IDENTIFIER_FIELD = Identifier
326
- IDENTIFIER_DEFAULT = code
327
- REMOVAL_FIELD = Removals
328
- IGNORE_FIELD = Ignore
329
- SOURCEID_FIELD = SourceID
330
- HASH_FIELD = Hash
331
- ALGORITHM_FIELD = Algorithm
332
- ```
333
- #### Custom Spreadsheets - Quick Note
334
-
335
- You technically don't have to utilise the AutoRef tool at all. Any old spreadsheet will do!
336
-
337
- The only requirement to use the input override, is the presence of the `FullName` column. With an accurate list of paths.
338
-
339
- ![FullName Column](assets/FullName%20Column.png)
340
-
341
- </details>
342
-
343
- ## Further Options
344
-
345
- The full options are given below; also see `opex_generate --help`
346
-
347
- <details>
348
- <summary>
349
- Click here
350
- </summary>
351
-
352
- ```
353
- Options:
354
- -h, --help Show Help dialog [boolean flag]
355
-
356
- -v, --version Display version information [boolean flag]
357
-
358
- Required Option:
359
-
360
- root The path to the root folder you wish to
361
- Generate a Manifest for. Will recurse through
362
- the specified folder.
363
-
364
- If no path is given will utilise the Current
365
- Working Directory.
366
-
367
- Opex Options:
368
-
369
- -fx, --fixity Generate a Fixity Check for files. [SHA-1,MD5, SHA-256, SHA-512
370
- Can set multiple fixities with comma. | boolean flag]
371
- IE MD5,SHA-1.
372
- [Defaults to SHA-1 if not specified]
373
-
374
- --pax-fixity Generates a Fixity Check for PAX files / Folders [boolean flag]
375
- If not set PAX files / folders will be treated
376
- as standard.
377
-
378
- -clr, --clear-opex Will remove all existing Opex folders, [boolean flag]
379
- When utilised with no other options, will end
380
- the program.
381
-
382
- -z, --zip Will zip the Opex's with the file itself to create [boolean flag]
383
- a zip file. Existing file's are currently not removed.
384
- ***Use with caution, repeating the command multiple
385
- times in a row, will break the Opex's / Generally
386
- cause a mess...
387
-
388
- --hidden Will generate Opex's for hidden files and directories [boolean flag]
389
-
390
- -rm, --remove Will enable removals from a spreadsheet import [boolean flag]
391
-
392
- -opt --options-file Specify an 'options.properties' file to change set [PATH/TO/FILE]
393
- presets for column headers for input.
394
-
395
- Auto Reference Options:
396
-
397
- -r, --autoref This will utilise the auto_reference_generator [{catalog, accession,both,
398
- module to generate an Auto Ref spreadsheet. generic, catalog-generic,
399
- accession-generic,
400
- There are several options, {catalog} will generate both-generic}]
401
- a Archival Reference following; {accession}
402
- will create a running number of files
403
- (Currently this is not configurable).
404
- {both} will do Both!
405
- {generic} will populate the Title and
406
- Description fields with the folder/file's name,
407
- if used in conjunction with one of the above options:
408
- {generic-catalog,generic-accession, generic-both}
409
- it will do both simultaneously.
410
-
411
- --accession-mode Sets whether to have the running tally be for {file,folder,both}
412
- files, folders or both,
413
- when utilising the Accession option with
414
- autoref. Default is file.
415
-
416
- -p, --prefix Assign a prefix to the Auto Reference, [PREFIX]
417
- when utilising {both} fill in like:
418
- "catalog-prefix","accession-prefix".
419
-
420
- -s --suffix Assign a suffix to the Auto Reference [SUFFIX]
421
- program. By Default only applies to Files
422
-
423
- --suffix-options Set the Suffix assignment options {apply_to_files, apply_to_folders,
424
- apply_to_both}
425
-
426
- --remove-empty Remove and log empty directories in a structure [boolean flag]
427
- Log will bee exported to 'meta' / output folder
428
-
429
- -o, --output Set's the output of the 'meta' folder when [PATH/TO/FOLDER]
430
- utilising AutoRef.
431
-
432
- -s, --start-ref Sets the starting Reference in the Auto Ref [int]
433
- process.
434
-
435
- -i --input Set whether to use an Auto Ref spreadsheet as an [PATH/TO/FILE]
436
- input. The input needs to be the (relative or
437
- absolute) path of the spreadsheet.
438
-
439
- This allows for use of the Auto Ref spreadsheet
440
- to customise the XIP metadata (and custom xml
441
- metadata).
442
-
443
- The following fields have to be added to the
444
- spreadsheet and titled exactly as:
445
- Title, Description, Security.
446
-
447
- -m --metadata Toggles use of the metadata import method. {none,flat,exact}
448
-
449
- There are two methods utilised by this:
450
- 'exact',or 'flat'.
451
-
452
- Exact requires that the column names in the spread
453
- sheet match exactly to the XML:
454
- {example:path/example:to/example:thing}
455
-
456
- Flat only requires the final tag match.
457
- IE {example:thing}. However, for more complex sets
458
- of metadata, Flat will not function correctly.
459
-
460
- Enabled with -m.
461
- [Defaults to 'exact' method if not
462
- specified]
463
-
464
- Use of metadata requires, XML documents to
465
- be added to the metadata folder, see docs for
466
- details.
467
-
468
- -mdir --metadata Specify the metadata directory to pull the XMLs files [PATH/TO/FOLDER]
469
- -dir from.
470
- [Defaults to lib folder if not set]
471
-
472
- --disable-meta-dir Will disable the creation of the 'meta' folder. [boolean flag]
473
- Can also be enabled with output.
474
-
475
- -ex --export Set whether to export any Auto Ref generation [boolean flag]
476
- to a spreadsheet
477
-
478
- -fmt, --format Set whether to export as a CSV or XLSX file. {csv,xlsx}
479
- [Default is to xlsx].
480
-
481
- -dlm --delimiter Set to specify the delimiter between References [DELIMITER STRING]
482
-
483
- -key --keywords Specify which keywords to look for and replace the [KEYWORDS ... | boolean flag]
484
- generated reference with an abbreviation of the
485
- word (depending on mode). For instance:
486
- "A list Strings" will be abbreviated ALS.
487
-
488
- Has to be an exact match to files / folders
489
- names. Can set multiple strings to look for with
490
- commas like so: "My Strings,I wish,to replace"
491
-
492
- Can also be set without specifying any words to
493
- apply to everything.
494
-
495
- --keym --keywords Specify the mode to use for keywords {initialise,firstletters,from_json}
496
- -mode Either 'initialise' taking the first letter of each
497
- word between spaces IE "Department of Justice" becomes
498
- "DOJ".
499
-
500
- 'firstletters' takes the first n amount of letters.
501
- The aforementioned becomes "DEP"
502
-
503
- 'from_json'' allows you to enter in the path to a
504
- JSON file formatted as a Dict. The Key will be
505
- used as the string to replace and the value,
506
- what will be used as the replacement.
507
- IE {'Important Document':'IMD', 'Human Resources': 'HR'}
508
-
509
- --keywords-case Toggle to enable Case-Sensitivity, by Default
510
- -sensitive Keywords matching is insensitive
511
-
512
- --keywords-retain- Specify if you wish continue or reset reference [boolean flag]
513
- -order numbering for references not in keywords.
514
-
515
- IE By default if a keyword is found and replaced,
516
- where it would normally be reference number '3'.
517
- The next reference down would be given the number 3.
518
-
519
- Using this option, the next reference would be given
520
- 4.
521
-
522
- --keywords-abbreviation Set the number of characters to abbreviate to for [int]
523
- -number keywords option
524
- [Default is 3 first letters, -1 for initialise]
525
-
526
- --sort-by Set the method to sort. Can either utilise {folders_first,alphabetical}
527
- 'foldersfirst' to sort folders first then
528
- alphabetically or 'alphabetical to sort
529
- both folders and files alphabetically
530
- [Default is foldersfirst.]
531
- ```
532
- </details>
533
-
534
- ## Future Developments
535
-
536
- - ~~Customisable Filtering~~ *Added!*
537
- - ~~Adjust Accession so the different modes can utilised from Opex.~~ *Added!*
538
- - ~~Add SourceID as option for use with Auto Ref Spreadsheets.~~ *Added!*
539
- - ~~Allow for multiple Identifier's to be added with Auto Ref Spreadsheets. Currently only 1 or 2 identifiers can be added at a time, under "Archive_Reference" or "Accession_Reference". These are also tied to be either "code" or "accref". An Option needs to be added to allow custom setting of identifier...~~ *Added!*
540
- - ~~Add an option / make it a default for Metadata XML's to be located in a specified directory rather than in the package.~~ *Added!*
541
- - Zipping to conform to PAX - Last on the check list; it technically does...
542
- - In theory, this tool should be compatible with any system that makes use of the OPEX standard... But in theory Communism works, in theory...
543
-
544
- ## Developers
545
-
546
- For Developers you can also embed / use the program directly in Python. Though be warned I haven't tested this functionally much!
547
-
548
- ```
549
- from opex_manifest_generator import OpexManifestGenerator as OMG
550
-
551
- OMG(root="/my/directory/path", algorithm = "SHA-256").main()
552
-
553
- ```
554
-
555
- ## Contributing
556
-
557
- I welcome further contributions and feedback! If there any issues please raise them [here](https://github.com/CPJPRINCE/opex_manifest_generator/issues)
@@ -1,16 +0,0 @@
1
- opex_manifest_generator/__init__.py,sha256=fsN-dLjNMn-AfjeG2jkryzIa69bY09B5xLTqWedOv_w,461
2
- opex_manifest_generator/cli.py,sha256=5HXja7uPccPSq0N94Rzc4uMsDasIpCjJPseqchodV-0,21229
3
- opex_manifest_generator/common.py,sha256=3imZ5zrL7BzISjIRySNZauDXv2uW5Pi89iVSlqmVkBE,3074
4
- opex_manifest_generator/hash.py,sha256=pvb9y7UlB4NjTkR4uc-4Zb8Hp6wO4MS61WQtSt0_KmI,2853
5
- opex_manifest_generator/opex_manifest.py,sha256=55PshtmN6FQmfKzp_SeW-jStOunGBV0hbI3XDPOl2fU,55521
6
- opex_manifest_generator/metadata/DublinCore Template.xml,sha256=csNGXzSH27Whs4BQNuwMZl8nLSdDq7Y_OblTfzeBqWQ,775
7
- opex_manifest_generator/metadata/EAD Template.xml,sha256=OsWjUfKiLAsc1zqm56auyFSDYMuZpu6a49AFgqZNzlU,2167
8
- opex_manifest_generator/metadata/GDPR Template.xml,sha256=r6WTATRVt1sr7VCdaXOwz4vLgU3IgFFx7oRmPnORBWc,475
9
- opex_manifest_generator/metadata/MODS Template.xml,sha256=qmH03nIPGuPokFiBS_HjIPht1bzc1gsY4mPEoAVdHTg,2635
10
- opex_manifest_generator/options/options.properties,sha256=33KhW-o3CaDAY8ZVqMFfo9-fwZwAFJfitYmXjd1wA5U,479
11
- opex_manifest_generator-1.3.5.dist-info/licenses/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
12
- opex_manifest_generator-1.3.5.dist-info/METADATA,sha256=G_rpXxgozIPKMAYvA6aukovrcAmlebG1FkuO5zhF07g,31031
13
- opex_manifest_generator-1.3.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
14
- opex_manifest_generator-1.3.5.dist-info/entry_points.txt,sha256=WGMc3hWlqOsQ8DcTuy8-DyBbJKkWNImT4J1FasVDHts,70
15
- opex_manifest_generator-1.3.5.dist-info/top_level.txt,sha256=K48eGnaDLVO6YDJdAZLqbeoZvJHBGX25cvYT-i8gWt0,24
16
- opex_manifest_generator-1.3.5.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- opex_generate = opex_manifest_generator.cli:run_cli