https://github.com/thoth-pub/thoth-loader
Metadata import from CSV into Thoth
https://github.com/thoth-pub/thoth-loader
Last synced: 5 months ago
JSON representation
Metadata import from CSV into Thoth
- Host: GitHub
- URL: https://github.com/thoth-pub/thoth-loader
- Owner: thoth-pub
- License: apache-2.0
- Created: 2020-02-25T12:21:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-11-28T15:05:32.000Z (6 months ago)
- Last Synced: 2025-11-30T21:08:03.265Z (6 months ago)
- Language: Python
- Size: 308 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/thoth-pub/thoth-loader/releases) [](https://github.com/thoth-pub/thoth-loader/blob/master/LICENSE)
# Thoth Loader
Read metadata from a CSV or MARC XML file and insert it into Thoth
## Config
Install dependencies:
```
pip install -r requirements.txt
```
## CLI Usage
Available modes, depending on publisher input: `OBP` (Open Book Publishers), `punctum` (punctum books), `AM` (African Minds), `UWP` (University of Westminster Press), `WHP` (The White Horse Press), `EDITUS` (Editus), `EDUEPB` (EDUEPB), `EDUFBA` (EDUFBA), `Rosario` (Editorial Universidad del Rosario), `Leuven` (Leuven University Press), `LHarmattan` (L'Harmattan), `MayFly` (MayFly Books), `PlayStory` (Play Story Press)
### Live Thoth API
```
./loader.py --file ./data/metadata.csv --mode ${mode} --email ${email} --password ${password}
```
### Local Thoth API
```
./loader.py --file ./data/metadata.csv --mode ${mode} --email ${email} --password ${password} --client-url http://localhost:8080/graphql
```
## Docker Usage
### Live Thoth API
```
docker run --rm \
-v /path/to/local/metadata.csv:/usr/src/app/metadata.csv \
openbookpublishers/thoth-loader \
./loader.py \
--file /usr/src/app/metadata.csv \
--mode ${mode} \
--email ${email} \
--password ${password}
```
### Local Thoth API
```
docker run --rm \
--network="host" \
--volume /tmp/metadata.csv:/usr/src/app/metadata.csv \
openbookpublishers/thoth-loader \
./loader.py \
--file /usr/src/app/metadata.csv \
--mode ${mode} \
--email ${email} \
--password ${password} \
--client-url http://127.0.0.1:8000
```
### Using the isbn_hyphenate library
Some loaders depend on the `isbn_hyphenate` python library to add hyphens to ISBNs. The library contains a list of valid ranges for data validation, but was last updated in 2015, and new ranges have been added since then. Some newer ISBNs will cause the Thoth function `sanitise_isbn()`, which depends on `isbn_hyphenate`, to raise an `IsbnUnableToHyphenateError` exception. In order to update the `isbn_hyphenate` prefix list, follow directions at (https://github.com/TorKlingberg/isbn_hyphenate).