Skip to main content

Django Name Build Status Docs Status PyPI Version

Python Implementation of NACO Normalization Rules

The Name App is a tool originally developed for documenting names used by the UNT Libraries in its various digital library systems and collections. The app provides a consistent way of communicating the authorized version of a name and information about the name that is useful for reuse. The Name App generates a unique URL for each name that can be used to unambiguously refer to a person, organization, event, building or piece of software. In addition to an HTML page for each name there are a number of other formats available for each record including a MADS XML version and a simple JSON representation. A key feature of the UNT Name App is the ability to link to other vocabularies such as the Virtual International Authority File (VIAF), the Library of Congress Name Authority File, or Wikipedia.


Installation

For installation instructions, see the Installation page in the docs.

License

See LICENSE.

Acknowledgements

django-name was developed at the UNT Libraries.

Contributors:

Requirements

  • Python 3.9 or later

Development

There are three ways to set up this environment locally.

Docker

Install Docker. Instructions differ based on installation method.

Clone the repository.

$ git clone https://github.com/unt-libraries/django-name.git
$ cd django-name

Warm up the Mariadb database. This only needs to be done when the database container doesn't exist yet. This will take about a minute once the image has been pulled.

$ docker compose up -d mariadb

Start the app and run the migrations.

# start the app
$ docker compose up -d

# run the migrations
$ docker compose run --rm web ./manage.py migrate

# optional: add a superuser in order to login to the admin interface
$ docker compose run --rm web ./manage.py createsuperuser

At this point you should be able to access your local instance of the site by visiting <dockerhost>:8000/name/

The code is in a volume that is shared between your workstation and the web container, which means any edits you make on your workstation will also be reflected in the Docker container. No need to rebuild the container to pick up changes in the code.

However, if the requirements files change, it is important that you rebuild the web container for those packages to be installed. This is something that could happen when switching between feature branches, or when pulling updates from the remote.

# stop the app
$ docker compose stop

# remove the web container
$ docker compose rm web

# rebuild the web container
$ docker compose build web

# start the app
$ docker compose up -d

Developing with Podman and Podman-Compose

Install or Enable Podman.

Install Podman Compose.

$ sudo dnf install podman-compose

You will follow the same steps as above, starting with Clone the repository. For all of the docker steps, you will have to replace the word docker with podman.

If you have SELinux, you may need to temporarily add :Z to the web volumes in the docker-compose.yml. It will look like .:/app/:Z. You may also need to use sudo for your podman-compose commands.

Traditional Setup

Clone the repository.

$ git clone https://github.com/unt-libraries/django-name.git
$ cd django-name

Install the mysql development package. The command depends on your system:

# Red Hat
sudo dnf install mysql-devel

# Ubuntu / Windows (WSL)
sudo apt install libmysqlclient-dev

# macOS via Homebrew
brew install mysql-client

Create a virtual environment and activate it

$ python -m venv env
$ source env/bin/activate

Install the dev dependencies

$ pip install .'[dev,test,codestyle]'

Replace the DATABASES Django setting in ./tests/settings/dev.py with

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': './db.sqlite3', 
    }
}

Add table data

$ python manage.py migrate

Start dev instance

$ python manage.py runserver

The app should be available at http://localhost:8000/name/

Running the Tests

NOTE: tests will not pass without the mariadb and postgres databases available.

To run the tests via Tox, use this command. If you are using podman-compose, swap the word docker with podman for the commands below.

$ docker compose run --rm web tox

Release files for django-name 5.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-name 5.0.0
File Size Uploaded
django_name-5.0.0.tar.gz 55.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-name 5.0.0
File Interpreter ABI Platform
django_name-5.0.0-py3-none-any.whl Python 3 none any Details

Total release size:113.2 kB

Release files / django_name-5.0.0.tar.gz

Download URL django_name-5.0.0.tar.gz
Size 55.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d74f47d4f7a720b3652ecbe63d7a458351f9dd5791be3a9b98afa564b127e770
BLAKE2b-256 checksum
How to use checksums
d3fa9d0f5ac66fb13469070973c520783140a1e3e79423891af56b8774440441
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / django_name-5.0.0-py3-none-any.whl

Download URL django_name-5.0.0-py3-none-any.whl
Size 58.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5346fe95fa78d214c80cfed33862eefa40938b2eba9044ab6b57da8e27498d4
BLAKE2b-256 checksum
How to use checksums
78d37b3277471815d75477c1ca2f657ec58decebc3e7b7035ec3eb003a89b0de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

5.0.0 This release

2 release files

2.0.0

2 release files

1.1.1

1 release file

1.1.0

1 release file

1.0.1

2 release files

1.0.0

1 release file

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