Skip to content

Commit 7c47997

Browse files
committed
Static API clarification.
1 parent 60276ae commit 7c47997

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,35 @@ This page will display three possible states:
3434

3535
## API
3636

37-
The PyScript Packages website offers a simple API to access package information programmatically.
37+
The PyScript Packages website offers a simple
38+
[static API](https://www.seancdavis.com/posts/lets-talk-about-static-apis/) to
39+
access package information programmatically.
3840

39-
Retrieve the status and metadata of packages in JSON format by making a GET request to the following endpoint:
41+
Retrieve the status and metadata of packages in JSON format by making a GET
42+
request to the following endpoint:
4043

4144
```
4245
GET /api/package/<package_name>.json
4346
```
4447

45-
This will return a JSON object containing the following metadata (or respond with a 404 status code if the package is not found):
48+
This will return a JSON object containing the following metadata (or respond
49+
with a 404 status code if the package is not found):
4650

4751

4852
* *status*: The support status of the package (e.g., "green", "amber", "red").
4953
* *summary*: The summary of the package from PyPI.
50-
* *notes*: Brief notes, in Markdown, about the package's compatibility with PyScript.
51-
* *pyodide_versions*: A description of Pyodide/PyScript version support for each version of the package.
52-
* *updated_by*: The name or handle of the person who last updated this information.
53-
* *updated_at*: The ISO 8601 timestamp of when this information was last updated.
54+
* *notes*: Brief notes, in Markdown, about the package's compatibility with
55+
PyScript.
56+
* *pyodide_versions*: A description of Pyodide/PyScript version support for
57+
each version of the package.
58+
* *updated_by*: The name or handle of the person who last updated this
59+
information.
60+
* *updated_at*: The ISO 8601 timestamp of when this information was last
61+
updated.
5462

5563

56-
For example, in Python, you can use the `requests` library to fetch such data about the `pandas` package:
64+
For example, in Python, you can use the `requests` library to fetch such data
65+
about the `pandas` package:
5766

5867
```
5968
import requests
@@ -66,7 +75,8 @@ else:
6675
print("Package not found or API error.")
6776
```
6877

69-
If you wish to access data for all packages at once, you can use the following endpoint:
78+
If you wish to access data for all packages at once, you can use the following
79+
endpoint:
7080

7181
```
7282
GET api/all.json

help/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ <h2 id="contribute">How do I contribute?</h2>
8181

8282
<h2 id="api">Our API</h2>
8383

84-
<p>The PyScript Packages website offers a simple API to access package information programmatically.</p>
84+
<p>The PyScript Packages website offers a simple <a href="https://www.seancdavis.com/posts/lets-talk-about-static-apis/" target="_blank">static API</a> to access package information programmatically.</p>
8585

8686
<p>Retrieve the status and metadata of packages in JSON format by making a GET request to the following endpoint:</p>
8787

8888
<pre><code>
89-
GET /api/package/&lt;package_name&gt;.json
89+
GET api/package/&lt;package_name&gt;.json
9090
</code></pre>
9191

92-
<p>This will return a JSON object containing the following metadata (or respond with a 404 status code if the package is not found):</p>
92+
<p>This will return a JSON object containing the following metadata (or respond with a 404 status code if the package's status is unknown):</p>
9393

9494
<ul>
9595
<li><strong>status</strong>: The support status of the package (e.g., "green", "amber", "red").</li>
@@ -115,13 +115,13 @@ <h2 id="api">Our API</h2>
115115
<p>If you wish to access data for all packages at once, you can use the following endpoint:</p>
116116

117117
<pre><code>
118-
GET /api/all.json
118+
GET api/all.json
119119
</code></pre>
120120

121121
<p>Data about the top 100 packages is also available through this endpoint:</p>
122122

123123
<pre><code>
124-
GET /api/top_100_pypi_packages.json
124+
GET api/top_100_pypi_packages.json
125125
</code></pre>
126126

127127
<p>That's it!</p>

0 commit comments

Comments
 (0)