Metadata-Version: 2.1
Name: invenio-subjects-lcsh
Version: 2023.11.1
Summary: LCSH subject terms for InvenioRDM
Author-email: Northwestern University <DL_FSM_GDS@e.northwestern.edu>
License: MIT License
        
        Copyright (C) 2021 Northwestern University.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of
        this software and associated documentation files (the "Software"), to deal in
        the Software without restriction, including without limitation the rights to
        use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
        of the Software, and to permit persons to whom the Software is furnished to do
        so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/galterlibrary/invenio-subjects-lcsh
Keywords: invenio,inveniordm,subjects,LCSH
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: check-manifest >=0.49 ; extra == 'dev'
Requires-Dist: invoke <3.0,>=2.2 ; extra == 'dev'
Requires-Dist: galter-subjects-utils <2.0,>=0.2.0 ; extra == 'dev'
Requires-Dist: pyyaml >=5.4.1 ; extra == 'dev'
Requires-Dist: pytest >=7.2.0 ; extra == 'dev'
Requires-Dist: pytest-cov >=3.0.0 ; extra == 'dev'
Requires-Dist: pytest-isort >=3.0.0 ; extra == 'dev'
Requires-Dist: pytest-pycodestyle >=2.2.0 ; extra == 'dev'
Requires-Dist: pytest-pydocstyle >=2.2.3 ; extra == 'dev'

# invenio-subjects-lcsh

*LCSH subject terms for InvenioRDM*

Install this extension to get [Library of Congress Subject Headings](https://id.loc.gov/authorities/subjects.html) into your instance.

## Installation

From your instance directory:

```bash
pipenv install invenio-subjects-lcsh
```

This will add it to your Pipfile.

## Versions

This repository follows [calendar versioning](https://calver.org/) for year and month:

`2021.06.18` is both a valid semantic version and an indicator of the year-month corresponding to the loaded terms.
`18` here is a patch number (not a day).

So far the package is compatible with InvenioRDM 9.1+'s subjects "ABI". If there is a breaking change, a compatibility
table will be provided to indicate which version is compatible with with InvenioRDM's "ABI".

## Usage

There are 2 types of users for this package. Maintainers of the package and instance administrators.

### Instance administrators

For instance administrators, after you have installed the extension as per the steps above, you will want to reload your instance's fixtures: `pipenv run invenio rdm-records fixtures`. This will install the new terms in your instance.

Updating existing terms currently requires manual replacement.

### Maintainers

This package should probably be updated on a yearly basis. Here we show how.

0. Install this package locally with the `dev` extra:

```bash
pipenv run pip install -e .[dev]
```

1. Use the installed `galter-subjects-utils` tool to get the new list:

```bash
pipenv run galter-subjects-utils lcsh --output-file invenio_subjects_lcsh/vocabularies/subjects_lcsh.jsonl
```

   This will

   1. Download the new list(s)
   2. Read it filtering for topics
   3. Convert terms to InvenioRDM subjects format
   4. Write those to the specified file

2. Check the manifest (it should typically be all good)

```bash
pipenv run inv check-manifest
```

3. When you are happy with the list, bump the version and release it.

## Development

Install the project in editable mode with `dev` dependencies in an isolated virtualenv (`(venv)` denotes that going forward):

```bash
(venv) pip install -e .[dev]
# or if using pipenv
pipenv run pip install -e .[dev]
```

Run tests:

```bash
(venv) invoke test
# or shorter
(venv) inv test
# or if using pipenv
pipenv run inv test
```

Check manifest:

```bash
(venv) inv check-manifest
# or if using pipenv
pipenv run inv check-manifest
```

Clean out artefacts:

```bash
(venv) inv clean
# or if using pipenv
pipenv run inv clean
```
