auto-reference-generator 1.3.4__tar.gz → 1.3.5__tar.gz
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.
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/.github/workflows/codeql.yml +31 -4
- auto_reference_generator-1.3.5/.github/workflows/python-tests.yml +30 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/.gitignore +1 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/PKG-INFO +154 -105
- auto_reference_generator-1.3.5/README.md +319 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/auto_reference_generator/cli.py +80 -12
- auto_reference_generator-1.3.5/auto_reference_generator/common.py +209 -0
- auto_reference_generator-1.3.5/auto_reference_generator/hash.py +49 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/auto_reference_generator/options/options.properties +5 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/auto_reference_generator/reference_generator.py +229 -238
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/auto_reference_generator.egg-info/PKG-INFO +154 -105
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/auto_reference_generator.egg-info/SOURCES.txt +11 -1
- auto_reference_generator-1.3.5/auto_reference_generator.egg-info/requires.txt +11 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/pyproject.toml +9 -3
- auto_reference_generator-1.3.5/pytest.ini +35 -0
- auto_reference_generator-1.3.5/samples/auto_reference_generator_AutoRef.xlsx +0 -0
- auto_reference_generator-1.3.5/samples/auto_reference_generator_AutoRef_from_json.xlsx +0 -0
- auto_reference_generator-1.3.5/samples/sample_json_dict.json +1 -0
- auto_reference_generator-1.3.5/tests/test_common.py +28 -0
- auto_reference_generator-1.3.5/tests/test_hash.py +27 -0
- auto_reference_generator-1.3.5/tests/test_reference_generator.py +42 -0
- auto_reference_generator-1.3.5/tests/test_reference_generator_integration.py +62 -0
- auto_reference_generator-1.3.5/tests/test_reference_loop_and_keywords.py +89 -0
- auto_reference_generator-1.3.4/README.md +0 -274
- auto_reference_generator-1.3.4/auto_reference_generator/common.py +0 -165
- auto_reference_generator-1.3.4/auto_reference_generator/hash.py +0 -27
- auto_reference_generator-1.3.4/auto_reference_generator.egg-info/requires.txt +0 -6
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/.github/workflows/pypi-publish.yml +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/LICENSE.md +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/assets/AccessionPreview.png +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/assets/HashPreview.png +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/assets/ReferencesPreview.png +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/assets/SpreadGen.png +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/assets/SpreadPreview.png +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/assets/metaFolder.png +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/assets/sample_from_dict.json +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/auto_reference_generator/__init__.py +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/auto_reference_generator.egg-info/dependency_links.txt +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/auto_reference_generator.egg-info/entry_points.txt +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/auto_reference_generator.egg-info/top_level.txt +0 -0
- {auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/setup.cfg +0 -0
{auto_reference_generator-1.3.4 → auto_reference_generator-1.3.5}/.github/workflows/codeql.yml
RENAMED
|
@@ -14,9 +14,22 @@ name: "CodeQL"
|
|
|
14
14
|
on:
|
|
15
15
|
push:
|
|
16
16
|
branches: [ master ]
|
|
17
|
+
# avoid running on doc-only / asset-only changes
|
|
18
|
+
paths-ignore:
|
|
19
|
+
- 'README.md'
|
|
20
|
+
- 'docs/**'
|
|
21
|
+
- 'assets/**'
|
|
22
|
+
- '.github/**'
|
|
17
23
|
pull_request:
|
|
18
24
|
# The branches below must be a subset of the branches above
|
|
19
25
|
branches: [ master ]
|
|
26
|
+
paths-ignore:
|
|
27
|
+
- 'README.md'
|
|
28
|
+
- 'docs/**'
|
|
29
|
+
- 'assets/**'
|
|
30
|
+
- '.github/**'
|
|
31
|
+
# allow manual runs
|
|
32
|
+
workflow_dispatch: {}
|
|
20
33
|
schedule:
|
|
21
34
|
- cron: '20 10 * * 6'
|
|
22
35
|
|
|
@@ -24,6 +37,9 @@ jobs:
|
|
|
24
37
|
analyze:
|
|
25
38
|
name: Analyze
|
|
26
39
|
runs-on: ubuntu-latest
|
|
40
|
+
concurrency:
|
|
41
|
+
group: codeql-scan-${{ github.ref }}
|
|
42
|
+
cancel-in-progress: true
|
|
27
43
|
permissions:
|
|
28
44
|
actions: read
|
|
29
45
|
contents: read
|
|
@@ -39,11 +55,22 @@ jobs:
|
|
|
39
55
|
|
|
40
56
|
steps:
|
|
41
57
|
- name: Checkout repository
|
|
42
|
-
uses: actions/checkout@
|
|
58
|
+
uses: actions/checkout@v4
|
|
59
|
+
|
|
60
|
+
- name: Set up Python (improves CodeQL context for Python projects)
|
|
61
|
+
uses: actions/setup-python@v4
|
|
62
|
+
with:
|
|
63
|
+
python-version: '3.x'
|
|
64
|
+
cache: 'pip'
|
|
65
|
+
|
|
66
|
+
- name: Install dev dependencies (optional)
|
|
67
|
+
run: |
|
|
68
|
+
python -m pip install --upgrade pip
|
|
69
|
+
if [ -f pyproject.toml ]; then pip install -e '.[dev]' || true; fi
|
|
43
70
|
|
|
44
71
|
# Initializes the CodeQL tools for scanning.
|
|
45
72
|
- name: Initialize CodeQL
|
|
46
|
-
uses: github/codeql-action/init@
|
|
73
|
+
uses: github/codeql-action/init@v4
|
|
47
74
|
with:
|
|
48
75
|
languages: ${{ matrix.language }}
|
|
49
76
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
@@ -54,7 +81,7 @@ jobs:
|
|
|
54
81
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
55
82
|
# If this step fails, then you should remove it and run the build manually (see below)
|
|
56
83
|
- name: Autobuild
|
|
57
|
-
uses: github/codeql-action/autobuild@
|
|
84
|
+
uses: github/codeql-action/autobuild@v4
|
|
58
85
|
|
|
59
86
|
# ℹ️ Command-line programs to run using the OS shell.
|
|
60
87
|
# 📚 https://git.io/JvXDl
|
|
@@ -68,4 +95,4 @@ jobs:
|
|
|
68
95
|
# make release
|
|
69
96
|
|
|
70
97
|
- name: Perform CodeQL Analysis
|
|
71
|
-
uses: github/codeql-action/analyze@
|
|
98
|
+
uses: github/codeql-action/analyze@v4
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ master ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
19
|
+
uses: actions/setup-python@v4
|
|
20
|
+
with:
|
|
21
|
+
python-version: ${{ matrix.python-version }}
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: |
|
|
25
|
+
python -m pip install --upgrade pip
|
|
26
|
+
python -m pip install -e ".[dev,addex]"
|
|
27
|
+
|
|
28
|
+
- name: Run tests
|
|
29
|
+
run: |
|
|
30
|
+
python -m pytest -v
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: auto_reference_generator
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.5
|
|
4
4
|
Summary: A tool for archivist's to automate the generation of references for digital files
|
|
5
5
|
Author-email: Christopher Prince <c.pj.prince@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -14,174 +14,216 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE.md
|
|
15
15
|
Requires-Dist: pandas
|
|
16
16
|
Requires-Dist: openpyxl
|
|
17
|
+
Requires-Dist: tqdm
|
|
17
18
|
Provides-Extra: addex
|
|
18
19
|
Requires-Dist: lxml; extra == "addex"
|
|
19
20
|
Requires-Dist: odfpy; extra == "addex"
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
23
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
20
24
|
Dynamic: license-file
|
|
21
25
|
|
|
22
|
-
# Auto Reference Generator
|
|
26
|
+
# Auto Reference Generator
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
A small python programme to generate hieracrchical archival reference for files and directories and export the results to a spreadsheet.
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
Badges: PyPI | CI | Coverage | License
|
|
27
31
|
|
|
28
|
-
##
|
|
29
|
-
|
|
30
|
-
If you're an archivist dealing with Digital Records, this provides a means of undertaking a referencing of a large amount of digital records at a time, saving a significant amount of time in assigning reference codes to individual records.
|
|
31
|
-
|
|
32
|
-
The generated spreadsheet also serves as the basis for spreadsheet inputs for the Opex Manifest Generator tool [*\*Shameless Self promotion\**.](https://github.com/CPJPRINCE/opex_manifest_generator/)
|
|
33
|
-
|
|
34
|
-
## A Quick Note
|
|
35
|
-
|
|
36
|
-
If you need to conduct an arrangement of the files; this must be done beforehand for the references to be accurate; though a temporary spreadsheet can be generated to provide assistance in this.
|
|
37
|
-
|
|
38
|
-
## Additional features:
|
|
39
|
-
|
|
40
|
-
Some additional features include.
|
|
41
|
-
|
|
42
|
-
- Append prefixes to the Archival Reference.
|
|
43
|
-
- Identifying the depth / level of each folder.
|
|
44
|
-
- Gathering standard set of Metadata.
|
|
45
|
-
- Changeable starting reference.
|
|
46
|
-
- Logged removal of empty directories.
|
|
47
|
-
- An alternative "Accession Reference" mode.
|
|
48
|
-
- Compatibility with Win32 / Window's 256 Character limit.
|
|
49
|
-
|
|
50
|
-
## Structure of References
|
|
32
|
+
## Quick Start
|
|
33
|
+
Install:
|
|
51
34
|
```
|
|
52
|
-
|
|
53
|
-
-->Root 0
|
|
54
|
-
---->Folder 1 1
|
|
55
|
-
------>Sub Folder 1 1/1
|
|
56
|
-
-------->File 1 1/1/1
|
|
57
|
-
-------->File 2 1/1/2
|
|
58
|
-
------>Sub Folder 2 1/2
|
|
59
|
-
-------->File 3 1/2/1
|
|
60
|
-
-------->File 4 1/2/2
|
|
61
|
-
---->Folder 2 2
|
|
62
|
-
------>Sub Folder 3 2/1
|
|
63
|
-
------>File 5 2/2
|
|
64
|
-
---->File 6 3
|
|
35
|
+
pip install -U auto_reference_generator
|
|
65
36
|
```
|
|
66
|
-
|
|
37
|
+
Or download portable version.
|
|
67
38
|
|
|
39
|
+
Run:
|
|
68
40
|
```
|
|
69
|
-
|
|
70
|
-
---->Folder ARC/1
|
|
71
|
-
------>Sub Folder ARC/1/1
|
|
72
|
-
------>File ARC/1/2
|
|
73
|
-
etc
|
|
41
|
+
auto_ref /path/to/root -p PREFIX -o /path/to/output
|
|
74
42
|
```
|
|
75
43
|
|
|
76
|
-
|
|
44
|
+
Generates a `meta/` folder with output `root_AutoRef.xlsx`
|
|
77
45
|
|
|
78
|
-
|
|
46
|
+
To use the portable version navigate to the Downloaded then run with:
|
|
47
|
+
```
|
|
48
|
+
.\auto_ref.exe .\path\to\root
|
|
49
|
+
```
|
|
79
50
|
|
|
80
|
-
|
|
81
|
-
- openpyxl
|
|
51
|
+
## Version & Package info
|
|
82
52
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
- odfpy (for ODS Export)
|
|
53
|
+
Python Version:
|
|
54
|
+
Python Version 3.10+ is recommended. Earlier versions may work but are not tested.
|
|
86
55
|
|
|
87
|
-
|
|
56
|
+
Additional Packages:
|
|
57
|
+
- pandas (required)
|
|
58
|
+
- openpyxl (required - spreadsheet exports)
|
|
59
|
+
- pyodf (ods export)
|
|
60
|
+
- lxml (xml export)
|
|
61
|
+
- tqdm
|
|
62
|
+
To install:
|
|
88
63
|
|
|
89
|
-
|
|
64
|
+
```
|
|
65
|
+
pip install pandas openpyxl pyodf lxml tqdm
|
|
66
|
+
```
|
|
67
|
+
Portable version includes
|
|
90
68
|
|
|
91
|
-
|
|
69
|
+
## Why use this tool?
|
|
92
70
|
|
|
93
|
-
|
|
71
|
+
This tool is designed for archivist's cataloguing large amounts of Digital Records at a time.
|
|
94
72
|
|
|
95
|
-
|
|
73
|
+
It's platform independent tested functioning on Windows and Linux (untested on MacOS).
|
|
96
74
|
|
|
97
|
-
|
|
75
|
+
## Features:
|
|
98
76
|
|
|
99
|
-
|
|
77
|
+
- Hierachical reference generation with customisatible (Prefixes/Suffixes/Delimiters/Starting ref).
|
|
78
|
+
- 'Level' identification and limiting.
|
|
79
|
+
- Keyword filtering - replacing Numericals with specified keywords (intials, first letter, JSON map)
|
|
80
|
+
- Logged removal of empty directories.
|
|
81
|
+
- An Accession / Running Number mode.
|
|
82
|
+
- Fixity Generation
|
|
83
|
+
- Exports: xslx (Default), csv, ods (requires pyodf), json or xml (requires lxml).
|
|
84
|
+
- Integration with Opex Manifest Generator [*\*Shameless Self promotion\**.](https://github.com/CPJPRINCE/opex_manifest_generator/)
|
|
100
85
|
|
|
101
|
-
|
|
86
|
+
## Basic Usage / Examples
|
|
102
87
|
|
|
103
|
-
`auto_ref
|
|
88
|
+
- Basic: `auto_ref /path/to/root`
|
|
89
|
+
- Prefix: `auto_ref /path/to/root -p PREFIX`
|
|
90
|
+
- Suffix: `auto_ref /path/to/root -s SUFFIX`
|
|
91
|
+
- Delimiter: `auto_ref /path/to/root -dlm "-"`
|
|
92
|
+
- Accession: `auto_ref /path/to/root -acc file`
|
|
93
|
+
- Fixity: `auto_ref /path/to/root -fx MD5`
|
|
94
|
+
- Format: `auto_ref /path/to/root -fmt csv`
|
|
95
|
+
- Remove Empty `auto_ref /path/to/root --remove-empty`
|
|
96
|
+
- Output: `auto_ref /path/to/root -o /path/to/output`
|
|
97
|
+
- Include Hidden: `auto_ref /path/to/root --hidden`
|
|
104
98
|
|
|
105
|
-
|
|
99
|
+
These options can be combined in an.
|
|
106
100
|
|
|
107
|
-
|
|
101
|
+
## Output
|
|
108
102
|
|
|
109
|
-
|
|
103
|
+
Expected ouput is like so:
|
|
110
104
|
|
|
111
|
-
|
|
105
|
+

|
|
112
106
|
|
|
113
|
-
|
|
107
|
+
This includes a preset of metadata:
|
|
108
|
+
Including: FullName, RelativeName, BaseName, Size, Modified, Ref_Section Level, Parent, Archive_Reference,
|
|
114
109
|
|
|
115
|
-
The
|
|
110
|
+
The reference will by default be generated to the `Archive_Reference` column:
|
|
116
111
|
|
|
117
|
-

|
|
118
113
|
|
|
119
|
-
|
|
114
|
+
## Structure of References
|
|
120
115
|
|
|
121
|
-
|
|
116
|
+
Usage with Prefix `ARC`.
|
|
117
|
+
```
|
|
118
|
+
Folder Reference
|
|
119
|
+
>Root ARC
|
|
120
|
+
--->Folder 1 ARC/1
|
|
121
|
+
------>Sub Folder 1 ARC/1/1
|
|
122
|
+
--------->File 1 ARC/1/1/1
|
|
123
|
+
--------->File 2 ARC/1/1/2
|
|
124
|
+
------>Sub Folder 2 ARC/1/2
|
|
125
|
+
--------->File 3 ARC/1/2/1
|
|
126
|
+
--------->File 4 ARC/1/2/2
|
|
127
|
+
--->Folder 2 ARC/2
|
|
128
|
+
------>Sub Folder 3 ARC/2/1
|
|
129
|
+
--------->File 5 ARC/2/2
|
|
130
|
+
--->File 6 ARC/3
|
|
131
|
+
```
|
|
122
132
|
|
|
123
|
-
|
|
133
|
+
Files and Folders can coexist at the same level. Without a prefix the root reference defaults to 0:
|
|
124
134
|
|
|
125
|
-
|
|
135
|
+
```
|
|
136
|
+
>Root 0
|
|
137
|
+
--->Folder 1
|
|
138
|
+
------>Sub Folder 1/1
|
|
139
|
+
--------->File 1/1/1
|
|
140
|
+
--------->File2 1/1/2
|
|
141
|
+
------>File3 1/2
|
|
126
142
|
|
|
127
|
-
|
|
143
|
+
```
|
|
144
|
+
Prefixes can be set to any point in an Hierachy.
|
|
128
145
|
|
|
129
|
-
##
|
|
146
|
+
## Advanced Options
|
|
130
147
|
|
|
131
|
-
|
|
148
|
+
### Accession mode
|
|
132
149
|
|
|
150
|
+
An alternative method of code generation is based on an 'accession number'/running number pattern. Each file or folder will be given a running number regardless of depth.
|
|
133
151
|
|
|
152
|
+
Example output running Accession in "File" Mode:
|
|
134
153
|
```
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
------>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
------>
|
|
142
|
-
|
|
143
|
-
--------> Sub-Folder ACC-Dir
|
|
144
|
-
----------> File 4 ACC-4
|
|
154
|
+
> Root ACC-Dir
|
|
155
|
+
---> Folder 1 ACC-Dir
|
|
156
|
+
------> File 1 ACC-1
|
|
157
|
+
------> File 2 ACC-2
|
|
158
|
+
---> File 3 ACC-3
|
|
159
|
+
---> Folder 2 ACC-Dir
|
|
160
|
+
------> Sub-Folder ACC-Dir
|
|
161
|
+
---------> File 4 ACC-4
|
|
145
162
|
```
|
|
146
163
|
|
|
147
|
-
|
|
164
|
+
To run:
|
|
148
165
|
|
|
149
|
-
|
|
166
|
+
`auto_ref "/path/to/root" -acc file -accp "ACC"`
|
|
150
167
|
|
|
151
|
-
`
|
|
168
|
+
The available modes are for `file, dir, all`. Output will be to an additiona `Accession_Reference` column
|
|
152
169
|
|
|
153
170
|

|
|
154
171
|
|
|
155
|
-
When you generate an Accession Reference an Archive_Reference code will always also be generated.
|
|
156
172
|
|
|
157
|
-
|
|
173
|
+
### Clear Empty Directories
|
|
174
|
+
|
|
175
|
+
Running `auto_ref /path/to/root --remove-empty` automatically remove any empty directories. A plain text log of the removed directories will be saved to `meta/`.
|
|
158
176
|
|
|
159
|
-
|
|
177
|
+
### Fixity
|
|
160
178
|
|
|
161
|
-
|
|
179
|
+
To run a fixity and save to the output: `auto_ref /path/to/root -fx ALGORITHM` This will default to using the SHA-1 algorithm. MD5, SHA-1, SHA-256 and SHA-512 are supported.
|
|
162
180
|
|
|
163
|
-
|
|
181
|
+

|
|
164
182
|
|
|
165
|
-
|
|
183
|
+
### Level Limit
|
|
166
184
|
|
|
167
|
-
|
|
185
|
+
Set a level limit to stop generating referencing at: `auto_ref /path/to/root -l 5` will stop generating references 5 levels below root.
|
|
168
186
|
|
|
169
|
-
|
|
187
|
+
### Skip
|
|
188
|
+
|
|
189
|
+
If you want to generate a spreadsheet without a reference code you can run: `auto_ref /path/to/root --skip`
|
|
170
190
|
|
|
171
|
-
|
|
191
|
+
### Options File
|
|
172
192
|
|
|
173
|
-
|
|
193
|
+
You can customise the program by creating an 'options file' using the `--options-file` option. This allows for customisation of the column headers and the programs defaults.
|
|
174
194
|
|
|
175
|
-
|
|
195
|
+
Options given as:
|
|
196
|
+
```
|
|
197
|
+
[options]
|
|
198
|
+
|
|
199
|
+
INDEX_FIELD = FullName #Sets which field to use for index.
|
|
200
|
+
|
|
201
|
+
PATH_FIELD = FullName
|
|
202
|
+
RELATIVE_FIELD = RelativeName
|
|
203
|
+
PARENT_FIELD = Parent
|
|
204
|
+
PARENT_REF = Parent_Ref
|
|
205
|
+
REFERENCE_FIELD = Archive_Reference
|
|
206
|
+
REF_SECTION = Ref_Section
|
|
207
|
+
ACCESSION_FIELD = Accession_Reference
|
|
208
|
+
LEVEL_FIELD = Level
|
|
209
|
+
...
|
|
210
|
+
```
|
|
176
211
|
|
|
177
|
-
|
|
212
|
+
### Keywords
|
|
178
213
|
|
|
179
|
-
|
|
214
|
+
To use Keywords: `auto_ref /path/to/root -key Keyword1 Keyword2 Keyword3 ... -keym intialise` The keywords will replace the reference number to all matches of the keyword. The way the replacement is made is determined by the `-keym / --keyword-mode`.
|
|
180
215
|
|
|
181
|
-
|
|
216
|
+
Keyword Modes:
|
|
217
|
+
- `intialise` Uses the intials of the words. `Department of Justice` becomes `DOJ`. Singluar words use first x amount of letters.
|
|
218
|
+
- `firstletters` uses the first x amount of letters.`Department of Justices` becomes `DEP`.
|
|
219
|
+
- `from_json` can create a Python Dictionary in a JSON file and set KEYWORD to that file. Will replace all keys with given value. Run like so: `auto_ref /path/to/root -key /path/to/json.json`.
|
|
220
|
+
- JSON Dict written like so: `{'keyword':'value','keyword2','value2',...}`
|
|
182
221
|
|
|
183
|
-
## Options:
|
|
222
|
+
## Full Options:
|
|
184
223
|
|
|
224
|
+
(Note to self add in argparse to md...)
|
|
225
|
+
|
|
226
|
+
The below covers the full range of options. This may not be up to date.
|
|
185
227
|
For up to date options use the `-h` option to show dialog:
|
|
186
228
|
|
|
187
229
|
```
|
|
@@ -217,7 +259,7 @@ Options:
|
|
|
217
259
|
-hid --hidden Include Hidden directories and files in [boolean]
|
|
218
260
|
generation.
|
|
219
261
|
|
|
220
|
-
--
|
|
262
|
+
--remove-empty Will remove all Empty Directories from [boolean]
|
|
221
263
|
within a given folder, not including them
|
|
222
264
|
in the Reference Generation.
|
|
223
265
|
A simply Text list of removed folders is
|
|
@@ -285,10 +327,17 @@ Options:
|
|
|
285
327
|
|
|
286
328
|
```
|
|
287
329
|
|
|
330
|
+
## Troubleshooting
|
|
331
|
+
|
|
332
|
+
- On Windows ensure that your root folder does not end in a `\`.
|
|
333
|
+
- The `meta/` folder will always be ignored.
|
|
334
|
+
|
|
335
|
+
|
|
288
336
|
## Future Developments
|
|
289
337
|
|
|
290
338
|
- ~~Level Limitations to allow for "group references"~~ - Added!
|
|
291
339
|
- ~~Generating reference's which use alphabetic characters~~ - Added!
|
|
340
|
+
- Physical Level
|
|
292
341
|
|
|
293
342
|
## Contributing
|
|
294
343
|
|