Skip to content

inab/licenses-mapping

Repository files navigation

License Mapping API

License

Overview

A tool to map strings to SPDX licenses names or IDs.

📄 API Documentation

🐳 Docker image

Licenses Data

SPDX licenses metadata and synonyms are stored in the files of the licenses directory. The database is generated and updated from these files. The update is triggered by commmits being pushed to main branch.

🙌🏻 Contribution to licenses synonyms

To contribute to the licenses synonyms, please edit the files in the licenses directory and submit a pull request.

Webhooks

The API is configured to listen to the following webhooks:

  • update: update the database
  • ping: ping the server

CI - Database Update

The database is updated by the following GitLab CI workflow:

stages:
  - webhook

update:
  stage: webhook
  variables:
    DEPLOY_CURL_COMMAND: 'curl -H "Content-Type: application/json" --data @data.json https://gitlab.bsc.es/inb/elixir/software-observatory/license-mapping-api/webhooks'
  script:
    - 'eval "$DEPLOY_CURL_COMMAND"'
  rules:
    - changes:
      - licenses/*
      when: on_success

Development

Start the server with:

python3 -m uvicorn main:app --reload