Text and image analysis of the digital collection (books, newspapers, periodicals, and images) at the National Library of Norway
Project description
DHLAB
dhlab
is a python library for doing qualitative and quantitative analyses of the digital texts from nettbiblioteket (eng: "the online library") at the National Library of Norway (NLN). Nettbiblioteket is the NLN's digital collection of media publications.
Check out our documentation for more info.
Installation with pip
Install the latest version of dhlab
in your (Unix) terminal with pip:
pip install -U dhlab
Install dhlab from github repo
Open you terminal in the file location you will work with DHLAB.
git clone https://github.com/NationalLibraryOfNorway/DHLAB.git
cd DHLAB
pip install -U -e .
For developers
Dependency management
We use poetry to manage dependencies.
-
Activate a virtual environment:
poetry shell
-
Install the project dependencies (including extra dependencies for building documentation, running the test suite, and linting/reformatting the code):
poetry install --all-extras
-
Update dependency versions (see poetry docs for more on dependency management):
poetry update
NB! Please commit the poetry.lock
and pyproject.toml
files if any dependencies got updated.
Run test suite
pytest tests
Reformat code
isort dhlab # Sort imports
black dhlab # Reformat code style according to pep8
Build documentation
cd docs
make html
View the pages in a browser:
open _build/html/index.html
Create new release
Use poetry to generate the new annotated version tag, and push the tag:
export VERSION_TAG=$(poetry version --short)
git tag -a -m "Release version $VERSION_TAG" $VERSION_TAG # Annotate the tag
git push --follow-tags # Push commits + tags
Contact
The code here is developed and maintained by The Digital Humanities lab group.
If you have any questions, or run into any problems with the code, please log them in our issue tracker.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.