Skip to content

Commit

Permalink
Deployed 707b8c9 with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Hallett committed Oct 24, 2023
1 parent 62726e4 commit 04c4ab1
Show file tree
Hide file tree
Showing 9 changed files with 222 additions and 151 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#070" class="md-nav__link">
0.7.0
</a>

</li>

<li class="md-nav__item">
<a href="#063" class="md-nav__link">
0.6.3
Expand Down Expand Up @@ -566,6 +573,13 @@
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#070" class="md-nav__link">
0.7.0
</a>

</li>

<li class="md-nav__item">
<a href="#063" class="md-nav__link">
0.6.3
Expand Down Expand Up @@ -717,6 +731,20 @@


<h1 id="change-log">Change log</h1>
<h2 id="070">0.7.0</h2>
<ul>
<li>Updated all files to use the templates engine.</li>
<li>Generator files have been reorganised in clientele to support future templates.</li>
<li><code>constants.py</code> has been renamed to <code>config.py</code> to better reflect how it is used. It is not generated from a template like the other files.</li>
<li>If you are using Python 3.10 or later, the <code>typing.Unions</code> types will generate as the short hand <code>|</code> instead.</li>
<li>To regenerate a client (and to prevent accidental overrides) you must now pass <code>--regen t</code> or <code>-r t</code> to the <code>generate</code> command. This is automatically added to the line in <code>MANIFEST.md</code> to help.</li>
<li>Clientele will now automatically run <a href="https://black.readthedocs.io/en/stable/">black</a> code formatter once a client is generated or regenerated.</li>
<li>Clientele will now generate absolute paths to refer to adjacent files in the generated client, instead of relative paths. This assumes you are running the <code>clientele</code> command in the root directory of your project.</li>
<li>A lot of documentation and docs strings updates so that code in the generated client is easier to understand.</li>
<li>Improved the utility for snake-casing enum keys. Tests added for the functions.</li>
<li>Python 3.12 support.</li>
<li>Add a "basic" client using the command <code>generate-basic</code>. This can be used to keep a consistent file structure for an API that does not use OpenAPI.</li>
</ul>
<h2 id="063">0.6.3</h2>
<ul>
<li>Packaged application installs in the correct location. Resolving <a href="https://github.com/phalt/clientele/issues/6">#6</a></li>
Expand Down
1 change: 1 addition & 0 deletions compatibility/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ <h2 id="great-compatibility">Great compatibility</h2>
<p>We have tested Clientele with:</p>
<ul>
<li><a href="https://fastapi.tiangolo.com/tutorial/first-steps/?h=openapi#what-is-openapi-for">FastAPI</a> - our target audience, so 100% compatibility guaranteed.</li>
<li><a href="https://github.com/tfranzel/drf-spectacular">drf-spectacular</a> works great as well, you can see which schemas we tested in <a href="https://github.com/phalt/clientele/issues/23">this GitHub issue</a>.</li>
<li><a href="https://learn.microsoft.com/en-us/azure/api-management/import-api-from-oas?tabs=portal">Microsoft's OpenAPI spec</a> has also been battle tested and works well.</li>
</ul>
<h2 id="no-compatibility">No compatibility</h2>
Expand Down
266 changes: 130 additions & 136 deletions examples/index.html

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -552,12 +552,13 @@ <h2 id="async-support">Async support</h2>
<h2 id="other-features">Other features</h2>
<ul>
<li>Written entirely in Python.</li>
<li>Designed to work with <a href="https://fastapi.tiangolo.com/">FastAPI</a>'s OpenAPI schema generator.</li>
<li>Designed to work with <a href="https://fastapi.tiangolo.com/">FastAPI</a>'s and <a href="https://github.com/tfranzel/drf-spectacular">Ddrf-spectacular</a>'s OpenAPI schema generator.</li>
<li>The generated client only depends on <a href="https://www.python-httpx.org/">httpx</a> and <a href="https://docs.pydantic.dev/latest/">Pydantic 2.4</a>.</li>
<li>HTTP Basic and HTTP Bearer authentication support.</li>
<li>Support your own configuration - we provide an entry point that will never be overwritten.</li>
<li>Designed for easy testing with <a href="https://lundberg.github.io/respx/">respx</a>.</li>
<li>API updated? Just run the same command again and check the git diff.</li>
<li>Automatically formats the generated client with <a href="https://black.readthedocs.io/en/stable/index.html">black</a>.</li>
</ul>


Expand Down
2 changes: 1 addition & 1 deletion install/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ <h1 id="install">🏗️ Install</h1>
</span></code></pre></div>
<p>Once installed you can run <code>clientele version</code> to make sure you have the latest version:</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>&gt;<span class="w"> </span>clientele<span class="w"> </span>version
</span><span id="__span-1-2"><a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a>clientele<span class="w"> </span><span class="m">0</span>.6.3
</span><span id="__span-1-2"><a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a>clientele<span class="w"> </span><span class="m">0</span>.7.0
</span></code></pre></div>


Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://phalt.github.io/clientele/</loc>
<lastmod>2023-10-08</lastmod>
<lastmod>2023-10-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://phalt.github.io/clientele/CHANGELOG/</loc>
<lastmod>2023-10-08</lastmod>
<lastmod>2023-10-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://phalt.github.io/clientele/compatibility/</loc>
<lastmod>2023-10-08</lastmod>
<lastmod>2023-10-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://phalt.github.io/clientele/design/</loc>
<lastmod>2023-10-08</lastmod>
<lastmod>2023-10-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://phalt.github.io/clientele/examples/</loc>
<lastmod>2023-10-08</lastmod>
<lastmod>2023-10-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://phalt.github.io/clientele/install/</loc>
<lastmod>2023-10-08</lastmod>
<lastmod>2023-10-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://phalt.github.io/clientele/testing/</loc>
<lastmod>2023-10-08</lastmod>
<lastmod>2023-10-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://phalt.github.io/clientele/usage/</loc>
<lastmod>2023-10-08</lastmod>
<lastmod>2023-10-24</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.
55 changes: 51 additions & 4 deletions usage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@
Async.io
</a>

