Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripts that use ArchivesSnake #7

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ed50d35
add requirements
Oct 18, 2022
571ea4a
add asnake and google clients
bonniegee Oct 18, 2022
1159ca2
add tests for aspace upgrade
bonniegee Oct 18, 2022
4bb73da
add orphan digital object deleter
bonniegee Oct 18, 2022
ea1b659
add broken links finder
bonniegee Oct 18, 2022
784530f
add flake8 config
bonniegee Oct 21, 2022
141f40d
clean up broken link script
bonniegee Oct 21, 2022
41f9bd6
update gitignore
bonniegee Oct 21, 2022
3721c29
add readme
bonniegee Oct 21, 2022
638706c
add google sheets client tests
bonniegee Oct 21, 2022
d20dcbd
remove unused methods
bonniegee Oct 21, 2022
7d027d1
add linting, etc
bonniegee Oct 25, 2022
5c32a9b
add upgrade test
bonniegee Oct 25, 2022
ada5bd1
get purpose of assessment info
bonniegee Oct 27, 2022
1a21a50
start to update assessment info
bonniegee Nov 14, 2022
540cc20
pair programming changes
bonniegee Nov 15, 2022
6dbca13
add tests to update assessments
bonniegee Dec 1, 2022
afa7d12
handle assessments without purpose
bonniegee Dec 5, 2022
a02e357
add docstring
bonniegee Dec 5, 2022
dae3daa
add more assessments tests
bonniegee Dec 23, 2022
bec3660
Add assessment finder (#8)
bonniegee Jan 10, 2023
5970e50
merge
bonniegee Dec 23, 2022
4aa739a
Merge branch 'assessments' into add-asnake-scripts
bonniegee Jan 10, 2023
317bfc9
add fixtures
bonniegee Jan 10, 2023
ba1184d
update dependencies, add conservation
bonniegee Jan 17, 2023
3b6e772
simplify tests
bonniegee Jan 17, 2023
d5863cf
add script to check children of a resource
bonniegee Jan 17, 2023
c255abd
build out update tree
bonniegee Jan 31, 2023
3bac90b
add coverage to gitignore
bonniegee Feb 1, 2023
afd5c3c
acfa-370
bonniegee Feb 7, 2023
66225e7
skip carnegie
bonniegee Feb 8, 2023
a3e9d19
add json response
bonniegee Mar 10, 2023
56f483c
add log only mode
bonniegee Mar 14, 2023
7bbc123
remove wayfinders
bonniegee Mar 20, 2023
9e4c417
update resource script
bonniegee Mar 23, 2023
d013c9f
make variable attribute
bonniegee Mar 27, 2023
7691138
optional filename
bonniegee Apr 7, 2023
7d55c80
add reorder script
bonniegee Apr 17, 2023
a67a10e
deal with dates
bonniegee May 1, 2023
ac60cfe
get date from parent
bonniegee May 8, 2023
521f737
add docstrings, additional options
bonniegee Jun 8, 2023
e0a1f46
add tests, docstrings
bonniegee Jun 9, 2023
7db4bfa
replace title with note
bonniegee Jun 15, 2023
e989200
add tests
bonniegee Jul 6, 2023
bb043b7
add scaffolding for physdesc to extent
bonniegee Jul 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[flake8]
docstring-convention = google
ignore =
D100 # Missing docstring in public module
D101 # Missing docstring in public class
D102 # Missing docstring in public method
D103 # Missing docstring in public function
D104 # Missing docstring in public package
D105 # Missing docstring in magic method
D106 # Missing docstring in public nested class
D107 # Missing docstring in __init__
E501 # Line too long
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.DS_store
**/secrets.py
**/secretsDev.py
**/config.ini
local_settings.cfg
__pycache__
.coverage
Binary file added archivessnake/.coverage
Binary file not shown.
12 changes: 12 additions & 0 deletions archivessnake/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[flake8]
docstring-convention = google
ignore =
D100 # Missing docstring in public module
D101 # Missing docstring in public class
D102 # Missing docstring in public method
D103 # Missing docstring in public function
D104 # Missing docstring in public package
D105 # Missing docstring in magic method
D106 # Missing docstring in public nested class
D107 # Missing docstring in __init__
E501 # Line too long
19 changes: 19 additions & 0 deletions archivessnake/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/ambv/black
rev: 22.6.0
hooks:
- id: black
args: [--safe, --quiet]
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: [--profile, black]
- repo: https://github.com/jazzband/pip-tools
rev: 6.8.0
hooks:
- id: pip-compile
21 changes: 21 additions & 0 deletions archivessnake/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# archivessnake

These scripts use ArchivesSnake to export data from and push data to ArchivesSpace.

## Requirements

* See requirements.txt

## Installation

These scripts require a local configurations file, which should be created in the same directory as the script and named `local_settings.cfg`. A sample file looks like this:

```
[ArchivesSpace]
# the base URL of your ArchivesSpace installation
baseURL:http://localhost:8089
username:admin
password:admin
```


111 changes: 111 additions & 0 deletions archivessnake/fixtures/ao_with_date.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"lock_version": 0,
"position": 8232,
"publish": true,
"ref_id": "cef33b4d44f5f58ad7903cd74f0ba7f8",
"title": "R--Miscellaneous",
"display_string": "R--Miscellaneous, 1982-1984",
"restrictions_apply": false,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2019-05-21T16:28:20Z",
"system_mtime": "2023-03-20T15:14:05Z",
"user_mtime": "2019-05-21T16:28:20Z",
"suppressed": false,
"is_slug_auto": false,
"level": "file",
"jsonmodel_type": "archival_object",
"external_ids": [

],
"subjects": [

],
"linked_events": [

],
"extents": [

],
"lang_materials": [

],
"dates": [
{
"lock_version": 0,
"expression": "1982-1984",
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2019-05-21T16:28:20Z",
"system_mtime": "2019-05-21T16:28:20Z",
"user_mtime": "2019-05-21T16:28:20Z",
"date_type": "inclusive",
"label": "creation",
"jsonmodel_type": "date"
}
],
"external_documents": [

],
"rights_statements": [

],
"linked_agents": [

],
"import_previous_arks": [

],
"ancestors": [
{
"ref": "/repositories/2/archival_objects/181601",
"level": "series"
},
{
"ref": "/repositories/2/resources/5189",
"level": "collection"
}
],
"instances": [
{
"lock_version": 0,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2019-05-21T16:28:20Z",
"system_mtime": "2019-05-21T16:28:20Z",
"user_mtime": "2019-05-21T16:28:20Z",
"instance_type": "box",
"jsonmodel_type": "instance",
"is_representative": false,
"sub_container": {
"lock_version": 0,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2019-05-21T16:28:20Z",
"system_mtime": "2019-05-21T16:28:20Z",
"user_mtime": "2019-05-21T16:28:20Z",
"jsonmodel_type": "sub_container",
"top_container": {
"ref": "/repositories/2/top_containers/19221"
}
}
}
],
"notes": [

],
"accession_links": [

],
"uri": "/repositories/2/archival_objects/190075",
"repository": {
"ref": "/repositories/2"
},
"resource": {
"ref": "/repositories/2/resources/5189"
},
"parent": {
"ref": "/repositories/2/archival_objects/181601"
},
"has_unpublished_ancestor": false
}
100 changes: 100 additions & 0 deletions archivessnake/fixtures/ao_without_date.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"lock_version": 0,
"position": 5698,
"publish": true,
"ref_id": "ad234bcda4de58dfaa180aab442e91c3",
"title": "Gray, Sanford D.",
"display_string": "Gray, Sanford D.",
"restrictions_apply": false,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2019-05-21T16:27:48Z",
"system_mtime": "2023-03-20T15:14:05Z",
"user_mtime": "2019-05-21T16:27:48Z",
"suppressed": false,
"is_slug_auto": false,
"level": "file",
"jsonmodel_type": "archival_object",
"external_ids": [

],
"subjects": [

],
"linked_events": [

],
"extents": [

],
"lang_materials": [

],
"dates": [

],
"external_documents": [

],
"rights_statements": [

],
"linked_agents": [

],
"import_previous_arks": [

],
"ancestors": [
{
"ref": "/repositories/2/archival_objects/181601",
"level": "series"
},
{
"ref": "/repositories/2/resources/5189",
"level": "collection"
}
],
"instances": [
{
"lock_version": 0,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2019-05-21T16:27:48Z",
"system_mtime": "2019-05-21T16:27:48Z",
"user_mtime": "2019-05-21T16:27:48Z",
"instance_type": "box",
"jsonmodel_type": "instance",
"is_representative": false,
"sub_container": {
"lock_version": 0,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2019-05-21T16:27:48Z",
"system_mtime": "2019-05-21T16:27:48Z",
"user_mtime": "2019-05-21T16:27:48Z",
"jsonmodel_type": "sub_container",
"top_container": {
"ref": "/repositories/2/top_containers/18853"
}
}
}
],
"notes": [

],
"accession_links": [

],
"uri": "/repositories/2/archival_objects/187541",
"repository": {
"ref": "/repositories/2"
},
"resource": {
"ref": "/repositories/2/resources/5189"
},
"parent": {
"ref": "/repositories/2/archival_objects/181601"
},
"has_unpublished_ancestor": false
}
Loading