NLPMed Portal Lite
A lightweight, self-hosted research platform for clinical natural language processing and annotation workflows.
⚠️ Important: NLPMed Portal Lite is research software. It has not been designed, validated, or approved for diagnosis, treatment, or other clinical decision-making.
Features
- Clinical project, patient, note, and label management
- Patient-level, note-level, and named-entity annotation
- Annotation assignment, adjudication, history, import, and export workflows
- NLP preprocessing and model-inference integration
- Role-based access, project membership, auditing, and user management
- REST API with an OpenAPI schema and interactive API documentation
- PostgreSQL and SQL Server database support
- Installable command-line application
NLPMed Portal Lite preserves the annotation and portal functionality of the Full edition while removing:
- LLM functionality and its dependencies
- Celery workers
- Redis
- Flower
- Distributed caching
- The Docker production stack
Background operations are executed synchronously. This makes the Lite edition suitable for one or a few users and for environments where external services cannot be installed.
Optional NLP backend
External NLP preprocessing and model inference can be provided by NLPMed Engine, which is also available from PyPI.
The Portal and Engine are deployed separately. Set DJANGO_NLP_API_URL to
the Engine endpoint when enabling these features. Engine installation,
model configuration, and sentence-segmentation requirements are documented
in the NLPMed Engine repository.
Requirements
- Python 3.12, 3.13, or 3.14
- An existing PostgreSQL or SQL Server database
- The appropriate database driver
SQLite is not supported because the application relies on transactional and concurrent-write behavior intended for a server database.
Installation
Choose the extra for the database backend you intend to use.
PostgreSQL
Install the application and PostgreSQL driver with uv:
uv tool install "nlpmed-portal-lite[postgres]"
Alternatively, install it inside an existing virtual environment:
python -m pip install "nlpmed-portal-lite[postgres]"
SQL Server
First install Microsoft ODBC Driver 18 for SQL Server using the instructions for your operating system.
Then install the application and SQL Server dependencies:
uv tool install "nlpmed-portal-lite[sqlserver]"
Alternatively:
python -m pip install "nlpmed-portal-lite[sqlserver]"
The SQL Server backend is tested against SQL Server 2025.
Initial setup
Create a directory for the local configuration and runtime data:
mkdir nlpmed-portal-lite
cd nlpmed-portal-lite
Create the environment file:
nlpmed-portal-lite init
This creates .env without overwriting an existing configuration.
Edit .env and configure the application secret, database connection, allowed
hosts, CSRF origins, and registration behavior.
The database itself must already exist, and the configured database user must have permission to create and modify its tables and indexes.
PostgreSQL configuration
Use a PostgreSQL URL:
DJANGO_SECRET_KEY=replace-with-a-long-random-secret-key
DATABASE_URL=postgresql://nlpmed_portal:replace-with-a-database-password@127.0.0.1:5432/nlpmed_portal
DB_POOL=False
DB_ATOMIC_REQUESTS=True
SQL Server configuration
Leave DATABASE_URL empty and configure the SQL Server connection:
DJANGO_SECRET_KEY=replace-with-a-long-random-secret-key
DATABASE_URL=
DB_ENGINE=mssql
DB_NAME=nlpmed_portal
DB_HOST=127.0.0.1
DB_PORT=1433
DB_USER=sa
DB_PASSWORD=replace-with-a-database-password
DB_POOL=False
DB_ATOMIC_REQUESTS=True
MSSQL_DRIVER=ODBC Driver 18 for SQL Server
MSSQL_EXTRA_PARAMS=Encrypt=yes;TrustServerCertificate=yes
For a production database, review the encryption and certificate options instead of automatically trusting the server certificate.
Running the application
Apply migrations and prepare the static assets:
nlpmed-portal-lite setup
This command:
- Applies the existing Django migrations.
- Collects static files.
- Builds the compressed static assets.
Create the initial administrator:
nlpmed-portal-lite manage createsuperuser
Start the application:
nlpmed-portal-lite run
The application will be available at http://127.0.0.1:9090.
The default server configuration is:
- Host:
127.0.0.1 - Port:
9090 - Workers:
2
These values can be changed:
nlpmed-portal-lite run --host 127.0.0.1 --port 9090 --workers 2
Application home
By default, NLPMed Portal Lite uses the current directory as its application home. This directory stores:
.envstaticfiles/, created bysetupmedia/, created when uploaded or generated files are first stored
A different directory can be selected with --home:
nlpmed-portal-lite --home /path/to/nlpmed-home init
nlpmed-portal-lite --home /path/to/nlpmed-home setup
nlpmed-portal-lite --home /path/to/nlpmed-home manage createsuperuser
nlpmed-portal-lite --home /path/to/nlpmed-home run
The global --home option must appear before the command.
The same directory can instead be selected with the
NLPMED_PORTAL_HOME environment variable.
Django management commands
Use the manage command to run any Django management command:
nlpmed-portal-lite manage check
nlpmed-portal-lite manage migrate
nlpmed-portal-lite manage createsuperuser
nlpmed-portal-lite manage shell
Network access and HTTPS
The application binds to 127.0.0.1 by default and is not exposed to other
machines.
If it must be accessed over a network:
- Place it behind a properly configured HTTPS reverse proxy.
- Set
DJANGO_ALLOWED_HOSTS. - Set
DJANGO_CSRF_TRUSTED_ORIGINS. - Set
DJANGO_ACCOUNT_ALLOW_REGISTRATION=Falseunless public registration is explicitly required. - Enable
DJANGO_SECURE_SSL_REDIRECTafter HTTPS forwarding is working. - Protect the database and application-home directories.
The Lite package does not install or configure a database server, TLS certificate, reverse proxy, or operating-system service.
Source development
Clone the repository and install the locked dependencies with the required database extra.
For PostgreSQL:
uv sync --locked --extra postgres
For SQL Server:
uv sync --locked --extra sqlserver
Create the source configuration:
cp .env.example .env
Edit .env, then apply migrations and start Django:
uv run python manage.py migrate
uv run python manage.py createsuperuser
uv run python manage.py runserver
The packaged CLI can also be exercised from the source checkout:
uv run nlpmed-portal-lite --version
uv run nlpmed-portal-lite init
Testing
Run the test suite using the database configured in .env:
uv run pytest
Run the test suite with coverage:
uv run coverage run -m pytest
uv run coverage report
Run all configured formatting, linting, and static checks:
uv run pre-commit run --all-files
SQL Server compatibility is also tested separately in CI against SQL Server 2025.
API documentation
When the application is running:
- API root:
/api/ - OpenAPI schema:
/api/schema/ - Interactive API documentation:
/api/docs/
The interactive API documentation is restricted according to the configured Django REST Framework permissions.
Sphinx documentation
Install the documentation dependencies and build the Python API reference:
uv sync --locked --no-dev --group docs
uv run --locked --no-dev --group docs sphinx-build \
-W \
--keep-going \
-b html \
docs \
docs/_build/html
Open docs/_build/html/index.html in a browser to inspect the generated
documentation.
The docs/api directory is generated automatically during the Sphinx build
and should not be edited manually.
Demo
A public demonstration of selected NLPMed Portal features is available at https://nlpmed.demo.angli-lab.com.
License and research-use notice
NLPMed Portal Lite is licensed under the GNU Affero General Public License v3.0 or later.
Important research-use and deployment considerations are described in the Research Use and Deployment Notice. This notice does not modify or add restrictions to the AGPL.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nlpmed_portal_lite-1.0.0.tar.gz.
File metadata
- Download URL: nlpmed_portal_lite-1.0.0.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3446b9088d8b5d11189f5b79d087526268080d63d5ba91ec45556f27905decf4
|
|
| MD5 |
0184c051309f78f8f985582465f84c36
|
|
| BLAKE2b-256 |
4d1cdd5c5542c82a7efe9619c1b9dde21a539ef90d2805341a42229d03125543
|
Provenance
The following attestation bundles were made for nlpmed_portal_lite-1.0.0.tar.gz:
Publisher:
publish-pypi.yml on omid-jf/NLPMed-Portal-Lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nlpmed_portal_lite-1.0.0.tar.gz -
Subject digest:
3446b9088d8b5d11189f5b79d087526268080d63d5ba91ec45556f27905decf4 - Sigstore transparency entry: 2279345754
- Sigstore integration time:
-
Permalink:
omid-jf/NLPMed-Portal-Lite@4d2ab3c4b0ccdf3a5e6f90e2b3bd68a064045e09 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/omid-jf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4d2ab3c4b0ccdf3a5e6f90e2b3bd68a064045e09 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nlpmed_portal_lite-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nlpmed_portal_lite-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fb501759cf34441c8b45808a7a7e6cc7e7f7f623a166ebb0fbcafbfc3f3c5cb
|
|
| MD5 |
d5f89042159ca9b5380598e48900c651
|
|
| BLAKE2b-256 |
5dcd19a9e2845f133050fa5f8496d7d4fb99f35bf094de5bc0714f627271ca24
|
Provenance
The following attestation bundles were made for nlpmed_portal_lite-1.0.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on omid-jf/NLPMed-Portal-Lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nlpmed_portal_lite-1.0.0-py3-none-any.whl -
Subject digest:
1fb501759cf34441c8b45808a7a7e6cc7e7f7f623a166ebb0fbcafbfc3f3c5cb - Sigstore transparency entry: 2279345786
- Sigstore integration time:
-
Permalink:
omid-jf/NLPMed-Portal-Lite@4d2ab3c4b0ccdf3a5e6f90e2b3bd68a064045e09 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/omid-jf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4d2ab3c4b0ccdf3a5e6f90e2b3bd68a064045e09 -
Trigger Event:
release
-
Statement type: