Skip to content

Commit 90a26dd

Browse files
committed
Make documentation easier for people just getting started
1 parent 2addfad commit 90a26dd

File tree

10 files changed

+734
-678
lines changed

10 files changed

+734
-678
lines changed

docs-src/common-workflows.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ Where:
2121
* `host` is the URL that `py-semantic-taxonomy` is running at, e.g. "http://localhost:8000" if running locally
2222
* `sample` is a boolean flag on whether only a sample of the available data should be imported. The full import takes more than an hour.
2323

24+
If you are testing locally using the default Docker containers for Postgres and Typesense, then the `CombinedNomenclatureLoader` can take these values:
25+
26+
```python
27+
CombinedNomenclatureLoader(
28+
year=2024,
29+
api_key="abc123", # Default API key; adjust if needed
30+
host="http://127.0.0.1:8000", # Default Uvicorn port; adjust if needed
31+
sample=True
32+
).write()
33+
```
34+
2435
## Creating a new taxonomy
2536

2637
PyST stores concept schemes, concepts, and relationships between concepts all in different places, so the creation of these objects needs to happen in a defined order:

docs-src/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ PyST is opinionated server software for creating, maintaining, and publishing [S
44

55
* [API docs](https://docs.pyst.dev/api/), [OpenAPI 3.1 JSON](https://docs.pyst.dev/api/openapi.json), [OpenAPI 3.1 YAML](https://docs.pyst.dev/api/openapi.yaml)
66
* [GitHub repo](https://github.com/cauldron/py-semantic-taxonomy/)
7+
* [Client library](https://github.com/cauldron/pyst-client/)
8+
* [Client library usage guide](https://github.com/cauldron/pyst-client/blob/main/pyst_client/example/Simple%20client%20library%20guide.ipynb)
79
* [Example notebook](https://github.com/cauldron/py-semantic-taxonomy/blob/main/examples/PyST%20basic%20demo.ipynb)
810

911
PyST was built and is maintained by [Cauldron Solutions](https://www.cauldron.ch/).
@@ -16,6 +18,17 @@ PyST was built and is maintained by [Cauldron Solutions](https://www.cauldron.ch
1618
* Install and configure [Typesense](https://typesense.org/)
1719
* `pip install py-semantic-taxonomy`
1820

21+
If you just want to try our the software, and have Docker installed on your machine, you can run Postgres and Typesense in containers using the scripts in the `scripts` directory, i.e.:
22+
23+
* `python scripts/start_postgres_container.py`
24+
* `python scripts/start_typesense_container.py`
25+
26+
These scripts will give you the values of the environment variables needed for step 2. Note that you will still need to make up your own `PyST_auth_token` setting and make sure it is set correctly, i.e.:
27+
28+
```console
29+
export PyST_auth_token="supersecret"
30+
```
31+
1932
2\. Configure required software
2033

2134
The following parameters must be either specified as environment variables, or given in the file `pyst-config.env`.
@@ -50,8 +63,16 @@ uvicorn.run(
5063
)
5164
```
5265

66+
If you are using the default ASGI app runner and configuration options, you can also do:
67+
68+
```console
69+
python <pyst-source-directory>/src/py_semantic_taxonomy/app.py
70+
```
71+
5372
4\. Add data
5473

74+
See [common workflows](common-workflows.md) for a guide on adding example data.
75+
5576
## Why New Software?
5677

5778
There are a number of great projects for browsing SKOS taxonomies already, including:

docs/api/index.html

Lines changed: 672 additions & 672 deletions
Large diffs are not rendered by default.

docs/api/openapi.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,7 @@
15351535
]
15361536
}
15371537
},
1538+
"additionalProperties": true,
15381539
"type": "object",
15391540
"required": [
15401541
"@id",

docs/api/openapi.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ components:
985985
description: https://rdf-vocabulary.ddialliance.org/xkos.html#correspondences
986986
example:
987987
- '@id': http://data.europa.eu/xsp/cn2024/010011000090
988+
additionalProperties: true
988989
type: object
989990
required:
990991
- '@id'

docs/common-workflows/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,14 @@ <h2 id="importing-the-combined-nomenclature-codes">Importing the Combined Nomenc
528528
<li><code>host</code> is the URL that <code>py-semantic-taxonomy</code> is running at, e.g. "http://localhost:8000" if running locally</li>
529529
<li><code>sample</code> is a boolean flag on whether only a sample of the available data should be imported. The full import takes more than an hour.</li>
530530
</ul>
531+
<p>If you are testing locally using the default Docker containers for Postgres and Typesense, then the <code>CombinedNomenclatureLoader</code> can take these values:</p>
532+
<div class="highlight"><pre><span></span><code><span class="n">CombinedNomenclatureLoader</span><span class="p">(</span>
533+
<span class="n">year</span><span class="o">=</span><span class="mi">2024</span><span class="p">,</span>
534+
<span class="n">api_key</span><span class="o">=</span><span class="s2">&quot;abc123&quot;</span><span class="p">,</span> <span class="c1"># Default API key; adjust if needed</span>
535+
<span class="n">host</span><span class="o">=</span><span class="s2">&quot;http://127.0.0.1:8000&quot;</span><span class="p">,</span> <span class="c1"># Default Uvicorn port; adjust if needed</span>
536+
<span class="n">sample</span><span class="o">=</span><span class="kc">True</span>
537+
<span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">()</span>
538+
</code></pre></div>
531539
<h2 id="creating-a-new-taxonomy">Creating a new taxonomy<a class="headerlink" href="#creating-a-new-taxonomy" title="Permanent link">#</a></h2>
532540
<p>PyST stores concept schemes, concepts, and relationships between concepts all in different places, so the creation of these objects needs to happen in a defined order:</p>
533541
<ul>

docs/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,8 @@ <h1 id="pyst-py-semantic-taxonomy">PyST (py-semantic-taxonomy)<a class="headerli
477477
<ul>
478478
<li><a href="https://docs.pyst.dev/api/">API docs</a>, <a href="https://docs.pyst.dev/api/openapi.json">OpenAPI 3.1 JSON</a>, <a href="https://docs.pyst.dev/api/openapi.yaml">OpenAPI 3.1 YAML</a></li>
479479
<li><a href="https://github.com/cauldron/py-semantic-taxonomy/">GitHub repo</a></li>
480+
<li><a href="https://github.com/cauldron/pyst-client/">Client library</a></li>
481+
<li><a href="https://github.com/cauldron/pyst-client/blob/main/pyst_client/example/Simple%20client%20library%20guide.ipynb">Client library usage guide</a></li>
480482
<li><a href="https://github.com/cauldron/py-semantic-taxonomy/blob/main/examples/PyST%20basic%20demo.ipynb">Example notebook</a></li>
481483
</ul>
482484
<p>PyST was built and is maintained by <a href="https://www.cauldron.ch/">Cauldron Solutions</a>.</p>
@@ -487,6 +489,14 @@ <h2 id="quickstart">Quickstart<a class="headerlink" href="#quickstart" title="Pe
487489
<li>Install and configure <a href="https://typesense.org/">Typesense</a></li>
488490
<li><code>pip install py-semantic-taxonomy</code></li>
489491
</ul>
492+
<p>If you just want to try our the software, and have Docker installed on your machine, you can run Postgres and Typesense in containers using the scripts in the <code>scripts</code> directory, i.e.:</p>
493+
<ul>
494+
<li><code>python scripts/start_postgres_container.py</code></li>
495+
<li><code>python scripts/start_typesense_container.py</code></li>
496+
</ul>
497+
<p>These scripts will give you the values of the environment variables needed for step 2. Note that you will still need to make up your own <code>PyST_auth_token</code> setting and make sure it is set correctly, i.e.:</p>
498+
<div class="highlight"><pre><span></span><code><span class="go">export PyST_auth_token=&quot;supersecret&quot;</span>
499+
</code></pre></div>
490500
<p>2. Configure required software</p>
491501
<p>The following parameters must be either specified as environment variables, or given in the file <code>pyst-config.env</code>.</p>
492502
<div class="admonition note">
@@ -516,7 +526,11 @@ <h2 id="quickstart">Quickstart<a class="headerlink" href="#quickstart" title="Pe
516526
<span class="n">log_level</span><span class="o">=</span><span class="s2">&quot;warning&quot;</span><span class="p">,</span>
517527
<span class="p">)</span>
518528
</code></pre></div>
529+
<p>If you are using the default ASGI app runner and configuration options, you can also do:</p>
530+
<div class="highlight"><pre><span></span><code><span class="go">python &lt;pyst-source-directory&gt;/src/py_semantic_taxonomy/app.py</span>
531+
</code></pre></div>
519532
<p>4. Add data</p>
533+
<p>See <a href="common-workflows/">common workflows</a> for a guide on adding example data.</p>
520534
<h2 id="why-new-software">Why New Software?<a class="headerlink" href="#why-new-software" title="Permanent link">#</a></h2>
521535
<p>There are a number of great projects for browsing SKOS taxonomies already, including:</p>
522536
<ul>

docs/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/sitemap.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>https://docs.pyst.dev/</loc>
5-
<lastmod>2025-05-06</lastmod>
5+
<lastmod>2025-06-05</lastmod>
66
</url>
77
<url>
88
<loc>https://docs.pyst.dev/architecture/</loc>
9-
<lastmod>2025-05-06</lastmod>
9+
<lastmod>2025-06-05</lastmod>
1010
</url>
1111
<url>
1212
<loc>https://docs.pyst.dev/common-workflows/</loc>
13-
<lastmod>2025-05-06</lastmod>
13+
<lastmod>2025-06-05</lastmod>
1414
</url>
1515
<url>
1616
<loc>https://docs.pyst.dev/data-model/</loc>
17-
<lastmod>2025-05-06</lastmod>
17+
<lastmod>2025-06-05</lastmod>
1818
</url>
1919
<url>
2020
<loc>https://docs.pyst.dev/development/</loc>
21-
<lastmod>2025-05-06</lastmod>
21+
<lastmod>2025-06-05</lastmod>
2222
</url>
2323
</urlset>

docs/sitemap.xml.gz

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)