Skip to content

Commit

Permalink
Merge pull request #18 from Living-with-machines/fix-for-lwmdb
Browse files Browse the repository at this point in the history
Initial refactor to ease further work/maintanance
  • Loading branch information
griff-rees authored Jul 4, 2023
2 parents ee98556 + 0898cab commit ef7ea88
Show file tree
Hide file tree
Showing 20 changed files with 2,246 additions and 555 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ main, fix-for-lwmdb ]
pull_request:
branches: [ main, fix-for-lwmdb ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and test environment
run: |
pip3 install poetry
poetry install --with dev
- name: pre-commit
run: |
# stop the build if it doesn't pass pre-commit
poetry run pre-commit install
poetry run pre-commit run --all-files
- name: Test with pytest
run: |
poetry run pytest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ _build
cache
input
output
poetry.lock
.coverage
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/python-poetry/poetry
rev: '1.5.1' # add version here
hooks:
- id: poetry-check
- id: poetry-lock
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# alto2txt2fixture

`alto2txt2fixture` is a standalone tool that converts our alto2txt metadata into JSON data with corresponding relational IDs and corrected data for easy ingestion into a relational database using, for example, Django.
`alto2txt2fixture` is a standalone tool that converts our `alto2txt` metadata into JSON data with corresponding relational IDs and corrected data for easy ingestion into a relational database using, for example, Django.

## Documentation

Expand All @@ -14,10 +14,10 @@ Install the dependencies:
$ poetry install
```

Run the tool:
Run the tool for processing newspaper metadata:

```sh
$ poetry run
$ poetry run a2t2f-news
```

In reality, you will need to mount the alto2txt files (or download them locally to your hard drive. The [documentation](docs) has details about how to do that.
In reality, you will need to mount the `alto2txt` files (or download them locally to your hard drive. The [documentation](docs) has details about how to do that.
Loading

0 comments on commit ef7ea88

Please sign in to comment.