62eec5b
{
62eec5b
  "id": "http://www.python.org/dev/peps/pep-0426/",
62eec5b
  "$schema": "http://json-schema.org/draft-04/schema#",
62eec5b
  "title": "Metadata for Python Software Packages 2.0",
62eec5b
  "type": "object",
62eec5b
  "properties": {
62eec5b
    "metadata_version": {
62eec5b
      "description": "Version of the file format",
62eec5b
      "type": "string",
62eec5b
      "pattern": "^(\\d+(\\.\\d+)*)$"
62eec5b
    },
62eec5b
    "generator": {
62eec5b
      "description": "Name and version of the program that produced this file.",
62eec5b
      "type": "string",
62eec5b
      "pattern": "^[0-9A-Za-z]([0-9A-Za-z_.-]*[0-9A-Za-z])( \\(.*\\))?$"
62eec5b
    },
62eec5b
    "name": {
62eec5b
      "description": "The name of the distribution.",
62eec5b
      "type": "string",
62eec5b
      "$ref": "#/definitions/distribution_name"
62eec5b
    },
62eec5b
    "version": {
62eec5b
      "description": "The distribution's public version identifier",
62eec5b
      "type": "string",
62eec5b
      "pattern": "^(\\d+(\\.\\d+)*)((a|b|c|rc)(\\d+))?(\\.(post)(\\d+))?(\\.(dev)(\\d+))?$"
62eec5b
    },
62eec5b
    "source_label": {
62eec5b
      "description": "A constrained identifying text string",
62eec5b
      "type": "string",
62eec5b
      "pattern": "^[0-9a-z_.-+]+$"
62eec5b
    },
62eec5b
    "source_url": {
62eec5b
      "description": "A string containing a full URL where the source for this specific version of the distribution can be downloaded.",
62eec5b
      "type": "string",
62eec5b
      "format": "uri"
62eec5b
    },
62eec5b
    "summary": {
62eec5b
      "description": "A one-line summary of what the distribution does.",
62eec5b
      "type": "string"
62eec5b
    },
62eec5b
    "document_names": {
62eec5b
      "description": "Names of supporting metadata documents",
62eec5b
      "type": "object",
62eec5b
      "properties": {
62eec5b
        "description": {
62eec5b
          "type": "string",
62eec5b
          "$ref": "#/definitions/document_name"
62eec5b
        },
62eec5b
        "changelog": {
62eec5b
          "type": "string",
62eec5b
          "$ref": "#/definitions/document_name"
62eec5b
        },
62eec5b
        "license": {
62eec5b
          "type": "string",
62eec5b
          "$ref": "#/definitions/document_name"
62eec5b
        }
62eec5b
      },
62eec5b
      "additionalProperties": false
62eec5b
    },
62eec5b
    "keywords": {
62eec5b
      "description": "A list of additional keywords to be used to assist searching for the distribution in a larger catalog.",
62eec5b
      "type": "array",
62eec5b
      "items": {
62eec5b
        "type": "string"
62eec5b
      }
62eec5b
    },
62eec5b
    "license": {
62eec5b
      "description": "A string indicating the license covering the distribution.",
62eec5b
      "type": "string"
62eec5b
    },
62eec5b
    "classifiers": {
62eec5b
      "description": "A list of strings, with each giving a single classification value for the distribution.",
62eec5b
      "type": "array",
62eec5b
      "items": {
62eec5b
        "type": "string"
62eec5b
      }
62eec5b
    },
62eec5b
    "contacts": {
62eec5b
      "description": "A list of contributor entries giving the recommended contact points for getting more information about the project.",
62eec5b
      "type": "array",
62eec5b
      "items": {
62eec5b
        "type": "object",
62eec5b
        "$ref": "#/definitions/contact"
62eec5b
      }
62eec5b
    },
62eec5b
    "contributors": {
62eec5b
      "description": "A list of contributor entries for other contributors not already listed as current project points of contact.",
62eec5b
      "type": "array",
62eec5b
      "items": {
62eec5b
        "type": "object",
62eec5b
        "$ref": "#/definitions/contact"
62eec5b
      }
62eec5b
    },
62eec5b
    "project_urls": {
62eec5b
      "description": "A mapping of arbitrary text labels to additional URLs relevant to the project.",
62eec5b
      "type": "object"
62eec5b
    },
62eec5b
    "extras": {
62eec5b
      "description": "A list of optional sets of dependencies that may be used to define conditional dependencies in \"may_require\" and similar fields.",
62eec5b
      "type": "array",
62eec5b
      "items": {
62eec5b
        "type": "string",
62eec5b
        "$ref": "#/definitions/extra_name"
62eec5b
      }
62eec5b
    },
62eec5b
    "meta_requires": {
62eec5b
      "description": "A list of subdistributions made available through this metadistribution.",
62eec5b
      "type": "array",
62eec5b
      "$ref": "#/definitions/dependencies"
62eec5b
    },
62eec5b
    "run_requires": {
62eec5b
      "description": "A list of other distributions needed to run this distribution.",
62eec5b
      "type": "array",
62eec5b
      "$ref": "#/definitions/dependencies"
62eec5b
    },
62eec5b
    "test_requires": {
62eec5b
      "description": "A list of other distributions needed when this distribution is tested.",
62eec5b
      "type": "array",
62eec5b
      "$ref": "#/definitions/dependencies"
62eec5b
    },
62eec5b
    "build_requires": {
62eec5b
      "description": "A list of other distributions needed when this distribution is built.",
62eec5b
      "type": "array",
62eec5b
      "$ref": "#/definitions/dependencies"
62eec5b
    },
62eec5b
    "dev_requires": {
62eec5b
      "description": "A list of other distributions needed when this distribution is developed.",
62eec5b
      "type": "array",
62eec5b
      "$ref": "#/definitions/dependencies"
62eec5b
    },
62eec5b
    "provides": {
62eec5b
      "description": "A list of strings naming additional dependency requirements that are satisfied by installing this distribution. These strings must be of the form Name or Name (Version)",
62eec5b
      "type": "array",
62eec5b
      "items": {
62eec5b
        "type": "string",
62eec5b
        "$ref": "#/definitions/provides_declaration"
62eec5b
      }
62eec5b
    },
62eec5b
    "modules": {
62eec5b
      "description": "A list of modules and/or packages available for import after installing this distribution.",
62eec5b
      "type": "array",
62eec5b
      "items": {
62eec5b
        "type": "string",
62eec5b
        "$ref": "#/definitions/qualified_name"
62eec5b
      }
62eec5b
    },
62eec5b
    "namespaces": {
62eec5b
      "description": "A list of namespace packages this distribution contributes to",
62eec5b
      "type": "array",
62eec5b
      "items": {
62eec5b
        "type": "string",
62eec5b
        "$ref": "#/definitions/qualified_name"
62eec5b
      }
62eec5b
    },
62eec5b
    "commands": {
62eec5b
      "description": "Command line interfaces provided by this distribution",
62eec5b
      "type": "object",
62eec5b
      "$ref": "#/definitions/commands"
62eec5b
    },
62eec5b
    "exports": {
62eec5b
      "description": "Other exported interfaces provided by this distribution",
62eec5b
      "type": "object",
62eec5b
      "$ref": "#/definitions/exports"
62eec5b
    },
62eec5b
    "obsoleted_by": {
62eec5b
      "description": "A string that indicates that this project is no longer being developed. The named project provides a substitute or replacement.",
62eec5b
      "type": "string",
62eec5b
      "$ref": "#/definitions/requirement"
62eec5b
    },
62eec5b
    "supports_environments": {
62eec5b
      "description": "A list of strings specifying the environments that the distribution explicitly supports.",
62eec5b
      "type": "array",
62eec5b
      "items": {
62eec5b
        "type": "string",
62eec5b
        "$ref": "#/definitions/environment_marker"
62eec5b
      }
62eec5b
    },
62eec5b
    "install_hooks": {
62eec5b
      "description": "The install_hooks field is used to define various operations that may be invoked on a distribution in a platform independent manner.",
62eec5b
      "type": "object",
62eec5b
      "properties": {
62eec5b
        "postinstall": {
62eec5b
          "type": "string",
62eec5b
          "$ref": "#/definitions/export_specifier"
62eec5b
        },
62eec5b
        "preuninstall": {
62eec5b
          "type": "string",
62eec5b
          "$ref": "#/definitions/export_specifier"
62eec5b
        }
62eec5b
      }
62eec5b
    },
62eec5b
    "extensions": {
62eec5b
      "description": "Extensions to the metadata may be present in a mapping under the 'extensions' key.",
62eec5b
      "type": "object",
62eec5b
      "$ref": "#/definitions/extensions"
62eec5b
    }
62eec5b
  },
62eec5b
62eec5b
  "required": ["metadata_version", "name", "version", "summary"],
62eec5b
  "additionalProperties": false,
62eec5b
62eec5b
  "definitions": {
62eec5b
    "contact": {
62eec5b
      "type": "object",
62eec5b
      "properties": {
62eec5b
        "name": {
62eec5b
          "type": "string"
62eec5b
        },
62eec5b
        "email": {
62eec5b
          "type": "string"
62eec5b
        },
62eec5b
        "url": {
62eec5b
          "type": "string"
62eec5b
        },
62eec5b
        "role": {
62eec5b
          "type": "string"
62eec5b
        }
62eec5b
      },
62eec5b
      "required": ["name"],
62eec5b
      "additionalProperties": false
62eec5b
    },
62eec5b
    "dependencies": {
62eec5b
      "type": "array",
62eec5b
      "items": {
62eec5b
        "type": "object",
62eec5b
        "$ref": "#/definitions/dependency"
62eec5b
      }
62eec5b
    },
62eec5b
    "dependency": {
62eec5b
      "type": "object",
62eec5b
      "properties": {
62eec5b
        "extra": {
62eec5b
          "type": "string",
62eec5b
          "$ref": "#/definitions/extra_name"
62eec5b
        },
62eec5b
        "environment": {
62eec5b
          "type": "string",
62eec5b
          "$ref": "#/definitions/environment_marker"
62eec5b
        },
62eec5b
        "requires": {
62eec5b
          "type": "array",
62eec5b
          "items": {
62eec5b
            "type": "string",
62eec5b
            "$ref": "#/definitions/requirement"
62eec5b
          }
62eec5b
        }
62eec5b
      },
62eec5b
      "required": ["requires"],
62eec5b
      "additionalProperties": false
62eec5b
    },
62eec5b
    "commands": {
62eec5b
      "type": "object",
62eec5b
      "properties": {
62eec5b
        "wrap_console": {
62eec5b
          "type": "object",
62eec5b
          "$ref": "#/definitions/command_map"
62eec5b
        },
62eec5b
        "wrap_gui": {
62eec5b
          "type": "object",
62eec5b
          "$ref": "#/definitions/command_map"
62eec5b
        },
62eec5b
        "prebuilt": {
62eec5b
          "type": "array",
62eec5b
          "items": {
62eec5b
            "type": "string",
62eec5b
            "$ref": "#/definitions/relative_path"
62eec5b
          }
62eec5b
        }
62eec5b
      },
62eec5b
      "additionalProperties": false
62eec5b
    },
62eec5b
    "exports": {
62eec5b
      "type": "object",
62eec5b
      "patternProperties": {
62eec5b
        "^[A-Za-z][0-9A-Za-z_]*([.][0-9A-Za-z_]*)*$": {
62eec5b
          "type": "object",
62eec5b
          "patternProperties": {
62eec5b
            ".": {
62eec5b
              "type": "string",
62eec5b
              "$ref": "#/definitions/export_specifier"
62eec5b
            }
62eec5b
          },
62eec5b
          "additionalProperties": false
62eec5b
        }
62eec5b
      },
62eec5b
      "additionalProperties": false
62eec5b
    },
62eec5b
    "extensions": {
62eec5b
      "type": "object",
62eec5b
      "patternProperties": {
62eec5b
        "^[A-Za-z][0-9A-Za-z_]*([.][0-9A-Za-z_]*)*$": {}
62eec5b
      },
62eec5b
      "additionalProperties": false
62eec5b
    },
62eec5b
    "command_map": {
62eec5b
      "type": "object",
62eec5b
      "patternProperties": {
62eec5b
        "^[0-9A-Za-z]([0-9A-Za-z_.-]*[0-9A-Za-z])?$": {
62eec5b
          "type": "string",
62eec5b
          "$ref": "#/definitions/export_specifier"
62eec5b
        }
62eec5b
      },
62eec5b
      "additionalProperties": false
62eec5b
    },
62eec5b
    "distribution_name": {
62eec5b
        "type": "string",
62eec5b
        "pattern": "^[0-9A-Za-z]([0-9A-Za-z_.-]*[0-9A-Za-z])?$"
62eec5b
    },
62eec5b
    "requirement": {
62eec5b
        "type": "string"
62eec5b
    },
62eec5b
    "provides_declaration": {
62eec5b
        "type": "string"
62eec5b
    },
62eec5b
    "environment_marker": {
62eec5b
        "type": "string"
62eec5b
    },
62eec5b
    "document_name": {
62eec5b
        "type": "string"
62eec5b
    },
62eec5b
    "extra_name" : {
62eec5b
        "type": "string",
62eec5b
        "pattern": "^[0-9A-Za-z]([0-9A-Za-z_.-]*[0-9A-Za-z])?$"
62eec5b
    },
62eec5b
    "relative_path" : {
62eec5b
        "type": "string"
62eec5b
    },
62eec5b
    "export_specifier": {
62eec5b
      "type": "string",
62eec5b
      "pattern": "^([A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_][A-Za-z_0-9]*)*)(:[A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_][A-Za-z_0-9]*)*)?(\\[[0-9A-Za-z]([0-9A-Za-z_.-]*[0-9A-Za-z])?\\])?$"
62eec5b
    },
62eec5b
    "qualified_name" : {
62eec5b
        "type": "string",
62eec5b
        "pattern": "^[A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_][A-Za-z_0-9]*)*$"
62eec5b
    },
62eec5b
    "prefixed_name" : {
62eec5b
        "type": "string",
62eec5b
        "pattern": "^[A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_0-9]*)*$"
62eec5b
    }
62eec5b
  }
62eec5b
}