{"id":15043323,"url":"https://github.com/jupyterlab/pytest-check-links","last_synced_at":"2025-10-27T22:41:35.797Z","repository":{"id":37945694,"uuid":"81450738","full_name":"jupyterlab/pytest-check-links","owner":"jupyterlab","description":"pytest plugin that checks URLs","archived":false,"fork":false,"pushed_at":"2024-05-16T23:34:32.000Z","size":231,"stargazers_count":17,"open_issues_count":8,"forks_count":17,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-24T12:21:52.295Z","etag":null,"topics":["jupyter-notebook","markdown","pytest","pytest-plugin","testing"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jupyterlab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"numfocus","custom":"https://numfocus.org/donate-to-jupyter"}},"created_at":"2017-02-09T13:02:01.000Z","updated_at":"2024-04-12T14:56:02.000Z","dependencies_parsed_at":"2023-02-01T06:45:34.332Z","dependency_job_id":"9982fcb5-f698-4943-88b5-dd50c83717cc","html_url":"https://github.com/jupyterlab/pytest-check-links","commit_stats":{"total_commits":169,"total_committers":14,"mean_commits":"12.071428571428571","dds":0.6982248520710059,"last_synced_commit":"2a2a78f478d535ac2d81549fbb8d26870b445e34"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupyterlab%2Fpytest-check-links","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupyterlab%2Fpytest-check-links/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupyterlab%2Fpytest-check-links/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jupyterlab%2Fpytest-check-links/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jupyterlab","download_url":"https://codeload.github.com/jupyterlab/pytest-check-links/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248226366,"owners_count":21068190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jupyter-notebook","markdown","pytest","pytest-plugin","testing"],"created_at":"2024-09-24T20:48:51.578Z","updated_at":"2025-10-27T22:41:30.777Z","avatar_url":"https://github.com/jupyterlab.png","language":"Python","funding_links":["https://github.com/sponsors/numfocus","https://numfocus.org/donate-to-jupyter"],"categories":[],"sub_categories":[],"readme":"# pytest-check-links\n\npytest plugin that checks URLs for HTML-containing files.\n\n[![Tests](https://github.com/jupyterlab/pytest-check-links/workflows/Tests/badge.svg)](https://github.com/jupyterlab/pytest-check-links/actions?query=workflow%3ATests+branch%3Amaster)\n[![PyPI version](https://badge.fury.io/py/pytest-check-links.svg)](https://badge.fury.io/py/pytest-check-links)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytest-check-links)\n\n## Supported files\n\n- `.html`\n- `.rst`\n- `.md` (TODO: select renderer)\n- `.ipynb` (requires `nbconvert`)\n\n## Install\n\n```\npip install pytest-check-links\n```\n\n## Use\n\n```\npytest --check-links mynotebook.ipynb\n```\n\n## Configure\n\n#### --links-ext\n\n\u003e default: `md,rst,html,ipynb`\n\nA comma-separated list of extensions to check\n\n#### --check-anchors\n\nAlso check whether links with `#anchors` HTML files (either local, or with\nserved with `html` in the `Content-Type`) actually exist, and point to _exactly one_\nnamed anchor.\n\n#### --check-links-ignore\n\nA regular expression that matches URIs that should not be checked.\nCan be specified multiple times for multiple ignore patterns.\nThis can be used for files that have a lot of links to GitHub pages,\nsuch as a Changelog. GitHub has rate limiting, which would normally cause these files to take up to an hour to complete for larger repositories. For example:\n\n```\npytest --check-links --check-links-ignore \"https://github.com/.*/pull/.*\" CHANGELOG.md\n```\n\n### Cache\n\nCaching requires the installation of `requests-cache`.\n\n```\npip install requests-cache\n```\n\nIf enabled, each occurrence of a link will be checked, no matter how many times\nit appears in a collection of files to check.\n\n#### --check-links-cache\n\nCache requests when checking links. Caching is disabled by default, and this option\nmust be provided, even if other cache configuration options are provided.\n\n#### --check-links-cache-name\n\n\u003e default: `.pytest-check-links-cache`\n\nName of link cache, either the base name of a file or similar, depending on backend.\n\n#### --check-links-cache-backend\n\n\u003e default: `sqlite3`\n\nCache persistence backend. The other known backends are:\n\n- `memory`\n- `redis`\n- `mongodb`\n\nSee the [requests-cache documentation](https://requests-cache.readthedocs.io)\nfor more information.\n\n#### --check-links-cache-expire-after\n\n\u003e default: `None` (unlimited)\n\nTime to cache link responses (seconds).\n\n#### --check-links-cache-backend-opt\n\nBackend-specific options for link cache, provided as `key:value`. These are passed\ndirectly to the `requests_cache.CachedSession` constructor, as they vary depending\non the backend.\n\nValues will be parsed as JSON first, so to overload the default of caching all\nHTTP response codes (which requires a list of `int`s):\n\n```bash\n--check-links-backend-opt allowable_codes:[200]\n```\n\n## Code Styling\n\n`pytest-check-links` has adopted automatic code formatting so you shouldn't\nneed to worry too much about your code style.\nAs long as your code is valid,\nthe pre-commit hook should take care of how it should look.\nYou can invoke the pre-commit hook by hand at any time with:\n\n```bash\npre-commit run\n```\n\nwhich should run any autoformatting on your code\nand tell you about any errors it couldn't fix automatically.\nYou may also install [black integration](https://black.readthedocs.io/en/stable/integrations/editors.html)\ninto your text editor to format code automatically.\n\nIf you have already committed files before setting up the pre-commit\nhook with `pre-commit install`, you can fix everything up using\n`pre-commit run --all-files`. You need to make the fixing commit\nyourself after that.\n\nSome of the hooks only run on CI by default, but you can invoke them by\nrunning with the `--hook-stage manual` argument.\n\n## TODO\n\n- pick a markdown renderer (probably commonmark) or make the markdown renderer pluggable\n- options for validating links (allow absolute links, only remote or local, etc.)\n- find URLs in Python docstrings\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjupyterlab%2Fpytest-check-links","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjupyterlab%2Fpytest-check-links","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjupyterlab%2Fpytest-check-links/lists"}