Skip to main content

djehuty

This Python package provides the repository system for 4TU.ResearchData and Nikhef.

Security

To report a vulnerability, please see SECURITY.md.

Development environment

Prerequisites

Getting started

git clone https://github.com/4TUResearchData/djehuty.git
cd djehuty/

Running the development environment

To spin up a fully working local instance, run:

just dev

This builds and starts Docker containers for djehuty and Virtuoso (SPARQL store). On first run, the database is automatically initialized with categories, licences, and a dev account with full admin privileges — no extra setup needed.

Once running:

  • Djehuty: http://localhost:8080 (auto-login, no auth setup needed)
  • Virtuoso SPARQL: http://localhost:8890/sparql (useful for troubleshooting)

Edit any Python file under src/ and the server reloads automatically.

To start the development environment with a Virtuoso database backup (e.g. to test against specific production data):

just db_backup=path/to/prod-2025-10-09_#1.bp dev

Point db_backup at any one of the backup files. All siblings sharing the same prefix in that directory are applied in order, so a full backup plus its incrementals (e.g. prod-2025-10-09_#1.bp, …_#2.bp, …_#3.bp) are restored together.

To stop and remove the development environment, run just clean. To see all available commands, run just --list.

Running in production

Djehuty needs a SPARQL 1.1 endpoint such as Virtuoso OSE or Jena Fuseki to store its state.

Copy the example configuration and adjust it for your environment:

cp etc/djehuty/djehuty-example-config.xml djehuty.xml

JSON is also supported and recommended for new deployments (see djehuty-example-config.json); pass it the same way with --config-file djehuty.json.

First run

Upon first run, djehuty needs to initialize the database with categories, licences and accounts. To do so, pass the --initialize option to the djehuty web command:

djehuty web --initialize --config-file djehuty.xml

Subsequent runs

After the database has been initialized, you can remove the --initialize option:

djehuty web --config-file=djehuty.xml

Running the tests

The project includes an end-to-end test suite built with Playwright and pytest. Tests run against a live djehuty + Virtuoso stack seeded with test data — all in containers, so no host Python or browser setup is required.

just test

That single command builds the test image (with Playwright and chromium), brings up Virtuoso and djehuty, loads the SPARQL permissions, runs --initialize, applies the seed dataset, and runs the suite inside the docker network. Coverage data lands in docker/coverage/; failure screenshots in docker/test-results/.

Filter the run with any pytest argument:

just test -m smoke              # one marker
just test -k test_homepage      # by keyword
just test tests/test_auth.py    # specific file

Marker isolation

CI runs each marker (smoke, auth, dataset, admin, embargo, citation, versioning, …) in its own job with a fresh stack, so a test never sees data left over from another marker. just test runs everything against one shared stack, which is faster but means a few state-sensitive tests can fail locally that pass in CI. When that happens, run the affected marker on its own:

just clean   # drop volumes for a truly fresh stack
just test -m citation

CI

Tests run automatically on every push via GitHub Actions. Each runner in the matrix invokes just test -m <marker> against the same compose stack used locally, so a green just test on your laptop reproduces what CI sees. Screenshots are captured on failure and uploaded as artifacts; coverage from each shard is combined into a single report.

Linting

Code style is enforced with Ruff and rolled out incrementally: only paths that have already been cleaned are checked (in the include list under [tool.ruff] in pyproject.toml), starting with src/djehuty/utils/.

just lint

This runs ruff check (bugs, style errors, import sorting) and ruff format --check over the cleaned paths, using the Ruff version pinned in uv.lock . CI runs the same recipe on every push and pull request, so a clean just lint` locally means a green Lint job.

just format

It applies the auto format from ruff in the files


Contact information

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djehuty-26.5.tar.gz (4.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djehuty-26.5-py3-none-any.whl (3.8 MB view details)

Uploaded Python 3

File details

Details for the file djehuty-26.5.tar.gz.

File metadata

  • Download URL: djehuty-26.5.tar.gz
  • Upload date:
  • Size: 4.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for djehuty-26.5.tar.gz
Algorithm Hash digest
SHA256 57f11123087adda6968ac1b7588b2127433d8690135d709f7fcac0c8ee822242
MD5 04b3b09f5b79312da9b84001118855a5
BLAKE2b-256 5dfe58fec1ac22e446ac868946388becc01830cfe98a9eb8986c9f04f2576bc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for djehuty-26.5.tar.gz:

Publisher: release.yml on 4TUResearchData/djehuty

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djehuty-26.5-py3-none-any.whl.

File metadata

  • Download URL: djehuty-26.5-py3-none-any.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for djehuty-26.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8568d2b0b933b791be340064233ab66d2c73dafc0d86a7b458d1b710c8716ad0
MD5 2b137036bb409735e168fab898fa39ee
BLAKE2b-256 829724601d55ff8d67eb104d60fb9396af717d665e1072eac559da55e5fbe7cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for djehuty-26.5-py3-none-any.whl:

Publisher: release.yml on 4TUResearchData/djehuty

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

26.5 This release

2 files

26.4.1

2 files

26.4

2 files

26.3.3

2 files

26.3.2

2 files

26.3.1

2 files

26.3

2 files

26.2

2 files

26.1

2 files

25.6

2 files

25.5

2 files

25.4

2 files

25.3

2 files

25.2

2 files

25.1

2 files

24.12

2 files

24.11

2 files

24.10.1

2 files

24.10

2 files

24.9

2 files

24.8

2 files

24.7

2 files

24.6

2 files

24.5

2 files

24.4

2 files

24.3

2 files

24.2

2 files

24.1

2 files

0.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page