Skip to main content
Warning This document has not been updated for a while now. It may be out of date.
Last updated: 8 Nov 2021

govuk-wuj-network-analysis: `govuk-wuj-network-analysis` structure

This page provides information on the repository's structure. The repository's folder structure is explained here:

:maxdepth: 2

Top-level files

Each subsection here contains a brief description about the files at the top-level of this Git repository.


A file containing environment variables for the Git repository that can be selectively loaded. .envrc uses the direnv shell extension to load these environment variables.

This file contains a sed command to output a .env file with all the environment variables. This may be useful for sourcing environment variables, for example in conjunction with PyCharm's EnvFile plugin.

To ensure this sed command works correctly, make sure any file paths listed in this file are absolute file paths (recommended). Relative file paths using other environment variables only work for Python users. Environment variable names can only contain letters, numbers or underscores as well. For example:

export DIR_DATA=$(pwd)/data                    # fine for Python and R users
export DIR_DATA_EXTERNAL=$(pwd)/data/external  # fine for Python and R users
export DIR_DATA_EXTERNAL=./data/external       # fine for Python and R users
export DIR_DATA_EXTERNAL=$DIR_DATA/external    # fine for Python users only
export DIR-DATA-EXTERNAL=$DIR_DATA/external    # will break the `sed` command!


A configuration file for the flake8 Python package that provides linting. This file is based on the common configuration described in the GDS Way.


A .gitignore file to ignore certain files and folders from this Git repository. See the contributor guide to modift the .gitignore file.


A pre-commit hook configuration file.


A file to store all secrets and credentials as environment variables. This file is read-in by .envrc, when loading environment variables with the direnv shell extension, but is not tracked by Git.


Baseline file for the detect-secrets to detect secrets. In conjunction with pre-commit, detect-secrets prevents secrets from being committed to the repository. The baseline file flags secret-like data that the user deliberately wishes to commit the to repository.

The Code of Conduct for contributors to this project, including maintainers and alphagov organisation owners.

File to contain shared fixture functions for the pytest tests in the tests folder.

The contributing guidelines for this project.


The licence for this project. Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation. The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.


The Makefile contains a set of commands for the make utility. Run the help command for further information at the top-level of the Git repository.

make help


A file containing Python project settings. This includes configuration settings for:


Python imports are arranged according to the specification defined by black.


To run the tests within the tests folder using the pytest Python package, enter the following command:


Code coverage

To run code coverage using the coverage Python package with pytest, enter the following command:

coverage run -m pytest
coverage html

or using the make command:

make coverage_html

A code coverage report in HTML will be produced on the code in the src folder. This HTML report can be accessed at htmlcov/index.html.

An overview of the Git repository, including all necessary instructions to run the code.


A list of Python package requirements for this Git repository, which can be installed using the pip install command.

pip install --requirement requirements.txt

Alternatively, to install the requirements file along with pre-commit hooks, run the following command:

make requirements