Skip to content

Commit

Permalink
deploys docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nf1s committed Apr 3, 2020
1 parent 97d37c0 commit 22d8177
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 34 deletions.
34 changes: 17 additions & 17 deletions site/example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -287,33 +287,33 @@
<h1>Full Example</h1>

<h2 id="how-to-use-full-example">How to use (full example)</h2>
<pre><code class="python">import uvicorn
from fastapi import FastAPI
from fastapi_camelcase import CamelModel
<div class="codehilite"><pre><span></span><code><span class="kn">import</span> <span class="nn">uvicorn</span>
<span class="kn">from</span> <span class="nn">fastapi</span> <span class="kn">import</span> <span class="n">FastAPI</span>
<span class="kn">from</span> <span class="nn">fastapi_camelcase</span> <span class="kn">import</span> <span class="n">CamelModel</span>


class User(CamelModel):
first_name: str
last_name: str
age: int
<span class="k">class</span> <span class="nc">User</span><span class="p">(</span><span class="n">CamelModel</span><span class="p">):</span>
<span class="n">first_name</span><span class="p">:</span> <span class="nb">str</span>
<span class="n">last_name</span><span class="p">:</span> <span class="nb">str</span>
<span class="n">age</span><span class="p">:</span> <span class="nb">int</span>


app = FastAPI()
<span class="n">app</span> <span class="o">=</span> <span class="n">FastAPI</span><span class="p">()</span>


@app.get(&quot;/user/get&quot;, response_model=User)
async def get_user():
return User(first_name=&quot;John&quot;, last_name=&quot;Doe&quot;, age=30)
<span class="nd">@app</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;/user/get&quot;</span><span class="p">,</span> <span class="n">response_model</span><span class="o">=</span><span class="n">User</span><span class="p">)</span>
<span class="k">async</span> <span class="k">def</span> <span class="nf">get_user</span><span class="p">():</span>
<span class="k">return</span> <span class="n">User</span><span class="p">(</span><span class="n">first_name</span><span class="o">=</span><span class="s2">&quot;John&quot;</span><span class="p">,</span> <span class="n">last_name</span><span class="o">=</span><span class="s2">&quot;Doe&quot;</span><span class="p">,</span> <span class="n">age</span><span class="o">=</span><span class="mi">30</span><span class="p">)</span>


@app.post(&quot;/user/create&quot;, response_model=User)
async def create_user(user: User):
return user
<span class="nd">@app</span><span class="o">.</span><span class="n">post</span><span class="p">(</span><span class="s2">&quot;/user/create&quot;</span><span class="p">,</span> <span class="n">response_model</span><span class="o">=</span><span class="n">User</span><span class="p">)</span>
<span class="k">async</span> <span class="k">def</span> <span class="nf">create_user</span><span class="p">(</span><span class="n">user</span><span class="p">:</span> <span class="n">User</span><span class="p">):</span>
<span class="k">return</span> <span class="n">user</span>


if __name__ == &quot;__main__&quot;:
uvicorn.run(app, host=&quot;0.0.0.0&quot;, port=8000)
</code></pre>
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s2">&quot;__main__&quot;</span><span class="p">:</span>
<span class="n">uvicorn</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">app</span><span class="p">,</span> <span class="n">host</span><span class="o">=</span><span class="s2">&quot;0.0.0.0&quot;</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">8000</span><span class="p">)</span>
</code></pre></div>



Expand Down
22 changes: 12 additions & 10 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,19 +310,21 @@ <h1 id="fastapi-camelcase">FastAPI Camelcase</h1>
while keeping your python code snake cased.</p>
<p>Full code can be found on <a href="https://github.com/ahmednafies/fastapi_camelcase">github</a></p>
<h2 id="dependencies">Dependencies</h2>
<pre><code>pydantic
pyhumps
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err">pydantic</span>
<span class="err">pyhumps</span>
</code></pre></div>


<h2 id="usage">Usage</h2>
<pre><code class="python"># using CamelModel instead of Pydantic BaseModel
from fastapi_camelcase import CamelModel
<div class="codehilite"><pre><span></span><code><span class="c1"># using CamelModel instead of Pydantic BaseModel</span>
<span class="kn">from</span> <span class="nn">fastapi_camelcase</span> <span class="kn">import</span> <span class="n">CamelModel</span>


class User(CamelModel):
first_name: str
last_name: str
age: int
</code></pre>
<span class="k">class</span> <span class="nc">User</span><span class="p">(</span><span class="n">CamelModel</span><span class="p">):</span>
<span class="n">first_name</span><span class="p">:</span> <span class="nb">str</span>
<span class="n">last_name</span><span class="p">:</span> <span class="nb">str</span>
<span class="n">age</span><span class="p">:</span> <span class="nb">int</span>
</code></pre></div>



Expand Down
14 changes: 8 additions & 6 deletions site/install/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,18 @@
<h1>Install</h1>

<h2 id="using-pip">Using Pip</h2>
<pre><code class="bash">pip install fastapi-camelcase
</code></pre>
<div class="codehilite"><pre><span></span><code>pip install fastapi-camelcase
</code></pre></div>


<h2 id="using-pipenv">Using Pipenv</h2>
<pre><code class="bash">pipenv install fastapi-camelcase
</code></pre>
<div class="codehilite"><pre><span></span><code>pipenv install fastapi-camelcase
</code></pre></div>


