FastAPI is a modern, fast (high-performance), web framework for building APIs with Python based on standard Python type hints.
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python based on standard Python type hints.
FastAPI არის თანამედროვე, სწრაფი (მაღალი წარმადობის მქონე), Python-ზე დაფუძნებული ვებფრეიმვორქი, რომელიც იყენებს Python-ის სტანდარტულ ტიპთა ინდიკატორებს და საშუალებას გვაძლევს შევქმნათ API-ები.
FastAPI არის თანამედროვე, სწრაფი (მაღალი წარმადობის მქონე), Python-ზე დაფუძნებული ვებფრეიმვორქი, რომელიც იყენებს Python-ის სტანდარტულ ტიპთა ანოტაციებს და საშუალებას გვაძლევს შევქმნათ API-ები.
The key features are:
The key features are:
მისი ძირითადი მახასიათებლები გახლავთ:
მისი ძირითადი მახასიათებლები გახლავთ:
@ -49,7 +49,7 @@ The key features are:
* **Fewer bugs**: Reduce about 40% of human (developer) induced errors. *
* **Fewer bugs**: Reduce about 40% of human (developer) induced errors. *
* **ნაკლები პროგრამული ხარვეზი**: ადამიანის (დეველოპერის) მიერ გამოწვეული ხარვეზების ალბათობას ამცირებს დაახლოებით 40 პროცენტით. *
* **ნაკლები პროგრამული ხარვეზი**: ადამიანის (დეველოპერის) მიერ გამოწვეული ხარვეზების ალბათობას ამცირებს დაახლოებით 40 პროცენტით. *
* **Intuitive**: Great editor support. <abbrtitle="also known as auto-complete, autocompletion, IntelliSense">Completion</abbr> everywhere. Less time debugging.
* **Intuitive**: Great editor support. <abbrtitle="also known as auto-complete, autocompletion, IntelliSense">Completion</abbr> everywhere. Less time debugging.
* **ინტუიციურობა**: შესანიშნავი თავსებადობა ტექსტურ რედაქტორებთან. <abbrtitle="also known as auto-complete, autocompletion, IntelliSense">კოდის ავტოდასრულების</abbr> ფუნქციონალი ხელმისაწვდომია ყველგან. ნაკლებ დროს დახარჯავთ ხარვეზების აღმოფხვრაში.
* **ინტუიციურობა**: შესანიშნავი თავსებადობა ტექსტურ რედაქტორებთან. <abbrtitle="ასევე ცნობილია, როგორც: ავტოდასრულება, ავტომატური დასრულება, IntelliSense-ი">კოდის ავტოდასრულების</abbr> ფუნქციონალი ხელმისაწვდომია ყველგან. ნაკლებ დროს დახარჯავთ ხარვეზების აღმოფხვრაში.
* **Easy**: Designed to be easy to use and learn. Less time reading docs.
* **Easy**: Designed to be easy to use and learn. Less time reading docs.
* **სიმარტივე**: ტექნოლოგია შემუშავებულია იმგვარად, რომ მარტივად გამოსაყენებელი და ასათვისებელი იყოს. დოკუმენტაციის კითხვაში ნაკლებ დროს დახარჯავთ.
* **სიმარტივე**: ტექნოლოგია შემუშავებულია იმგვარად, რომ მარტივად გამოსაყენებელი და ასათვისებელი იყოს. დოკუმენტაციის კითხვაში ნაკლებ დროს დახარჯავთ.
* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
"_[...] ბოლო დროს, ძალიან ხშირად ვიყენებ **FastAPI**-ს. [...] სიმართლე გითხრათ, მის გამოყენებას ვაპირებ ყველა იმ **ML სერვისისათვის Microsoft-ში**, რაზეც კი ჩემი გუნდი მუშაობს. ამ სერვისებიდან ზოგიერთი ინტეგრირებულია **Windows**-ის ბირთვში, ზოგი კი — **Office**-ის პროდუქტებში._"
"_[...] ბოლო დროს, ძალიან ხშირად ვიყენებ **FastAPI**-ს. [...] სიმართლე გითხრათ, მის გამოყენებას ვაპირებ ყველა იმ **ML სერვისისთვის Microsoft-ში**, რაზეც კი ჩემი გუნდი მუშაობს. აღნიშნული სერვისებიდან ზოგიერთი ინტეგრირებულია **Windows**-ის ბირთვში, ზოგი კი — **Office**-ის პროდუქტებში._"
"_**Netflix**-ის სახელით, მოხარული ვარ, გაცნობოთ ჩვენი კრიტიკული ინფრასტრუქტურის, **Dispatch**-ის წყაროს ღია რელიზის შესახებ! [რომელიც შექმნილია **FastAPI**-ს გამოყენებით]_"
"_**Netflix**-ის სახელით, მოხარული ვარ, გაცნობოთ ჩვენი **კრიზისის მართვის** ორკესტრაციის სისტემის, **Dispatch**-ის წყაროს ღია რელიზის შესახებ! [რომელიც შექმნილია **FastAPI**-ს გამოყენებით]_"
"_თუ შესწავლის მიზნით ეძებთ **თანამედროვე ფრეიმვორქს**, რომლითაც შეძლებთ REST API-ების შექმნას, თვალი გადაავლეთ **FastAPI**-ს [...] იგი არის სწრაფი, ასათვისებლად და გამოსაყენებლად მარტივი [...]_"
"_თუ **თანამედროვე ფრეიმვორქს** ეძებთ, რომლითაც REST API-ების შექმნა შესაძლებელია, გაიცანით **FastAPI**-ი [...] იგი არის სწრაფი, მარტივი გამოსაყენებელი და ადვილად შესასწავლი [...]_"
"_ჩვენი **API**-ები გადავაწყეთ**FastAPI**-ზე [...] ვფიქრობ, აღნიშნული ფრეიმვორქი გულგრილს არავის დატოვებს [...]_"
"_ჩვენ გადავაწყეთ ჩვენი **API**-ები **FastAPI**-ზე [...] ვფიქრობ, აღნიშნული ფრეიმვორქი გულგრილს არავის დატოვებს [...]_"
"_თუკი ვინმე აპირებს Python-ზე დაფუძნებული, წარმოებაში ჩასაშვებად ვარგისი API-ი შექმნას, შემიძლია **FastAPI**-ის გამოყენება ვურჩიო. იგი არის **დახვეწილი**, **გამოსაყენებლად მარტივი** და **ძალზე მასშტაბირებადი** ტექნოლოგია, იგი გახდა API-ების შემუშავების ჩვენეული სტრატეგიის **ქვაკუთხედი** და სწორედ მისი გამოყენებითაა შემუშავებული ჩვენი არაერთი ავტომატიზაციის სისტემა და სერვისები, როგირიცაა მაგალითად ჩვენი ვირტუალური TAC ინჟინერი._"
"_თუ ვინმე აპირებს Python-ზე დაფუძნებული, წარმოებაში ჩასაშვებად ვარგისი API-ი შექმნას, **FastAPI**-ის გამოყენებას ვურჩევ. იგი არის **დახვეწილი**, **მარტივად გამოსაყენებელი** და **მასშტაბირებადი** ტექნოლოგია. იგი გახდა API-ების შემუშავების ჩვენეული სტრატეგიის **ქვაკუთხედი** და სწორედ მისი გამოყენებითაა შემუშავებული ჩვენი არაერთი ავტომატიზაციის სისტემა და სერვისები, მათ შორის ჩვენი ვირტუალური TAC ინჟინერი._"
If you are building a <abbrtitle="Command Line Interface">CLI</abbr> app to be used in the terminal instead of a web API, check out <ahref="https://typer.tiangolo.com/"class="external-link"target="_blank">**Typer**</a>.
If you are building a <abbrtitle="Command Line Interface">CLI</abbr> app to be used in the terminal instead of a web API, check out <ahref="https://typer.tiangolo.com/"class="external-link"target="_blank">**Typer**</a>.
თუკი მუშაობთ <abbrtitle="ბრძანებათა სტრიქონი">CLI</abbr> აპლიკაციაზე, რომელიც გამოყენებულ იქნება ტერმინალში, - ნაცვლად ვებ API-ისა, თვალი შეავლეთ <ahref="https://typer.tiangolo.com/"class="external-link"target="_blank">**Typer**-ს</a>.
თუკი მუშაობთ <abbrtitle="ბრძანებათა სტრიქონი">CLI</abbr> აპლიკაციაზე, რომელიც გამოყენებულ იქნება ტერმინალში ვებ API-ის ნაცვლად, გაეცანით <ahref="https://typer.tiangolo.com/"class="external-link"target="_blank">**Typer**-ს</a>.
**Typer** is FastAPI's little sibling. And it's intended to be the **FastAPI of CLIs**. ⌨️ 🚀
**Typer** is FastAPI's little sibling. And it's intended to be the **FastAPI of CLIs**. ⌨️ 🚀
**Typer** არის FastAPI-ის პატარა ძამიკო. და ჩაფიქრებულია, რომ იგი იყოს **CLI-ების FastAPI**. ⌨️ 🚀
**Typer**-ი არის FastAPI-ის პატარა ძამიკო. მისი დანიშნულებაა, იყოს **ბრძანებათა სტრიქონის FastAPI**. ⌨️ 🚀
## Requirements
## Requirements
## მოთხოვნები
## მოთხოვნები
@ -183,9 +183,9 @@ FastAPI stands on the shoulders of giants:
FastAPI მხრებზე შემოსდგომია შემდეგ გიგანტებს:
FastAPI მხრებზე შემოსდგომია შემდეგ გიგანტებს:
* <ahref="https://www.starlette.io/"class="external-link"target="_blank">Starlette</a> for the web parts.
* <ahref="https://www.starlette.io/"class="external-link"target="_blank">Starlette</a> for the web parts.
* <ahref="https://www.starlette.io/"class="external-link"target="_blank">Starlette</a>-ს ვებთან დაკავშირებულ საკითხებში.
* <ahref="https://www.starlette.io/"class="external-link"target="_blank">Starlette</a>: ვების ნაწილში.
* <ahref="https://docs.pydantic.dev/"class="external-link"target="_blank">Pydantic</a> for the data parts.
* <ahref="https://docs.pydantic.dev/"class="external-link"target="_blank">Pydantic</a> for the data parts.
* <ahref="https://docs.pydantic.dev/"class="external-link"target="_blank">Pydantic</a>-ს მონაცემებთან დაკავშირებულ საკითხებში.
* <ahref="https://docs.pydantic.dev/"class="external-link"target="_blank">Pydantic</a>: მონაცემების ნაწილში.
If you don't know, check the _"In a hurry?"_ section about <ahref="https://fastapi.tiangolo.com/async/#in-a-hurry"target="_blank">`async` and `await` in the docs</a>.
If you don't know, check the _"In a hurry?"_ section about <ahref="https://fastapi.tiangolo.com/async/#in-a-hurry"target="_blank">`async` and `await` in the docs</a>.
თუკი ჯერ არ ერკვევით აღნიშნულ საკითხში, <ahref="https://fastapi.tiangolo.com/async/#in-a-hurry"target="_blank">`async`-ისა და `await`-ის შესახებ</a> დოკუმენტაციაში თვალი გადაავლეთ განყოფილებას_„გეჩქარებათ?“_.
თუკი ჯერ ვერ ერკვევით აღნიშნულ საკითხში, <ahref="https://fastapi.tiangolo.com/async/#in-a-hurry"target="_blank">`async`-ისა და `await`-ის შესახებ</a> დოკუმენტაციაში გადახედეთ განყოფილებას სათაურით:_„გეჩქარებათ?“_.
</details>
</details>
@ -301,10 +301,10 @@ The command `fastapi dev` reads your `main.py` file, detects the **FastAPI** app
`fastapi dev` ბრძანება კითხულობს თქვენს `main.py` ფაილს, მასში **FastAPI** აპლიკაციას აიდენტიფიცირებს და <ahref="https://www.uvicorn.org"class="external-link"target="_blank">Uvicorn</a>-ის გამოყენებით უშვებს სერვერს.
`fastapi dev` ბრძანება კითხულობს თქვენს `main.py` ფაილს, მასში **FastAPI** აპლიკაციას აიდენტიფიცირებს და <ahref="https://www.uvicorn.org"class="external-link"target="_blank">Uvicorn</a>-ის გამოყენებით უშვებს სერვერს.
By default, `fastapi dev` will start with auto-reload enabled for local development.
By default, `fastapi dev` will start with auto-reload enabled for local development.
ნაგულისხმევად, ლოკალური დეველოპმენტისთვის, `fastapi dev` ბრძანებით გაშვებული სერვერისათვის აქტივირებული იქნება ავტომატური გადატვირთვის ფუნქცია.
ნაგულისხმევად, ლოკალური დეველოპმენტისთვის, `fastapi dev` ბრძანებით გაშვებული სერვერისთვის აქტივირებული იქნება ავტოგადატვირთვის ფუნქცია.
You can read more about it in the <ahref="https://fastapi.tiangolo.com/fastapi-cli/"target="_blank">FastAPI CLI docs</a>.
You can read more about it in the <ahref="https://fastapi.tiangolo.com/fastapi-cli/"target="_blank">FastAPI CLI docs</a>.
ამ საკითხზე დეტალური ინფორმაცია შეგიძლიათ წაიკითხოთ <ahref="https://fastapi.tiangolo.com/fastapi-cli/"target="_blank">FastAPI CLI-ის დოკუმენტაციაში</a>.
ამ საკითხთან დაკავშირებით დამატებითი ინფორმაცია შეგიძლიათ წაიკითხოთ <ahref="https://fastapi.tiangolo.com/fastapi-cli/"target="_blank">FastAPI CLI-ის დოკუმენტაციაში</a>.
</details>
</details>
@ -315,7 +315,7 @@ Open your browser at <a href="http://127.0.0.1:8000/items/5?q=somequery" class="
თქვენს ბრაუზერში გახსენით შემდეგი ბმული: <ahref="http://127.0.0.1:8000/items/5?q=somequery"class="external-link"target="_blank">http://127.0.0.1:8000/items/5?q=somequery</a>.
თქვენს ბრაუზერში გახსენით შემდეგი ბმული: <ahref="http://127.0.0.1:8000/items/5?q=somequery"class="external-link"target="_blank">http://127.0.0.1:8000/items/5?q=somequery</a>.
You will see the JSON response as:
You will see the JSON response as:
დაინახავთ შემდეგნაირ JSON ტიპის მონაცემს:
დაინახავთ JSON ფორმატის მქონე მონაცემს:
```JSON
```JSON
{"item_id": 5, "q": "somequery"}
{"item_id": 5, "q": "somequery"}
@ -334,21 +334,21 @@ You already created an API that:
* `/items/{item_id}` მისამართს გააჩნია არასავალდებულო სტრიქონის (`str`) ტიპის _საძიებო (query) პარამეტრი_`q`.
* `/items/{item_id}` მისამართს გააჩნია არასავალდებულო სტრიქონის (`str`) ტიპის _საძიებო (query) პარამეტრი_`q`.
### Interactive API docs
### Interactive API docs
### ინტერაქციული API-დოკუმენტაცია
### ინტერაქციული APIდოკუმენტაცია
Now go to <ahref="http://127.0.0.1:8000/docs"class="external-link"target="_blank">http://127.0.0.1:8000/docs</a>.
Now go to <ahref="http://127.0.0.1:8000/docs"class="external-link"target="_blank">http://127.0.0.1:8000/docs</a>.
ახლა კი, თქვენს ბრაუზერში გახსენით შემდეგი ბმული: <ahref="http://127.0.0.1:8000/docs"class="external-link"target="_blank">http://127.0.0.1:8000/docs</a>.
გახსენით თქვენი ბრაუზერი და შედით ბმულზე: <ahref="http://127.0.0.1:8000/docs"class="external-link"target="_blank">http://127.0.0.1:8000/docs</a>.
You will see the automatic interactive API documentation (provided by <ahref="https://github.com/swagger-api/swagger-ui"class="external-link"target="_blank">Swagger UI</a>):
You will see the automatic interactive API documentation (provided by <ahref="https://github.com/swagger-api/swagger-ui"class="external-link"target="_blank">Swagger UI</a>):
დაინახავთ ავტომატურად გენერირებულ ინტერაქციულ API-დოკუმენტაციას (რომელიც უზრუნველყოფილია <ahref="https://github.com/swagger-api/swagger-ui"class="external-link"target="_blank">Swagger UI</a>-ის მიერ):
დაინახავთ ავტომატურად გენერირებულ ინტერაქციულ APIდოკუმენტაციას (რომელიც უზრუნველყოფილია <ahref="https://github.com/swagger-api/swagger-ui"class="external-link"target="_blank">Swagger UI</a>-ის მიერ):
And now, go to <ahref="http://127.0.0.1:8000/redoc"class="external-link"target="_blank">http://127.0.0.1:8000/redoc</a>.
And now, go to <ahref="http://127.0.0.1:8000/redoc"class="external-link"target="_blank">http://127.0.0.1:8000/redoc</a>.
თქვენს ბრაუზერში გახსენით შემდეგი ბმული: <ahref="http://127.0.0.1:8000/redoc"class="external-link"target="_blank">http://127.0.0.1:8000/redoc</a>.
ბრაუზერში გახსენით შემდეგი ბმული: <ahref="http://127.0.0.1:8000/redoc"class="external-link"target="_blank">http://127.0.0.1:8000/redoc</a>.
You will see the alternative automatic documentation (provided by <ahref="https://github.com/Rebilly/ReDoc"class="external-link"target="_blank">ReDoc</a>):
You will see the alternative automatic documentation (provided by <ahref="https://github.com/Rebilly/ReDoc"class="external-link"target="_blank">ReDoc</a>):
დაინახავთ ალტერნატიულ ავტომატურად გენერირებულ დოკუმენტაციას (რომელიც უზრუნველყოფილია <ahref="https://github.com/Rebilly/ReDoc"class="external-link"target="_blank">ReDoc</a>-ის მიერ):
დაინახავთ ალტერნატიულ ავტომატურად გენერირებულ დოკუმენტაციას (რომელიც უზრუნველყოფილია <ahref="https://github.com/Rebilly/ReDoc"class="external-link"target="_blank">ReDoc</a>-ის მიერ):
@ -359,7 +359,7 @@ You will see the alternative automatic documentation (provided by <a href="https
## გაუმჯობესების მაგალითი
## გაუმჯობესების მაგალითი
Now modify the file `main.py` to receive a body from a `PUT` request.
Now modify the file `main.py` to receive a body from a `PUT` request.
მოდით, შევცვალოთ `main.py` ფაილის შიგთავსი იმგვარად, რომ `PUT` ტიპის მოთხოვნით მივიღოთ და დავამუშავოთ მონაცემები.
მოდით, შევცვალოთ `main.py` ფაილის შიგთავსი იმგვარად, რომ `PUT` ტიპის მოთხოვნით შევძლოთ მონაცემების მიღება.
Declare the body using standard Python types, thanks to Pydantic.
Declare the body using standard Python types, thanks to Pydantic.
მოვახდინოთ მოთხოვნის შიგთავსის პროტოტიპის დეკლარაცია Python-ის სტანდარტული ტიპების გამოყენებით. ამ შესაძლებლობას Pydantic-ს უნდა ვუმადლოდეთ.
მოვახდინოთ მოთხოვნის შიგთავსის პროტოტიპის დეკლარაცია Python-ის სტანდარტული ტიპების გამოყენებით. ამ შესაძლებლობას Pydantic-ს უნდა ვუმადლოდეთ.
@ -398,19 +398,19 @@ The `fastapi dev` server should reload automatically.
ცვლილებების შენახვის შემდეგ, `fastapi dev` ბრძანებით გაშვებული სერვერი, წესით და რიგით, ავტომატურად გადაიტვირთება.
ცვლილებების შენახვის შემდეგ, `fastapi dev` ბრძანებით გაშვებული სერვერი, წესით და რიგით, ავტომატურად გადაიტვირთება.
### Interactive API docs upgrade
### Interactive API docs upgrade
### გავაუმჯობესოთ ინტერაქციული API-დოკუმენტაცია
### გავაუმჯობესოთ ინტერაქციული APIდოკუმენტაცია
Now go to <ahref="http://127.0.0.1:8000/docs"class="external-link"target="_blank">http://127.0.0.1:8000/docs</a>.
Now go to <ahref="http://127.0.0.1:8000/docs"class="external-link"target="_blank">http://127.0.0.1:8000/docs</a>.
თქვენს ბრაუზერში გახსენით შემდეგი ბმული: <ahref="http://127.0.0.1:8000/docs"class="external-link"target="_blank">http://127.0.0.1:8000/docs</a>.
თქვენს ბრაუზერში გახსენით შემდეგი ბმული: <ahref="http://127.0.0.1:8000/docs"class="external-link"target="_blank">http://127.0.0.1:8000/docs</a>.
* The interactive API documentation will be automatically updated, including the new body:
* The interactive API documentation will be automatically updated, including the new body:
* ინტერაქციული API-დოკუმენტაცია, ახლად დამატებული პროტოტიპის ჩათვლით, განახლდება ავტომატურად:
* ინტერაქციული APIდოკუმენტაცია, ახლად დამატებული პროტოტიპის ჩათვლით, განახლდება ავტომატურად:
And now, go to <ahref="http://127.0.0.1:8000/redoc"class="external-link"target="_blank">http://127.0.0.1:8000/redoc</a>.
And now, go to <ahref="http://127.0.0.1:8000/redoc"class="external-link"target="_blank">http://127.0.0.1:8000/redoc</a>.
ახლა კი, თქვენს ბრაუზერში გახსენით შემდეგი ბმული: <ahref="http://127.0.0.1:8000/redoc"class="external-link"target="_blank">http://127.0.0.1:8000/redoc</a>.
ახლა კი, თქვენს ბრაუზერში გახსენით შემდეგი ბმული: <ahref="http://127.0.0.1:8000/redoc"class="external-link"target="_blank">http://127.0.0.1:8000/redoc</a>.
@ -472,8 +472,8 @@ item: Item
* Automatic and clear errors when the data is invalid.
* Automatic and clear errors when the data is invalid.
* Validation even for deeply nested JSON objects.
* Validation even for deeply nested JSON objects.
* მონაცემთა ვალიდაციას:
* მონაცემთა ვალიდაციას:
* ავტომატურად გენერირებულ და მარტივად გასაგებ ცდომილების შეტყობინებებს, როდესაც მონაცემები ვალიდური არ არის.
* ავტომატურად გენერირებულ და მარტივად გასაგებ ცდომილების შეტყობინებებს, როდესაც მონაცემები ვალიდური არ იქნება.
* ვალიდაციას თუნდაც უკიდურესად კომპლექსური JSON მონაცემებისათვის.
* ვალიდაციას თუნდაც უკიდურესად კომპლექსური (მაგ.: მრავალშრიანი) JSON მონაცემებისათვის.
* <abbrtitle="also known as: serialization, parsing, marshalling">Conversion</abbr> of input data: coming from the network to Python data and types. Reading from:
* <abbrtitle="also known as: serialization, parsing, marshalling">Conversion</abbr> of input data: coming from the network to Python data and types. Reading from:
* JSON.
* JSON.
* Path parameters.
* Path parameters.
@ -482,7 +482,7 @@ item: Item
* Headers.
* Headers.
* Forms.
* Forms.
* Files.
* Files.
* შემავალ მონაცემთა <abbrtitle="ასევე ცნობილია, როგორც: სერიალიზება, პარსირება, კლასიფიცირება">გარდაქმნას: ქსელიდან შემომავალი მონაცემების გადათარგმნას Python-ისთვის გასაგებ მონაცემებად და ტიპებად. შესაძლებელია შემდეგი სახის მონაცემების წაკითხვა და გარდაქმნა:
* შემავალ მონაცემთა <abbrtitle="ასევე ცნობილია, როგორც: სერიალიზება, პარსირება, კლასიფიცირება">გარდაქმნას</abbr>: ქსელიდან შემომავალი მონაცემების გადათარგმნას Python-ისთვის გასაგებ მონაცემებად და ტიპებად. შესაძლებელია შემდეგი სახის მონაცემების წაკითხვა და გარდაქმნა:
* JSON.
* JSON.
* მარშრუტის (Path) პარამეტრები.
* მარშრუტის (Path) პარამეტრები.
* საძიებო (Query) პარამეტრები.
* საძიებო (Query) პარამეტრები.
@ -496,7 +496,7 @@ item: Item
* `UUID` objects.
* `UUID` objects.
* Database models.
* Database models.
* ...and many more.
* ...and many more.
* გამომავალ მონაცემთა <abbrtitle="ასევე ცნობილია, როგორც: სერიალიზება, პარსირება, კლასიფიცირება">გარდაქმნას: Python-ის მონაცემებისა და ტიპების გადათარგმნას ქსელურ მონაცემებად (JSON-ად). შესაძლებელია შემდეგი სახის მონაცემების გარდაქმნა:
* გამომავალ მონაცემთა <abbrtitle="ასევე ცნობილია, როგორც: სერიალიზება, პარსირება, კლასიფიცირება">გარდაქმნას</abbr>: Python-ის მონაცემებისა და ტიპების გადათარგმნას ქსელურ მონაცემებად (JSON-ად). შესაძლებელია შემდეგი სახის მონაცემების გარდაქმნა:
* Python-ის ტიპები (`str`, `int`, `float`, `bool`, `list` და სხვ.).
* Python-ის ტიპები (`str`, `int`, `float`, `bool`, `list` და სხვ.).
* `datetime` ობიექტები.
* `datetime` ობიექტები.
* `UUID` ობიექტები.
* `UUID` ობიექტები.
@ -505,7 +505,7 @@ item: Item
* Automatic interactive API documentation, including 2 alternative user interfaces:
* Automatic interactive API documentation, including 2 alternative user interfaces:
* Swagger UI.
* Swagger UI.
* ReDoc.
* ReDoc.
* ავტომატურად გენერირებულ ინტერაქციულ API-დოკუმენტაციას, რომელიც მოიცავს 2 ალტერნატიულ ინტერფეისს. ესენია:
* ავტომატურად გენერირებულ ინტერაქციულ APIდოკუმენტაციას, რომელიც მოიცავს 2 ალტერნატიულ ინტერფეისს. ესენია:
* Swagger UI.
* Swagger UI.
* ReDoc.
* ReDoc.
@ -515,7 +515,7 @@ Coming back to the previous code example, **FastAPI** will:
მოდით, მივუბრუნდეთ წინა მაგალითს და გავაანალიზოთ, რას და როგორ გააკეთებს **FastAPI**:
მოდით, მივუბრუნდეთ წინა მაგალითს და გავაანალიზოთ, რას და როგორ გააკეთებს **FastAPI**:
* Validate that there is an `item_id` in the path for `GET` and `PUT` requests.
* Validate that there is an `item_id` in the path for `GET` and `PUT` requests.
* `GET` და `PUT` ოპერაციებისათვის შეამოწმებს, არის თუ არა მისამართში განსაზღვრული `item_id` პარამეტრი.
* `GET` და `PUT` ოპერაციებისათვის შეამოწმებს, არის თუ არა `item_id` პარამეტრი მითითებული მისამართში.
* Validate that the `item_id` is of type `int` for `GET` and `PUT` requests.
* Validate that the `item_id` is of type `int` for `GET` and `PUT` requests.
* If it is not, the client will see a useful, clear error.
* If it is not, the client will see a useful, clear error.
* `GET` და `PUT` ოპერაციებისათვის გადაამოწმებს, არის თუ არა `item_id` პარამეტრი `int` ტიპის.
* `GET` და `PUT` ოპერაციებისათვის გადაამოწმებს, არის თუ არა `item_id` პარამეტრი `int` ტიპის.
@ -523,15 +523,15 @@ Coming back to the previous code example, **FastAPI** will:
* Check if there is an optional query parameter named `q` (as in `http://127.0.0.1:8000/items/foo?q=somequery`) for `GET` requests.
* Check if there is an optional query parameter named `q` (as in `http://127.0.0.1:8000/items/foo?q=somequery`) for `GET` requests.
* As the `q` parameter is declared with `= None`, it is optional.
* As the `q` parameter is declared with `= None`, it is optional.
* Without the `None` it would be required (as is the body in the case with `PUT`).
* Without the `None` it would be required (as is the body in the case with `PUT`).
* `GET` ოპერაციებისათვის შეამოწმებს, არის თუ არა წარმოდგენილი არასავალდებულო საძიებო (query) პარამეტრი სახელად `q` (მაგ.: `http://127.0.0.1:8000/items/foo?q=somequery`).
* `GET` ოპერაციებისათვის შეამოწმებს, არის თუ არა მისამართში წარმოდგენილი არასავალდებულო საძიებო (query) პარამეტრი, სახელად `q` (მაგ.: `http://127.0.0.1:8000/items/foo?q=somequery`).
* ვინაიდან `q` პარამეტრი განსაზღვრულია `= None` ბოლოსართით, იგი არასავალდებულოა.
* ვინაიდან `q` პარამეტრი კოდში განსაზღვრულია `= None` ბოლოსართით, იგი არასავალდებულოა.
* `None`-ის არარსებობის შემთხვევაში, იგი იქნებოდა სავალდებულო (როგორც მოთხოვნის შიგთავსი `PUT` ოპერაციის შემთხვევაში).
* `None`-ის არარსებობის შემთხვევაში, იგი იქნებოდა სავალდებულო (მსგავსად მოთხოვნის შიგთავსისა`PUT` ოპერაციის შემთხვევაში).
* For `PUT` requests to `/items/{item_id}`, Read the body as JSON:
* For `PUT` requests to `/items/{item_id}`, Read the body as JSON:
* Check that it has a required attribute `name` that should be a `str`.
* Check that it has a required attribute `name` that should be a `str`.
* Check that it has a required attribute `price` that has to be a `float`.
* Check that it has a required attribute `price` that has to be a `float`.
* Check that it has an optional attribute `is_offer`, that should be a `bool`, if present.
* Check that it has an optional attribute `is_offer`, that should be a `bool`, if present.
* All this would also work for deeply nested JSON objects.
* All this would also work for deeply nested JSON objects.
For a more complete example including more features, see the <ahref="https://fastapi.tiangolo.com/tutorial/">Tutorial - User Guide</a>.
For a more complete example including more features, see the <ahref="https://fastapi.tiangolo.com/tutorial/">Tutorial - User Guide</a>.
მეტად სრულყოფილი მაგალითის სანახავად, სადაც განხილული იქნება უფრო მეტი საკითხი, იხილეთ <ahref="https://fastapi.tiangolo.com/tutorial/">სახელმძღვანელო - მომხმარებლის გზამკვლევი</a>.
მეტად სრულყოფილი მაგალითის სანახავად, სადაც განხილული იქნება უფრო მეტი საკითხი, იხილეთ <ahref="https://fastapi.tiangolo.com/tutorial/">სახელმძღვანელო — მომხმარებლის გზამკვლევი</a>.
**Spoiler alert**: the tutorial - user guide includes:
**Spoiler alert**: the tutorial - user guide includes:
**გაფრთხილება სპოილერის შესახებ**: მომხმარებლის გზამკვლევი მოიცავს შემდეგ საკითხებს:
**გაფრთხილება სპოილერის შესახებ**: მომხმარებლის გზამკვლევი მოიცავს შემდეგ საკითხებს:
@ -589,7 +589,7 @@ For a more complete example including more features, see the <a href="https://fa
* How to set **validation constraints** as `maximum_length` or `regex`.
* How to set **validation constraints** as `maximum_length` or `regex`.
* **შემმოწმებლებისათვის (ვალიდატორებისათვის) შეზღუდვების** დაწესება, როგორებიცაა: `maximum_length` ან `regex`.
* **შემმოწმებლებისათვის (ვალიდატორებისათვის) შეზღუდვების** დაწესება, როგორებიცაა: `maximum_length` ან `regex`.
* A very powerful and easy to use **<abbrtitle="also known as components, resources, providers, services, injectables">Dependency Injection</abbr>** system.
* A very powerful and easy to use **<abbrtitle="also known as components, resources, providers, services, injectables">Dependency Injection</abbr>** system.
* ძალიან მძლავრი და მარტივად გამოსაყენებელი **<abbrtitle="ასევე ცნობილი, როგორც კომპონენტები, რესურსები, პროვაიდერები, სერვისები, injectable-ები">პაკეტების ინექციის</abbr>** სისტემა.
* ძალიან მძლავრი და მარტივად გამოსაყენებელი **<abbrtitle="ასევე ცნობილი, როგორც კომპონენტები, რესურსები, პროვაიდერები, სერვისები, injectable-ები">პაკეტების ინექცირების</abbr>** სისტემა.
* Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth.
* Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth.
* უსაფრთხოება და ავთენტიკაცია, მათ შორის **OAuth2**-ის მხარდაჭერა **JWT ტოკენებით** და **HTTP Basic** ავთენტიკაცია.
* უსაფრთხოება და ავთენტიკაცია, მათ შორის **OAuth2**-ის მხარდაჭერა **JWT ტოკენებით** და **HTTP Basic** ავთენტიკაცია.
* More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic).
* More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic).
@ -613,7 +613,7 @@ For a more complete example including more features, see the <a href="https://fa
## წარმადობა
## წარმადობა
Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as <ahref="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7"class="external-link"target="_blank">one of the fastest Python frameworks available</a>, only below Starlette and Uvicorn themselves (used internally by FastAPI). (*)
Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as <ahref="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7"class="external-link"target="_blank">one of the fastest Python frameworks available</a>, only below Starlette and Uvicorn themselves (used internally by FastAPI). (*)
TechEmpower-ის მიუკერძოებელი ტესტები ცხადყოფენ, რომ Uvicorn-ით გაშვებული **FastAPI**-ზე დაფუძნებული აპლიკაციები <ahref="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7"class="external-link"target="_blank">წარმოაჩენენ FastAPI-ს, როგორც ერთ-ერთ უსწრაფეს ფრეიმვორქს Python-ის არსებულ ფრეიმვორქებს შორის</a>. მას წინ უსწრებენ მხოლოდ Starlette-ი და Uvicorn-ი (რომლებსაც თავის მხრივ, FastAPI-ი იყენებს). (*)
TechEmpower-ის მიუკერძოებელი ტესტები ცხადყოფენ, რომ Uvicorn-ით გაშვებული **FastAPI**-ზე დაფუძნებული აპლიკაციები <ahref="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7"class="external-link"target="_blank">წარმოაჩენენ FastAPI-ს, როგორც ერთ-ერთ უსწრაფეს ფრეიმვორქს Python-ის არსებულ ფრეიმვორქებს შორის</a>. მას წინ უსწრებენ მხოლოდ Starlette-ი და Uvicorn-ი (რომლებსაც, თავის მხრივ, FastAPI-ი იყენებს). (*)
To understand more about it, see the section <ahref="https://fastapi.tiangolo.com/benchmarks/"class="internal-link"target="_blank">Benchmarks</a>.
To understand more about it, see the section <ahref="https://fastapi.tiangolo.com/benchmarks/"class="internal-link"target="_blank">Benchmarks</a>.
ამ ყველაფრის უკეთ გასააზრებლად იხილეთ შემდეგი განყოფილება: <ahref="https://fastapi.tiangolo.com/benchmarks/"class="internal-link"target="_blank">წარმადობის ტესტები (Benchmarks)</a>.
ამ ყველაფრის უკეთ გასააზრებლად იხილეთ შემდეგი განყოფილება: <ahref="https://fastapi.tiangolo.com/benchmarks/"class="internal-link"target="_blank">წარმადობის ტესტები (Benchmarks)</a>.