griffe


Namegriffe JSON
Version 0.44.0 PyPI version JSON
download
home_pageNone
SummarySignatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API.
upload_time2024-04-19 09:39:15
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseISC
keywords api signature breaking-changes static-analysis dynamic-analysis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Griffe

[![ci](https://github.com/mkdocstrings/griffe/workflows/ci/badge.svg)](https://github.com/mkdocstrings/griffe/actions?query=workflow%3Aci)
[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://mkdocstrings.github.io/griffe/)
[![pypi version](https://img.shields.io/pypi/v/griffe.svg)](https://pypi.org/project/griffe/)
[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/griffe)
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#mkdocstrings_griffe:gitter.im)

<img src="logo.svg" alt="Griffe logo, created by François Rozet &lt;francois.rozet@outlook.com&gt;" style="float: right; max-width: 200px; margin: 0 15px;">

Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API.

Griffe, pronounced "grif" (`/ɡʁif/`), is a french word that means "claw",
but also "signature" in a familiar way. "On reconnaît bien là sa griffe."

## Installation

With `pip`:

```bash
pip install griffe
```

With [`pipx`](https://github.com/pipxproject/pipx):

```bash
python3.8 -m pip install --user pipx
pipx install griffe
```

## Usage

**On the command line**, pass the names of packages to the `griffe dump` command:

```console
$ griffe dump httpx fastapi
{
  "httpx": {
    "name": "httpx",
    ...
  },
  "fastapi": {
    "name": "fastapi",
    ...
  }
}
```

See [the Dumping data section](https://mkdocstrings.github.io/griffe/dumping/) for more examples.

Or pass a relative path to the `griffe check` command:

```console
$ griffe check mypackage --verbose
mypackage/mymodule.py:10: MyClass.mymethod(myparam):
Parameter kind was changed:
  Old: positional or keyword
  New: keyword-only
```

For `src` layouts:

```console
$ griffe check --search src mypackage --verbose
src/mypackage/mymodule.py:10: MyClass.mymethod(myparam):
Parameter kind was changed:
  Old: positional or keyword
  New: keyword-only
```

See [the API breakage section](https://mkdocstrings.github.io/griffe/checking/) for more examples.

**With Python**, loading a package:

```python
import griffe

fastapi = griffe.load("fastapi")
```

Finding breaking changes:

```python
import griffe

previous = griffe.load_git("mypackage", ref="0.2.0")
current = griffe.load("mypackage")

for breakage in griffe.find_breaking_changes(previous, current):
    ...
```

See [the Loading data section](https://mkdocstrings.github.io/griffe/loading/) for more examples.

## Todo

- Extensions
    - Post-processing extensions
    - Third-party libraries we could provide support for:
        - Django support
        - Marshmallow support
        - Pydantic support
- Docstrings parsers
    - epydoc
    - New Markdown-based format? For graceful degradation
- Serializer:
    - Flat JSON
- API diff:
    - [ ] Mechanism to cache APIs? Should users version them, or store them somewhere (docs)?
    - [ ] Ability to return warnings (things that are not backward-compatibility-friendly)
    - List of things to consider for warnings
        - Multiple positional-or-keyword parameters
        - Public imports in public modules
        - Private things made public through imports/assignments
        - Too many public things? Generally annoying. Configuration?
    - [x] Ability to compare two APIs to return breaking changes
    - List of things to consider for breaking changes
        - [x] Changed position of positional only parameter
        - [x] Changed position of positional or keyword parameter
        - [ ] Changed type of parameter
        - [ ] Changed type of public module attribute
        - [ ] Changed return type of a public function/method
        - [x] Added parameter without a default value
        - [x] Removed keyword-only parameter without a default value, without **kwargs to swallow it
        - [x] Removed positional-only parameter without a default value, without *args to swallow it
        - [x] Removed positional-or_keyword argument without a default value, without *args and **kwargs to swallow it
        - [x] Removed public module/class/function/method/attribute
        - [ ] All of the previous even when parent is private (could be publicly imported or assigned somewhere),
            and later be smarter: public assign/import makes private things public!
        - [ ] Inheritance: removed, added or changed base that changes MRO

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "griffe",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "api, signature, breaking-changes, static-analysis, dynamic-analysis",
    "author": null,
    "author_email": "=?utf-8?q?Timoth=C3=A9e_Mazzucotelli?= <dev@pawamoy.fr>",
    "download_url": "https://files.pythonhosted.org/packages/e3/c0/9275a0e624d82c3ac43dbc3b76013d448799eace73720e463d77370e92f3/griffe-0.44.0.tar.gz",
    "platform": null,
    "description": "# Griffe\n\n[![ci](https://github.com/mkdocstrings/griffe/workflows/ci/badge.svg)](https://github.com/mkdocstrings/griffe/actions?query=workflow%3Aci)\n[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://mkdocstrings.github.io/griffe/)\n[![pypi version](https://img.shields.io/pypi/v/griffe.svg)](https://pypi.org/project/griffe/)\n[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/griffe)\n[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#mkdocstrings_griffe:gitter.im)\n\n<img src=\"logo.svg\" alt=\"Griffe logo, created by Fran\u00e7ois Rozet &lt;francois.rozet@outlook.com&gt;\" style=\"float: right; max-width: 200px; margin: 0 15px;\">\n\nSignatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API.\n\nGriffe, pronounced \"grif\" (`/\u0261\u0281if/`), is a french word that means \"claw\",\nbut also \"signature\" in a familiar way. \"On reconna\u00eet bien l\u00e0 sa griffe.\"\n\n## Installation\n\nWith `pip`:\n\n```bash\npip install griffe\n```\n\nWith [`pipx`](https://github.com/pipxproject/pipx):\n\n```bash\npython3.8 -m pip install --user pipx\npipx install griffe\n```\n\n## Usage\n\n**On the command line**, pass the names of packages to the `griffe dump` command:\n\n```console\n$ griffe dump httpx fastapi\n{\n  \"httpx\": {\n    \"name\": \"httpx\",\n    ...\n  },\n  \"fastapi\": {\n    \"name\": \"fastapi\",\n    ...\n  }\n}\n```\n\nSee [the Dumping data section](https://mkdocstrings.github.io/griffe/dumping/) for more examples.\n\nOr pass a relative path to the `griffe check` command:\n\n```console\n$ griffe check mypackage --verbose\nmypackage/mymodule.py:10: MyClass.mymethod(myparam):\nParameter kind was changed:\n  Old: positional or keyword\n  New: keyword-only\n```\n\nFor `src` layouts:\n\n```console\n$ griffe check --search src mypackage --verbose\nsrc/mypackage/mymodule.py:10: MyClass.mymethod(myparam):\nParameter kind was changed:\n  Old: positional or keyword\n  New: keyword-only\n```\n\nSee [the API breakage section](https://mkdocstrings.github.io/griffe/checking/) for more examples.\n\n**With Python**, loading a package:\n\n```python\nimport griffe\n\nfastapi = griffe.load(\"fastapi\")\n```\n\nFinding breaking changes:\n\n```python\nimport griffe\n\nprevious = griffe.load_git(\"mypackage\", ref=\"0.2.0\")\ncurrent = griffe.load(\"mypackage\")\n\nfor breakage in griffe.find_breaking_changes(previous, current):\n    ...\n```\n\nSee [the Loading data section](https://mkdocstrings.github.io/griffe/loading/) for more examples.\n\n## Todo\n\n- Extensions\n    - Post-processing extensions\n    - Third-party libraries we could provide support for:\n        - Django support\n        - Marshmallow support\n        - Pydantic support\n- Docstrings parsers\n    - epydoc\n    - New Markdown-based format? For graceful degradation\n- Serializer:\n    - Flat JSON\n- API diff:\n    - [ ] Mechanism to cache APIs? Should users version them, or store them somewhere (docs)?\n    - [ ] Ability to return warnings (things that are not backward-compatibility-friendly)\n    - List of things to consider for warnings\n        - Multiple positional-or-keyword parameters\n        - Public imports in public modules\n        - Private things made public through imports/assignments\n        - Too many public things? Generally annoying. Configuration?\n    - [x] Ability to compare two APIs to return breaking changes\n    - List of things to consider for breaking changes\n        - [x] Changed position of positional only parameter\n        - [x] Changed position of positional or keyword parameter\n        - [ ] Changed type of parameter\n        - [ ] Changed type of public module attribute\n        - [ ] Changed return type of a public function/method\n        - [x] Added parameter without a default value\n        - [x] Removed keyword-only parameter without a default value, without **kwargs to swallow it\n        - [x] Removed positional-only parameter without a default value, without *args to swallow it\n        - [x] Removed positional-or_keyword argument without a default value, without *args and **kwargs to swallow it\n        - [x] Removed public module/class/function/method/attribute\n        - [ ] All of the previous even when parent is private (could be publicly imported or assigned somewhere),\n            and later be smarter: public assign/import makes private things public!\n        - [ ] Inheritance: removed, added or changed base that changes MRO\n",
    "bugtrack_url": null,
    "license": "ISC",
    "summary": "Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API.",
    "version": "0.44.0",
    "project_urls": {
        "Changelog": "https://mkdocstrings.github.io/griffe/changelog",
        "Discussions": "https://github.com/mkdocstrings/griffe/discussions",
        "Documentation": "https://mkdocstrings.github.io/griffe",
        "Funding": "https://github.com/sponsors/pawamoy",
        "Gitter": "https://gitter.im/mkdocstrings/griffe",
        "Homepage": "https://mkdocstrings.github.io/griffe",
        "Issues": "https://github.com/mkdocstrings/griffe/issues",
        "Repository": "https://github.com/mkdocstrings/griffe"
    },
    "split_keywords": [
        "api",
        " signature",
        " breaking-changes",
        " static-analysis",
        " dynamic-analysis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ebec8d43b43146f8cc30d8087d6ca739a8fdb18b75f57beb0bb553d04c8c322",
                "md5": "d31ec5f7a97b73037738e60280aa2c3d",
                "sha256": "8a4471c469ba980b87c843f1168850ce39d0c1d0c7be140dca2480f76c8e5446"
            },
            "downloads": -1,
            "filename": "griffe-0.44.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d31ec5f7a97b73037738e60280aa2c3d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 118735,
            "upload_time": "2024-04-19T09:39:13",
            "upload_time_iso_8601": "2024-04-19T09:39:13.137368Z",
            "url": "https://files.pythonhosted.org/packages/4e/be/c8d43b43146f8cc30d8087d6ca739a8fdb18b75f57beb0bb553d04c8c322/griffe-0.44.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e3c09275a0e624d82c3ac43dbc3b76013d448799eace73720e463d77370e92f3",
                "md5": "b80a0473e0915633ff05990177014aec",
                "sha256": "34aee1571042f9bf00529bc715de4516fb6f482b164e90d030300601009e0223"
            },
            "downloads": -1,
            "filename": "griffe-0.44.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b80a0473e0915633ff05990177014aec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 136871,
            "upload_time": "2024-04-19T09:39:15",
            "upload_time_iso_8601": "2024-04-19T09:39:15.828279Z",
            "url": "https://files.pythonhosted.org/packages/e3/c0/9275a0e624d82c3ac43dbc3b76013d448799eace73720e463d77370e92f3/griffe-0.44.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-19 09:39:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mkdocstrings",
    "github_project": "griffe",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "griffe"
}
        
Elapsed time: 0.24139s