ArchivesSpace JSONModel Converter
Installation
Navigate to the top level of this repository, and run:
pip install -e .
After installation, the tool should be available as ajc, running ajc will emit a help page describing any extant subcommands.
Configuration
AJC is configured via a YAML file. Some values are hardcoded as defaults and can be omitted - currently, this is limited to an asnake_config key containing values for the default admin account of a local ASpace instance.
By default, AJC looks for a .archivesspace_jsonmodel_converter.yml in the user's home directory. A different file location can be specified via the AJC_CONFIG_FILE variable, or by providing a path to the ajc commend via the --config-file option.
Conversion of Access DB to postgresql DB
For various reasons, it's more convenient to move the data from access to another data format before trying to convert it to ASpace JSONModel objects. For this example, we will convert the data to a postgresql-compatible SQL file. Additionally, we will deal with some issues specific to the Fort Lewis DB but that will commonly occur when converting data from MDB format.
Tools
The tools we'll be using are:
- mdbtools - a set of command line tools for accessing and working with Access DBs
- a Linux shell with mdbtools installed
- psql
- a text editor of the user's choice
Process
Step 1
First, we need to create an SQL script that represents the access DB's schema. We do this with the following commend:
mdb-schema my_access_file.mdb postgres > my_postgres_schema.sql
Step 2
Next, we need to add insert statements for all the tables in the schema. This can be done via a shell loop, thusly:
for name in `mdb-tables my_access_file.mdb`; do mdb-export -I postgres my_access_file.mdb $name >> my_postgres_schema.sql; done
At this point, we have a schema with all tables, constraints, and data from the Access db - if we're very lucky, this might just import cleanly into postgres at this point.
Step 3
Assuming postgres is already set up and the user account you're logged in as can create databases:
createdb my_access_db
psql my_access_db < my_postgres_schema.sql &> psql_import_output.txt
After this completes, check the input - there's a good chance you'll see some errors - Postgres (and MySQL, and most things for that matter) are more strict about foreign keys and indexes than Access, and don't let you do things like embed a whole word document as a column value. If there are errors, open the SQL file in a text editor that supports large files, correct the errors or drop the overly strict indexes, and then drop and recreate the table and run Step 3 again. When it runs without errors, you've successfully migrated the data.
Metadata
Release files for archivesspace-jsonmodel-converter 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| archivesspace_jsonmodel_converter-0.0.1.tar.gz | 10.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| archivesspace_jsonmodel_converter-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.2 kB
Release files / archivesspace_jsonmodel_converter-0.0.1.tar.gz
| Download URL | archivesspace_jsonmodel_converter-0.0.1.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7f6b599236f83e11e7ca29a6a93dd30c1a9ee666199279e255186d1e97e411b
|
|
BLAKE2b-256 checksum How to use checksums |
bec608e663a00f646e0c09800942a1cf107e215091dabe3e686239426f9fc9e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.16
|
Release files / archivesspace_jsonmodel_converter-0.0.1-py3-none-any.whl
| Download URL | archivesspace_jsonmodel_converter-0.0.1-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6b4ded184dd69fd4cf8f94c2542f53939acb3ae76eb75372a8d7bf0abc264e7
|
|
BLAKE2b-256 checksum How to use checksums |
300e24013fa0f59d9cb24cfc0a771345307c8165d88ea142a12b559f3fc01283
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.16
|
Security for archivesspace-jsonmodel-converter 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.