<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: carrot.py</title>
    <description>The latest articles on DEV Community by carrot.py (@carrotdotpy).</description>
    <link>https://dev.to/carrotdotpy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F844557%2Fa2280909-a82f-4f7d-98da-dcfef877d403.jpg</url>
      <title>DEV Community: carrot.py</title>
      <link>https://dev.to/carrotdotpy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/carrotdotpy"/>
    <language>en</language>
    <item>
      <title>Sneak peak into Git LFS(Large File Storage System)</title>
      <dc:creator>carrot.py</dc:creator>
      <pubDate>Sat, 24 Dec 2022 18:40:46 +0000</pubDate>
      <link>https://dev.to/carrotdotpy/sneak-peak-into-git-lfslarge-file-system-1lao</link>
      <guid>https://dev.to/carrotdotpy/sneak-peak-into-git-lfslarge-file-system-1lao</guid>
      <description>&lt;p&gt;Hi Folks,&lt;/p&gt;

&lt;p&gt;Yes! I'm back with an interesting blog &lt;code&gt;Git LFS&lt;/code&gt;- An  file storage system by git (basically to store large files above 100Mb)&lt;/p&gt;

&lt;p&gt;A small back story How I came to know about this!&lt;/p&gt;

&lt;p&gt;Recently my colleague  asked me &lt;code&gt;Have you ever worked in git Lfs ?&lt;/code&gt; I just ignored him  like this and get back to my work&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feb7rfex9benjlkazjdpo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feb7rfex9benjlkazjdpo.gif" alt="Image description" width="400" height="400"&gt;&lt;/a&gt;  Lately, my Manager told us to push  changes we were working on for a month(it includes 500Mb of CSV and txt files) when we try to Push it to the remote&lt;br&gt;
git tell us this &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwrqzd5w7y631wux7c3g.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwrqzd5w7y631wux7c3g.gif" alt="Image description" width="498" height="280"&gt;&lt;/a&gt;&lt;br&gt;
Yes! it throws the error &lt;code&gt;Files with larger size should be tracked through LFS&lt;/code&gt;, &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi8qgbp84zs32tpz7dbgh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi8qgbp84zs32tpz7dbgh.png" alt="Image description" width="800" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;it almost spoiled our holiday eve!!&lt;br&gt;
After spending almost a day, we figured out what is Git LFS and how to push the files!!!!&lt;br&gt;
Here are some Steps to start with Git LFS and some important points so that it won't  spoils Your Holiday eve&lt;/p&gt;

&lt;p&gt;What is Git LFS?&lt;/p&gt;

&lt;p&gt;Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git while storing the file contents on a remote server &lt;/p&gt;

&lt;p&gt;OK, Enough is Enough!&lt;br&gt;
Let's Push Files!&lt;/p&gt;

&lt;p&gt;Before getting started we need to install git LFS!&lt;br&gt;
if you are a Mac user use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install git-lfs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for other os platforms please refer &lt;a href="https://git-lfs.com/" rel="noopener noreferrer"&gt;this&lt;/a&gt;&lt;br&gt;
In my case, I gonna initiate new repo and some dummy files with 200Mb size &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftg8nvl10lk02lb5f1uxc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftg8nvl10lk02lb5f1uxc.png" alt="Image description" width="800" height="143"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's add the 200Mb into LFS &lt;/p&gt;

