Skip to main content
Fair3R logo

ckanext-fair3r

CKAN License PyPI

The CKAN plugin behind fair3r.fr, a catalogue of research datasets (animal models, phenotyping). It adds the FDF (FAIR3R Dataset Form): a dynamic, ontology-driven metadata form built from a JSON schema. It turns those metadata into DataCite, DCAT-AP, Croissant and schema.org, and gives the site its theme and a few features around datasets.

For a ready-to-run FAIR3R stack with this plugin already wired up, see fair3r-docker-alt. The rest of this page is for adding the plugin to your own CKAN 2.12.

Features

  • FDF form: dataset creation and editing with a form generated from fdf_schema.json, which looks terms up in external databases (ORCID, ROR, ontologies, genes, alleles, strains) and is checked again on the server. The answers are stored on the dataset (fdf_output_json) with DataCite-shaped datacite.* extras derived from them. The API checks an fdf_output_json the same way, with errors giving the exact place and reason (details).
  • Completeness score on the dataset page and live in the form.
  • Metadata for other systems: DataCite DOI metadata through ckanext-doi, DCAT-AP, Croissant and schema.org through ckanext-dcat, a sitemap.
  • Publishing and downloading: a "Publish" button (private -> public, one way), "Download all" as one ZIP, a fix for a CKAN/xloader race that can turn a just-published dataset back to draft.
  • Resource form: several files at once with progress, duplicate-name warning, routing of large files to Zenodo with ckanext-zenodo.
  • Accounts and access: account sign-up (e-mail confirmation, then an administrator activates or rejects it at /ckan-admin/accounts; optional ORCID proof, which a user can also link or unlink from their profile; a request cannot log in, reset its password, or be seen in user lists and profiles until an administrator activates it; a sysadmin can softly delete an active account, export what is held about it as JSON, or erase its personal data (GDPR) at /ckan-admin/accounts; ckan fair3r purge-requests deletes the requests left unconfirmed; sysadmin accounts can be limited to given networks), members-only organization/group activity streams, HTML emails.
  • Legal pages: /legal-notice and /privacy (French and English, linked in the footer and from the account request and contact forms). The CNRS is named as data controller: the texts must be validated by its data protection officer.
  • Authors from your ORCID profile: a user who linked an ORCID iD gets a button at the top of an empty creator or contributor of the dataset form, which fills in the name type, the given and family name, the ORCID iD and the affiliation (the employer's ROR when ORCID has it, else its name in the ROR search) in one click (once per section: the button goes when the person is in it). The name is read once from the public ORCID record and kept with the link. Which fields it fills is declared by prefill_from_user in the FDF schema (3.1.8).
  • Theme of fair3r.fr, French translations.

The full specification is in docs/: architecture, the FDF schema, every workflow step by step, metadata mapping, security, configuration and operations.

Requirements

  • CKAN 2.12, with Redis and the background worker (ckan jobs worker) running: they're used to fix the draft race and to limit account requests.

  • ckanext-doi, FAIR3R's fork, published on PyPI as ckanext-fair3r-doi (the ckanext-doi package on PyPI is a different one, the original). It must be installed, since this plugin uses its interface. Enabling it (and having a DataCite account) is only needed to mint DOIs.

  • Optional, each one adds something when enabled:

    Plugin Adds
    dcat, structured_data, croissant (ckanext-dcat) The FAIR3R RDF profiles
    activity (CKAN core) Members-only activity streams
    pages (ckanext-pages, PyPI: ckanext-fair3r-pages) Pages and Blog links in this plugin's header
    citations (ckanext-citations) The "FAIR & Impact" panel, with the completeness score
    zenodo (ckanext-zenodo) Large files on Zenodo, with a DOI
    contact (ckanext-contact) The contact page; its ckanext.contact.mail_to is where account requests go

Installation

  1. In CKAN's virtualenv:

    pip install ckanext-fair3r ckanext-fair3r-doi
    
  2. Enable the plugin in ckan.ini. The first-listed plugin's templates win, and this plugin's header replaces CKAN's: keep pages before fair3r, or the Pages and Blog links disappear.

    ckan.plugins = ... dcat structured_data croissant pages fair3r doi citations ...
    
  3. Optional, for the FAIR3R RDF output (with ckanext-dcat):

    ckanext.dcat.rdf.profiles = fair3r_dcat_ap
    ckanext.dcat.croissant.profiles = fair3r_croissant
    ckanext.dcat.structured_data.profiles = fair3r_schemaorg
    
  4. Fetch the FDF schema, then keep it up to date daily, as the CKAN user (cron). The package doesn't include it: until the first update-schema, the FDF form is empty.

    ckan -c /path/to/ckan.ini fair3r update-schema
    
    0 0 * * * /path/to/venv/bin/ckan -c /path/to/ckan.ini fair3r update-schema
    

    The CKAN user needs write access to the package's ckanext/fair3r/schema/ directory.

  5. Restart CKAN and its worker.

Configuration

Setting Default Meaning
ckanext.fair3r.context DEV DEV, INTEGRATION, VALIDATION or PRODUCTION. Shown as a badge in the header (except in production). PRODUCTION: /dataset/new opens the FDF form directly, without the choice page.
ckanext.fair3r.enable_fdf_integration true false: /dataset/new opens CKAN's standard form.
ckanext.fair3r.fdf_schema_dir (the package's schema/ directory) A directory with fdf_schema.json and i18n/*.json, used instead of the one update-schema downloads (for working on the schema locally); also read from CKANEXT_FAIR3R_FDF_SCHEMA_DIR.
ckanext.contact.mail_to smtp.mail_from Who is told that an account request waits for a decision.
ckanext.fair3r.docs_url https://phen-ics.github.io/fair3r-fdf-schema/ Address of the documentation, linked from the About page and the footer. Empty or not a web address: the default.
ckanext.fair3r.admin_networks empty Comma-separated networks (CIDR, e.g. 10.0.0.0/8, 192.168.0.0/16) the sysadmin accounts can be used from. A sysadmin session or API token from elsewhere gets a 403; regular users, anonymous visitors and the ckan command line are not affected, loopback is always allowed. Empty: no restriction. Needs ckanext.fair3r.proxies to be right.
ckanext.fair3r.proxies 0 How many reverse proxies add their address to X-Forwarded-For in front of CKAN (a load balancer and nginx: 2; nginx alone: 1). The limit on account requests is per visitor, and the visitor is that many entries from the right of the header. A wrong value makes every visitor look like a proxy (the load balancer, say): the per-visitor limits (account requests, contact form) are then shared by everybody, and ckanext.fair3r.admin_networks cannot tell who is who.
ckanext.fair3r.contact_antispam true Anti-spam in front of the contact form: a trap field, a minimum time between opening and sending the form, 5 messages per hour and per visitor, and an ALTCHA proof of work (self-hosted widget, no outside service). false switches it off.
ckanext.fair3r.require_institutional_email true Refuse personal addresses (Gmail, Yahoo, disposable...) in account requests.
ckanext.fair3r.orcid_client_id, ckanext.fair3r.orcid_client_secret (unset) An ORCID public API client (redirect URI <site>/account/orcid/callback). Set both to offer "Sign in with ORCID" on the account request form: it proves the ORCID iD and fills in name, public e-mail and affiliation.
ckanext.fair3r.orcid_domain orcid.org sandbox.orcid.org with a sandbox ORCID client.

More in docs/operations.md, with troubleshooting.

Commands

Command Use
ckan fair3r update-schema Download the latest fdf_schema.json and its French translations from GitHub into the package (daily cron). Does nothing when fdf_schema_dir points to a local clone.

Development

git clone https://github.com/Phen-ICS/ckanext-fair3r.git
cd ckanext-fair3r
pip install -e .
pip install -r dev-requirements.txt

Code style, checked in CI (ruff 0.16.0):

ruff format ckanext
ruff check ckanext --fix

Tests

docker exec -u ckan -it ckan-app pytest --ckan-ini=/plugins/ckanext-fair3r/test.ini /plugins/ckanext-fair3r/ckanext/fair3r/tests

Always pass --ckan-ini: the test fixtures empty the database they run against, and refuse to run unless its name contains test. The test.ini at the repository root is for the DEV container; ckanext/fair3r/tests/test.ini, shipped in the package, is the one the integration server uses - keep their plugin lists in sync.

Translations

English source strings, French catalogue in ckanext/fair3r/i18n/fr/: see docs/operations.md for the extract / update / compile steps.

License

Released under the GNU Affero General Public License (AGPL) v3.0. See the file LICENSE for details.

Metadata

Release files for ckanext-fair3r 3.1.83

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

Source distribution (sdist)

Source distribution for ckanext-fair3r 3.1.83
File Size Uploaded Provenance Actions
ckanext_fair3r-3.1.83.tar.gz 759.9 kB Without provenance Details for ckanext_fair3r-3.1.83.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ckanext-fair3r 3.1.83
File Interpreter ABI Platform Actions
ckanext_fair3r-3.1.83-py3-none-any.whl Python 3 none any Details for ckanext_fair3r-3.1.83-py3-none-any.whl

Total release size: 1.6 MB

Release files / ckanext_fair3r-3.1.83.tar.gz

Download URL ckanext_fair3r-3.1.83.tar.gz
Size 759.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4d6008b4ec60196e063c472d451bafaa1ca27e906a2cb9d98f5014a7a6d96151
BLAKE2b-256 checksum
How to use checksums
b93d7c800060abc7fcc6f7a6b6aaf817cf1aace62b5f7761a11cd571550cbcad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / ckanext_fair3r-3.1.83-py3-none-any.whl

Download URL ckanext_fair3r-3.1.83-py3-none-any.whl
Size 825.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1dcb8996c560030919d0e0861078b9af58a5fbf4cd3b2d1a26ff94824c13058b
BLAKE2b-256 checksum
How to use checksums
7b0c9674a9ca841046c061e5c5061a79ef21556eb15eb4ed61a7ad317b29f1a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for ckanext-fair3r 3.1.83

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.1.83 This release

2 release files No provenance

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