</li>

<li class="md-nav__item">
<a href="#regenerating" class="md-nav__link">
Regenerating
</a>

</li>

</ul>
Expand Down Expand Up @@ -366,6 +373,13 @@
</ul>
</nav>

</li>

<li class="md-nav__item">
<a href="#generate-basic" class="md-nav__link">
generate-basic
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -531,6 +545,13 @@
Async.io
</a>

</li>

<li class="md-nav__item">
<a href="#regenerating" class="md-nav__link">
Regenerating
</a>

</li>

</ul>
Expand Down Expand Up @@ -563,6 +584,13 @@
</ul>
</nav>

</li>

<li class="md-nav__item">
<a href="#generate-basic" class="md-nav__link">
generate-basic
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -614,6 +642,15 @@ <h3 id="asyncio">Async.io</h3>
<p>If you prefer an <a href="https://docs.python.org/3/library/asyncio.html">asyncio</a> client, just pass <code>--asyncio t</code> to your command.</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-2-1"><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>clientele<span class="w"> </span>generate<span class="w"> </span>-f<span class="w"> </span>path/to/file.json<span class="w"> </span>-o<span class="w"> </span>my_client/<span class="w"> </span>--asyncio<span class="w"> </span>t
</span></code></pre></div>
<h3 id="regenerating">Regenerating</h3>
<p>At times you may wish to regenerate the client. This could be because the API has updated or you just want to use a newer version of clientele.</p>
<p>To force a regeneration you must pass the <code>--regen</code> or <code>-r</code> argument, for example:</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>clientele<span class="w"> </span>generate<span class="w"> </span>-f<span class="w"> </span>example_openapi_specs/best.json<span class="w"> </span>-o<span class="w"> </span>my_client/<span class="w"> </span>--regen<span class="w"> </span>t
</span></code></pre></div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>You can copy and paste the command from the <code>MANIFEST.md</code> file in your previously-generated client for a quick and easy regeneration.</p>
</div>
<h2 id="validate"><code>validate</code></h2>
<p>Validate lets you check if an OpenAPI schema will work with clientele.</p>
<div class="admonition note">
Expand All @@ -624,16 +661,26 @@ <h2 id="validate"><code>validate</code></h2>
<h3 id="from-a-url_1">From a URL</h3>
<p>Use the <code>-u</code> or <code>--url</code> argument.</p>
<p><code>-o</code> or <code>--output</code> is the target directory for the generate client.</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>clientele<span class="w"> </span>validate<span class="w"> </span>-u<span class="w"> </span>http://path.com/to/openapi.json
<div class="language-sh highlight"><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>clientele<span class="w"> </span>validate<span class="w"> </span>-u<span class="w"> </span>http://path.com/to/openapi.json
</span></code></pre></div>
<h3 id="from-a-file-path">From a file path</h3>
<p>Alternatively you can provide a local file using the <code>-f</code> or <code>--file</code> argument.</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>clientele<span class="w"> </span>validate<span class="w"> </span>-f<span class="w"> </span>/path/to/openapi.json
<div class="language-sh highlight"><pre><span></span><code><span id="__span-5-1"><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>clientele<span class="w"> </span>validate<span class="w"> </span>-f<span class="w"> </span>/path/to/openapi.json
</span></code></pre></div>
<h2 id="generate-basic">generate-basic</h2>
<p>The <code>generate-basic</code> command can be used to generate a basic file structure for an HTTP client.</p>
<p>It does not required an OpenAPI schema, just a path.</p>
<p>This command serves two reasons:</p>
<ol>
<li>You may have an HTTP API without an OpenAPI schema and you want to keep a consistent file structure with other Clientele clients.</li>
<li>The generator for this basic client can be extended for your own client in the future, if you choose.</li>
</ol>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-6-1"><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>clientele<span class="w"> </span>generate-basic<span class="w"> </span>-o<span class="w"> </span>my_client/
</span></code></pre></div>
<h2 id="version"><code>version</code></h2>
<p>Print the current version of Clientele:</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-5-1"><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>&gt;<span class="w"> </span>clientele<span class="w"> </span>version
</span><span id="__span-5-2"><a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a>Clientele<span class="w"> </span><span class="m">0</span>.7.0
<div class="language-sh highlight"><pre><span></span><code><span id="__span-7-1"><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a>&gt;<span class="w"> </span>clientele<span class="w"> </span>version
</span><span id="__span-7-2"><a id="__codelineno-7-2" name="__codelineno-7-2" href="#__codelineno-7-2"></a>Clientele<span class="w"> </span><span class="m">0</span>.7.0
</span></code></pre></div>


Expand Down

0 comments on commit 04c4ab1

Please sign in to comment.