&lt;p&gt;I assume you know basic git actions(add, commit,push)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Step-1: This command will set up the Git LFS in your current repo&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git lfs install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygu5e6tivsnk8vdhdpcs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygu5e6tivsnk8vdhdpcs.png" alt="Image description" width="772" height="92"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Step-2: We need to tell git which type of files or which files needed to be tracked to LFS. The below command will create &lt;code&gt;.gitattributes&lt;/code&gt; file contains a list of tracked files&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git lfs track "*.csv"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ffl5ci1zkct1ejhtpp4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ffl5ci1zkct1ejhtpp4.png" alt="Image description" width="800" height="58"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;if You are working in psd files and need to add all the psd files in LFS means you will give a pattern like &lt;code&gt;"*.psd"&lt;/code&gt;&lt;br&gt;
OR &lt;br&gt;
if you need to add all the file under some folder You can give like &lt;code&gt;path/folder_name/**&lt;/code&gt; this will add all the files under the path&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Step-3: Now add the .gitattributes and commit it as we do before&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .

git commit -m "initial commit"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will add all the changed files to the stage and commit those!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Step -4 : Make sure that all Your files are tracked in LFS use the below command to see the list of tracked  files&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git lfs ls-files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fih937l3z6rxg337gor97.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fih937l3z6rxg337gor97.png" alt="Image description" width="800" height="65"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Step -5 : Let's push use the command to push the large file First&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git lfs push --all origin &amp;lt;branch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1be9rzosm4lw84ggesb4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1be9rzosm4lw84ggesb4.png" alt="Image description" width="800" height="54"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then  regular push&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flecntdgkdad79bboigsi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flecntdgkdad79bboigsi.png" alt="Image description" width="800" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tada, it's all done!&lt;/p&gt;

&lt;p&gt;Points to remember!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make sure the file format is correct and not corrupted&lt;/li&gt;
&lt;li&gt;Files above 100 MB should be added via Git LFS below that we can add through regular git actions&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Thanks, &lt;a class="mentioned-user" href="https://dev.to/iamadhee"&gt;@iamadhee&lt;/a&gt; (Lol! he is the colleague I ignored)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thanks! folks Thanks for reading &lt;br&gt;
Let me know your experience in comment section after using git LFS and the struggles you faced, I will try to post the fix :)&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Algorithms and Data structure- A heads up</title>
      <dc:creator>carrot.py</dc:creator>
      <pubDate>Thu, 06 Oct 2022 14:51:24 +0000</pubDate>
      <link>https://dev.to/carrotdotpy/algorithms-and-data-structure-a-heads-up-1pf4</link>
      <guid>https://dev.to/carrotdotpy/algorithms-and-data-structure-a-heads-up-1pf4</guid>
      <description>&lt;p&gt;Hi Folks,&lt;/p&gt;

&lt;p&gt;Before getting into it we all have come across the word saying "what algorithm you used to solve this problem?" and our answer obviously is&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XsXAKqU7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o08uz36ayxzq4j0mxvps.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XsXAKqU7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o08uz36ayxzq4j0mxvps.gif" alt="Image description" width="320" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This Blog-series talks about the basics of algorithms and DS(Data Structure), this blog will give you a little heads up on Algorithm ok let's learn algo(awɡu)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;what is Algorithms?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;An algorithm is any well-defined computational procedure that takes some value, as input and produces some value, or set of values, as output. An algorithm is thus a sequence of computational steps that transform the input into the output.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In simple terms let's say you need to drop your friend at the Railway station before 10 pm, For that you need to build an algorithm to find the Shortest Route (which is your output), you would consider their parameters the distance, number of alternative routes, speed, traffic and time(these are your input) using which you can do some analysis and come up with the shortest route &lt;/p&gt;

&lt;p&gt;likewise, the algorithm is a series of steps that is implemented with the given input to get the desired output.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;why the Algorithm is needed to solve a problem?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;From the above example if you go on your wish you cant drop your friend at the correct time, similarly, a computational operation working on an algorithm can give you the desired output efficiently&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is a Data structure?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;A data structure is a way to store and organize data in an ordered fashion. so that it's easy to access and manipulate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;it's good to learn many DS as possible so that it's easy to build or implement an algorithm &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Algorithm in real-life!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;we might wonder are we using those in real life! the answer would be yes and some of the examples are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Search algorithms- When we search a file in folder or a link in the internet it uses any of the famous search algorithms to get the result at minimal time&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;E-commerce - Technologies used in electronic commerce include encryption and digital signatures which are based on numerical algorithms&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To sum up These are some Infos to know about Algorithms and DS we will see more about them in later part of the Series &lt;/p&gt;

&lt;p&gt;Thank You!!&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>beginners</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>LET'S HIT. (A blog post about Fast Api)</title>
      <dc:creator>carrot.py</dc:creator>
      <pubDate>Wed, 25 May 2022 08:25:30 +0000</pubDate>
      <link>https://dev.to/carrotdotpy/lets-hit-a-blog-post-about-fast-api-37h2</link>
      <guid>https://dev.to/carrotdotpy/lets-hit-a-blog-post-about-fast-api-37h2</guid>
      <description>&lt;p&gt;Hi Guys!&lt;/p&gt;

&lt;p&gt;We are all know about API and of course some of us have used it already and some of us are building it already in different languages. Here we lets see about Fast Api(one of the popular api module in python),why its so popular?,Its Pros and How to build it! &lt;/p&gt;

&lt;p&gt;Let's HiT🔥🔥&lt;/p&gt;

&lt;p&gt;At First What is Fast Api?, why Fast Api? ,we have well established frameworks in python like Django, Flask why we need to use Fast Api?&lt;br&gt;
What is Fast Api?&lt;br&gt;
FastAPI is an ASGI web framework&lt;/p&gt;

&lt;p&gt;Why Fast Api?&lt;/p&gt;

&lt;p&gt;Here some of reason to use Fast Api stated by &lt;a href="https://fastapi.tiangolo.com/"&gt;the creator&lt;/a&gt;&lt;br&gt;
&lt;code&gt;Fast: Very high performance, on par with NodeJS and Go (thanks to Starlette and Pydantic). One of the fastest Python frameworks available.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Fast to code: Increase the speed to develop an api&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Fewer bugs: Reduce about 40% of human (developer) induced errors&lt;/code&gt;&lt;br&gt;
&lt;code&gt;Intuitive: Great editor support. Completion everywhere. Less time debugging.&lt;/code&gt;&lt;br&gt;
&lt;code&gt;Easy: Designed to be easy to use and learn. Less time reading docs.&lt;/code&gt;&lt;br&gt;
&lt;code&gt;Robust: Get production-ready code. With automatic interactive documentation&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The feature i really like about Fast Api  is documentation, offered by (Redoc and Swagger UI) its very Easy to debug and Test the Api you build!! Alright. Story time ends Here!! its time to build One&lt;/p&gt;

&lt;p&gt;Its Hero time😅!&lt;/p&gt;

&lt;p&gt;1.initially lets create an virtual environment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;syntex:python3 -m venv &amp;lt;path you wish to create&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Eg:&lt;code&gt;python3 -m venv /Users/d.r/carrotpy/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2.Now a Folder is created at the path you specify, open the folder in any of the IDE (says VS-Code since its Famous)&lt;/p&gt;

&lt;p&gt;In order to use venv we need to activate it&lt;br&gt;
navigate into the folder and give the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;syntex: source bin/activate 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Eg:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_OFwUjgF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ytkdsslu2hp8etl2txbb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_OFwUjgF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ytkdsslu2hp8etl2txbb.png" alt="Image description" width="744" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3.Install the Fast Api and uvicorn into the venv&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install fastapi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install uvicorn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Here the code to get the vegetable name and count from the user and return it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from typing import Optional
# if we need some parameter to be optional we use typing
import uvicorn
#it is ASGI
from fastapi import FastAPI
#importing Fast Api
app = FastAPI()
#declaring Fast Api

#start of Decorators
#When you hit the address http://127.0.0.1:8000/ This will return {"Hello": "World"}  as dict 
@app.get("/")
def carrotgreetings():
    return "Hello Rabbit"

# this will retun the vegtable name and its count
@app.get("/veglist/{vegtable}/")
def read_item(vegtable: str, count: Optional[str] = None):
    return {"vegtable": vegtable, "count": count}

if __name__ == "__main__":
    uvicorn.run("fastapi_demo:app", host='127.0.0.1', port=8000, reload=True)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.Run the Code by the comment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Syntex:`python3 &amp;lt;filename&amp;gt;`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Eg: python3 fastapi_demo.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now hit the api by clicking &lt;a href="http://127.0.0.1:8000/"&gt;http://127.0.0.1:8000/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see the docs by &lt;a href="http://127.0.0.1:8000/docs"&gt;http://127.0.0.1:8000/docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can pass the Vegtable names and count by&lt;br&gt;
&lt;a href="http://127.0.0.1:8000/veglist/carrot/?count=2"&gt;http://127.0.0.1:8000/veglist/carrot/?count=2&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AeVptsmC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7rprgc7bof5bj7kpfoht.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AeVptsmC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7rprgc7bof5bj7kpfoht.png" alt="Image description" width="880" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;wow! we made the api....&lt;/p&gt;

</description>
      <category>python</category>
      <category>fastapiandnodemcu</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
