Metadata-Version: 2.4
Name: invenio-pidbox
Version: 0.1.1
Summary: InvenioRDM PIDBox integration for people and organizations profile templates.
Project-URL: Homepage, https://codeberg.org/front-matter/invenio-pidbox
Project-URL: Repository, https://codeberg.org/front-matter/invenio-pidbox
Project-URL: Bug Tracker, https://codeberg.org/front-matter/invenio-pidbox/issues
License: MIT
License-File: LICENSE
Keywords: author,invenio,organization,pidbox,profiles
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.14
Requires-Dist: commonmeta-py[backend]>=0.269
Requires-Dist: commonmeta-rs>=0.9.72
Requires-Dist: invenio-app-rdm>=14.0.0
Provides-Extra: docs
Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == 'docs'
Requires-Dist: sphinx>=5.0.0; extra == 'docs'
Provides-Extra: tests
Requires-Dist: invenio-app>=1.4.0; extra == 'tests'
Requires-Dist: pytest-black>=0.3.0; extra == 'tests'
Requires-Dist: pytest-isort>=3.1.0; extra == 'tests'
Requires-Dist: pytest<9,>=7.4.0; extra == 'tests'
Description-Content-Type: text/markdown

# invenio-pidbox

InvenioRDM integration for people and organization profile templates backed by the commonmeta SQLite store.

## Features

- Ships people and organization profile templates for InvenioRDM
- Injects template context for /people/<orcid> and /organizations/<ror> routes
- Reads ORCID and ROR profiles from the commonmeta SQLite store via commonmeta-py and commonmeta-rs
- Uses the pid_annotations cache layer instead of application-specific people or organizations tables
- Mirrors the profile integration approach used in rogue-scholar

## Requirements

- Python 3.14+
- A commonmeta SQLite database readable through commonmeta-rs

The extension resolves profile data from the path configured in PIDBOX_SQLITE_PATH.
Internally, commonmeta-rs reads pid_annotations records with source_id 4 for people
(ORCID) and source_id 3 for organizations (ROR).

## Installation

```bash
uv add invenio-pidbox
```

This package depends on commonmeta-py, commonmeta-rs, and invenio-app-rdm at
runtime, so installing invenio-pidbox pulls in the profile backend automatically.

If the profile store lives outside the default commonmeta location, configure
PIDBOX_SQLITE_PATH in your Invenio application.

## How It Works

When a request path matches /people/<orcid> or /organizations/<ror>, the extension
loads the corresponding commonmeta record from SQLite and exposes template-friendly
objects such as person, organization, employment, identifiers, relations, location,
orcid, ror, and search_config.

The extension also registers default profile routes and a country_name template
filter so it can run against a standard invenio-app-rdm installation.

## Development

```bash
uv sync --extra tests
uv run pytest
```

## Entry points

| Group | Name | Value |
|---|---|---|
| `invenio_base.apps` | `invenio_pidbox` | `invenio_pidbox.ext:InvenioPidbox` |
| `invenio_base.api_apps` | `invenio_pidbox` | `invenio_pidbox.ext:InvenioPidbox` |

## License

MIT
