Skip to contents

The “API” is a simple based plain text website based on json files. These json files can be retrieved via GET requests and as such behave much like an API.

The root

Patterns

patterns.json contains the regex patterns used to match the SystemRequirements field in a DESCRIPTION file to the correct system requirement. It looks like

{
    "apparmor": [
        "\\bapparmor\\b",
        "\\blibapparmor\\b"
    ],
    "atk": [
        "\\batk\\b"
    ]
...
..
. 

Systems

systems.json enumerates the supported operating systems.

    {
        "os": [
            "linux"
        ],
        "distribution": [
            "ubuntu"
        ],
        "versions": [
            ["14.04"],
            ["16.04"],
            ["18.04"],
            ["20.04"]
        ]
    }
...
..
.


Packages & System Requirement Rules

The two other paths are /pkgs and /rules.

  • /pkgs
    • contains the package name, recorded version, and system requirements as recorded in the DESCRIPTION for all packages in the CRAN package database that have system requirements.
    • it is formatted like /pkgs/{pkg-name}.json
  • /rules
    • contains system library regex matching patterns and operating system constraints–e.g. system dependencies and recommended pre & post installation steps.
    • it is formatted like /pkgs/{sys-lib-name}.json.

Example package json file

[{"Package":"dbscan","Version":"1.1-10","SystemRequirements":"C++11"}]

Example rules json file

{
  "patterns": ["\\bhdf5\\b", "\\blibhdf5\\b"],
  "dependencies": [
    {
      "packages": ["libhdf5-dev"],
      "constraints": [
        {
          "os": "linux",
          "distribution": "ubuntu"
        },
        {
          "os": "linux",
          "distribution": "debian"
        }
      ]
    },
    {
      "packages": ["hdf5-devel"],
      "pre_install": [
        {
          "command": "yum install -y epel-release"
        }
      ],
      "constraints": [
        {
          "os": "linux",
          "distribution": "centos",
          "versions": ["6", "7"]
        }
      ]
    },
    {
      "packages": ["hdf5-devel"],
      "pre_install": [
        {
          "command": "dnf install -y epel-release"
        }
      ],
      "constraints": [
        {
          "os": "linux",
          "distribution": "centos",
          "versions": ["8"]
        }
      ]
    },
    {
      "packages": ["hdf5-devel"],
      "pre_install": [
        {
          "command": "rpm -q epel-release || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm"
        }
      ],
      "constraints": [
        {
          "os": "linux",
          "distribution": "redhat",
          "versions": ["6"]
        }
      ]
    },
    {
      "packages": ["hdf5-devel"],
      "pre_install": [
        {
          "command": "rpm -q epel-release || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
        }
      ],
      "constraints": [
        {
          "os": "linux",
          "distribution": "redhat",
          "versions": ["7"]
        }
      ]
    },
    {
      "packages": ["hdf5-devel"],
      "pre_install": [
        {
          "command": "dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm"
        }
      ],
      "constraints": [
        {
          "os": "linux",
          "distribution": "redhat",
          "versions": ["8"]
        }
      ]
    },
    {
      "packages": ["hdf5-devel"],
      "constraints": [
        {
          "os": "linux",
          "distribution": "opensuse"
        },
        {
          "os": "linux",
          "distribution": "sle",
          "versions": ["12.3"]
        }
      ]
    },
    {
      "packages": [
        "mingw-w64-x86_64-hdf5",
        "mingw-w64-i686-hdf5"
      ],
      "constraints": [
        {
          "os": "windows"
        }
      ]
    }
  ]
}