Skip to main content

A Django-based registry for the neurobank system

Project description

ProjectStatus Version BuildStatus License PythonVersions

This is a Django application that provides name resolution services to neurobank* using an HTTP API.

The data management strategy behind neurobank is simple: every resource gets a unique identifier. As long as you use the correct identifier, you can unambiguously locate the resource. Resources include sources, which are used to control an experiment, and data, which result from running the experiment. Identifiers can be pretty much anything that’s encodable in a URL and isn’t too long. You can use manually-assigned identifiers like st32_1_2_1 or let the API generate short, memorable codes like heengei8

To use this strategy, you need to be able to do two things: register each resource you create somewhere, and then resolve resource names to locations so that you can access your data. Being able to attach searchable metadata to your resources is pretty handy, too. This software provides a backend for these tasks. You’ll also need neurobank or some other client software to take care of storing your files.

This software is licensed for you to use under the BSD License. See COPYING for details.

Quick start

  1. Requires Python 3.10+. Runs on Django 4.2 LTS and 5.1.

  2. Install the package: pip install django-neurobank

  3. Add neurobank to your INSTALLED_APPS setting like this:

INSTALLED_APPS = (
    ...
    'rest_framework',
    'django_filters',
    'nbank_registry',
)

neurobank uses django-sendfile2 to efficiently serve large files, you will need to set settings.SENDFILE_BACKEND and possibly other keys, depending on which reverse proxy you are using. Consult the documentation for django-sendfile2 for details.

  1. Include the neurobank URLconf in your project urls.py like this:

url(r'^neurobank/', include(nbank_registry.urls')),
  1. Run python manage.py migrate to create the database tables.

  2. Start the development server and point your browser to http://127.0.0.1:8000/neurobank/ to view records and inspect the API.

Using the registry

Documentation is still in progress. We need a list of endpoints and supported verbs. However, the interface can be accessed through a browser.

Deleting is not supported in the HTTP API. A fundamental concept behind a registry is that resources have unique identifiers, which are never re-used or changed. You can edit locations, metadata, and other attributes using PUT. If you desperately need to change a name or delete an identifier, you’ll have to use the Django database admin or directly access the backing database.

This application is still under development, and you should probably only allow access from trusted networks. Authentication is required to modify or add resources, archives, or data types. Authentication uses the django user app, and credentials are sent in plain text. Your site should only be deployed as a reverse proxy behind an encrpyting https-enabled web server like nginx.

Development

Recommend using uv for development.

Run uv sync to create a virtual environment and install dependencies. uv sync --no-dev --frozen for deployment.

Testing: uv run pytest. Requires a test database, will use settings from inventory/test/settings.py.

Project details


Download files

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

Source Distribution

django_neurobank-0.10.12.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

django_neurobank-0.10.12-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file django_neurobank-0.10.12.tar.gz.

File metadata

  • Download URL: django_neurobank-0.10.12.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for django_neurobank-0.10.12.tar.gz
Algorithm Hash digest
SHA256 baa8a85fe57d28eb5fd8085092e5de8c2561913a03b1e8d8ccb54123250689bf
MD5 55633d40ab39679d10ba66071f220dc1
BLAKE2b-256 102305716860239becf70ac1d5e15749946ca65bea5599e7b7061d5693af4d0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_neurobank-0.10.12.tar.gz:

Publisher: publish-to-pypi.yml on melizalab/django-neurobank

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

File details

Details for the file django_neurobank-0.10.12-py3-none-any.whl.

File metadata

File hashes

Hashes for django_neurobank-0.10.12-py3-none-any.whl
Algorithm Hash digest
SHA256 7501241a1f4ceca3fa4978807af02858456cc1937fd9754f3de4cde2f297f886
MD5 0314e38c08f9f8c3398acb6d1feaead7
BLAKE2b-256 50a2df85dcd6829cd492d97d394423c3e9ce37a700037c14f6d927de4bf4a11e

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_neurobank-0.10.12-py3-none-any.whl:

Publisher: publish-to-pypi.yml on melizalab/django-neurobank

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page