<h2 id="using-poetry">Using poetry</h2>
<pre><code class="bash">poetry add fastapi-camelcase
</code></pre>
<div class="codehilite"><pre><span></span><code>poetry add fastapi-camelcase
</code></pre></div>



Expand Down
2 changes: 1 addition & 1 deletion site/search/search_index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"config":{"lang":["en"],"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"FastAPI Camelcase Package for providing a class for camelizing request and response bodies for fastapi while keeping your python code snake cased. Full code can be found on github Dependencies pydantic pyhumps Usage # using CamelModel instead of Pydantic BaseModel from fastapi_camelcase import CamelModel class User(CamelModel): first_name: str last_name: str age: int","title":"Getting Started"},{"location":"#fastapi-camelcase","text":"Package for providing a class for camelizing request and response bodies for fastapi while keeping your python code snake cased. Full code can be found on github","title":"FastAPI Camelcase"},{"location":"#dependencies","text":"pydantic pyhumps","title":"Dependencies"},{"location":"#usage","text":"# using CamelModel instead of Pydantic BaseModel from fastapi_camelcase import CamelModel class User(CamelModel): first_name: str last_name: str age: int","title":"Usage"},{"location":"example/","text":"How to use (full example) import uvicorn from fastapi import FastAPI from fastapi_camelcase import CamelModel class User(CamelModel): first_name: str last_name: str age: int app = FastAPI() @app.get(\"/user/get\", response_model=User) async def get_user(): return User(first_name=\"John\", last_name=\"Doe\", age=30) @app.post(\"/user/create\", response_model=User) async def create_user(user: User): return user if __name__ == \"__main__\": uvicorn.run(app, host=\"0.0.0.0\", port=8000)","title":"Full Example"},{"location":"example/#how-to-use-full-example","text":"import uvicorn from fastapi import FastAPI from fastapi_camelcase import CamelModel class User(CamelModel): first_name: str last_name: str age: int app = FastAPI() @app.get(\"/user/get\", response_model=User) async def get_user(): return User(first_name=\"John\", last_name=\"Doe\", age=30) @app.post(\"/user/create\", response_model=User) async def create_user(user: User): return user if __name__ == \"__main__\": uvicorn.run(app, host=\"0.0.0.0\", port=8000)","title":"How to use (full example)"},{"location":"install/","text":"Using Pip pip install fastapi-camelcase Using Pipenv pipenv install fastapi-camelcase Using poetry poetry add fastapi-camelcase","title":"Install"},{"location":"install/#using-pip","text":"pip install fastapi-camelcase","title":"Using Pip"},{"location":"install/#using-pipenv","text":"pipenv install fastapi-camelcase","title":"Using Pipenv"},{"location":"install/#using-poetry","text":"poetry add fastapi-camelcase","title":"Using poetry"}]}
{"config":{"lang":["en"],"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"FastAPI Camelcase Package for providing a class for camelizing request and response bodies for fastapi while keeping your python code snake cased. Full code can be found on github Dependencies pydantic pyhumps Usage # using CamelModel instead of Pydantic BaseModel from fastapi_camelcase import CamelModel class User ( CamelModel ): first_name : str last_name : str age : int","title":"Getting Started"},{"location":"#fastapi-camelcase","text":"Package for providing a class for camelizing request and response bodies for fastapi while keeping your python code snake cased. Full code can be found on github","title":"FastAPI Camelcase"},{"location":"#dependencies","text":"pydantic pyhumps","title":"Dependencies"},{"location":"#usage","text":"# using CamelModel instead of Pydantic BaseModel from fastapi_camelcase import CamelModel class User ( CamelModel ): first_name : str last_name : str age : int","title":"Usage"},{"location":"example/","text":"How to use (full example) import uvicorn from fastapi import FastAPI from fastapi_camelcase import CamelModel class User ( CamelModel ): first_name : str last_name : str age : int app = FastAPI () @app . get ( \"/user/get\" , response_model = User ) async def get_user (): return User ( first_name = \"John\" , last_name = \"Doe\" , age = 30 ) @app . post ( \"/user/create\" , response_model = User ) async def create_user ( user : User ): return user if __name__ == \"__main__\" : uvicorn . run ( app , host = \"0.0.0.0\" , port = 8000 )","title":"Full Example"},{"location":"example/#how-to-use-full-example","text":"import uvicorn from fastapi import FastAPI from fastapi_camelcase import CamelModel class User ( CamelModel ): first_name : str last_name : str age : int app = FastAPI () @app . get ( \"/user/get\" , response_model = User ) async def get_user (): return User ( first_name = \"John\" , last_name = \"Doe\" , age = 30 ) @app . post ( \"/user/create\" , response_model = User ) async def create_user ( user : User ): return user if __name__ == \"__main__\" : uvicorn . run ( app , host = \"0.0.0.0\" , port = 8000 )","title":"How to use (full example)"},{"location":"install/","text":"Using Pip pip install fastapi-camelcase Using Pipenv pipenv install fastapi-camelcase Using poetry poetry add fastapi-camelcase","title":"Install"},{"location":"install/#using-pip","text":"pip install fastapi-camelcase","title":"Using Pip"},{"location":"install/#using-pipenv","text":"pipenv install fastapi-camelcase","title":"Using Pipenv"},{"location":"install/#using-poetry","text":"poetry add fastapi-camelcase","title":"Using poetry"}]}
Binary file modified site/sitemap.xml.gz
Binary file not shown.

0 comments on commit 22d8177

Please sign in to comment.