Skip to content

Commit ec7086d

Browse files
committed
2 parents 3b8f955 + dbfdd95 commit ec7086d

10 files changed

+401
-12
lines changed

.github/workflows/compare.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Compare spec to docs
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
compare:
6+
runs-on: ubuntu-22.04
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-python@v5
10+
with:
11+
python-version: '3.12'
12+
- name: Install deps
13+
working-directory: ./_docmatch
14+
run: pip install .
15+
- name: Fetch docs
16+
working-directory: ./_docmatch
17+
run: curl -L https://spoonacular.com/food-api/docs > docs.html
18+
- name: Compare
19+
working-directory: ./_docmatch
20+
run: python src/docmatch.py

_docmatch/.gitignore

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
docs.html
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# Distribution / packaging
9+
.Python
10+
build/
11+
develop-eggs/
12+
dist/
13+
downloads/
14+
eggs/
15+
.eggs/
16+
lib/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
wheels/
22+
share/python-wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# Installer logs
29+
pip-log.txt
30+
pip-delete-this-directory.txt
31+
32+
# pipenv
33+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
34+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
35+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
36+
# install all needed dependencies.
37+
#Pipfile.lock
38+
39+
# pdm
40+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
41+
#pdm.lock
42+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
43+
# in version control.
44+
# https://pdm-project.org/#use-with-ide
45+
.pdm.toml
46+
.pdm-python
47+
.pdm-build/
48+
49+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
50+
__pypackages__/
51+
52+
# Environments
53+
.env
54+
.venv
55+
env/
56+
venv/
57+
ENV/
58+
env.bak/
59+
venv.bak/
60+
61+
# mypy
62+
.mypy_cache/
63+
.dmypy.json
64+
dmypy.json
65+
66+
# Pyre type checker
67+
.pyre/
68+
69+
# pytype static type analyzer
70+
.pytype/

_docmatch/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# docmatch
2+
3+
This is a script that compares the spec with the HTML docs.
4+
5+
Using [pdm](https://pdm-project.org/) for dependencies:
6+
7+
```shell
8+
curl -L https://spoonacular.com/food-api/docs > docs.html
9+
pdm install
10+
pdm run src/docmatch.py
11+
```
12+
13+
(just pip can be used for deps too, `pip install .`,
14+
with a manually managed virtualenv or in an otherwise isolated environment like a container)

_docmatch/pdm.lock

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_docmatch/pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[project]
2+
name = "docmatch"
3+
version = "0.1.0"
4+
description = "Matches the spoonacular API docs to the OpenAPI spec"
5+
authors = [
6+
{name = "Val Packett", email = "[email protected]"},
7+
]
8+
dependencies = [
9+
"beautifulsoup4>=4.12.3",
10+
"genson>=1.2.2",
11+
"json-repair>=0.17.1",
12+
"jsonref>=1.1.0",
13+
]
14+
requires-python = ">=3.10.0"
15+
readme = "README.md"
16+
license = {text = "MIT"}
17+
18+
[tool.pdm]
19+
distribution = false

0 commit comments

Comments
 (0)