دسترسی نامحدود
برای کاربرانی که ثبت نام کرده اند
برای ارتباط با ما می توانید از طریق شماره موبایل زیر از طریق تماس و پیامک با ما در ارتباط باشید
در صورت عدم پاسخ گویی از طریق پیامک با پشتیبان در ارتباط باشید
برای کاربرانی که ثبت نام کرده اند
درصورت عدم همخوانی توضیحات با کتاب
از ساعت 7 صبح تا 10 شب
ویرایش:
نویسندگان: Sherwin John Tragura
سری:
ISBN (شابک) : 1803245964, 9781803245966
ناشر: Packt Publishing - ebooks Account
سال نشر: 2022
تعداد صفحات: 347
زبان: English
فرمت فایل : EPUB (درصورت درخواست کاربر به PDF، EPUB یا AZW3 تبدیل می شود)
حجم فایل: 8 Mb
در صورت تبدیل فایل کتاب Building Python Microservices with FastAPI: Build secure, scalable, and structured Python microservices from design concepts to infrastructure به فرمت های PDF، EPUB، AZW3، MOBI و یا DJVU می توانید به پشتیبان اطلاع دهید تا فایل مورد نظر را تبدیل نمایند.
توجه داشته باشید کتاب ساخت میکروسرویسهای پایتون با FastAPI: ساخت میکروسرویسهای ایمن، مقیاسپذیر و ساختار یافته پایتون از مفاهیم طراحی تا زیرساخت نسخه زبان اصلی می باشد و کتاب ترجمه شده به فارسی نمی باشد. وبسایت اینترنشنال لایبرری ارائه دهنده کتاب های زبان اصلی می باشد و هیچ گونه کتاب ترجمه شده یا نوشته شده به فارسی را ارائه نمی دهد.
کشف اسرار ساخت میکروسرویس های پایتون با استفاده از چارچوب FastAPI
FastAPI یک چارچوب مبتنی بر ASGI (رابط دروازه سرور ناهمزمان) است که میتواند به ساخت کمک کند. میکروسرویس های مدرن، قابل مدیریت و سریع. این چارچوب مبتنی بر ASGI به دلیل پلتفرم هسته ناهمزمان خود، بهترین گزینه را در مورد عملکرد، قابلیت اطمینان و مقیاس پذیری نسبت به Django و Flask مبتنی بر WSGI ارائه می دهد. هنگام کار با میکروسرویسهای Python، Flask و Django، میتوانید دانش خود را با این راهنمای عملی برای ساختن میکروسرویسهای سریع و قابل مدیریت یکپارچه به کار ببرید.
شما. با درک پسزمینه FastAPI و یادگیری نحوه نصب، پیکربندی و استفاده از FastAPI برای تجزیه واحدهای تجاری شروع میشود. شما یک چارچوب منحصربهفرد و ناهمزمان REST API را بررسی خواهید کرد که میتواند گزینه بهتری برای ساخت میکروسرویسها ارائه دهد. در مرحله بعد، این کتاب شما را در مورد نحوه اعمال و ترجمه الگوهای طراحی میکروسرویس در ساخت برنامه های کاربردی میکروسرویس های مختلف و API های RESTful با استفاده از چارچوب FastAPI راهنمایی می کند.
تا پایان این کتاب میکروسرویس ها ، می توانید با استفاده از چارچوب FastAPI میکروسرویس ها و اجزای آنها را یاد بگیرید، بسازید، استقرار دهید، آزمایش کنید و آزمایش کنید.
این کتاب برای توسعه دهندگان وب پایتون، کاربران پیشرفته پایتون و توسعه دهندگان بک اند با استفاده از Flask یا جنگو است که می خواهند یاد بگیرند چگونه برای استفاده از چارچوب FastAPI برای پیاده سازی میکروسرویس ها. خوانندگانی که با REST API و میکروسرویس ها آشنا هستند نیز از این کتاب بهره مند خواهند شد. برخی از بخشهای کتاب حاوی مفاهیم، فرآیندها و دستورالعملهای کلی است که توسعهدهندگان سطح متوسط و علاقهمندان به پایتون نیز میتوانند با آنها ارتباط برقرار کنند.
Discover the secrets of building Python microservices using the FastAPI framework
FastAPI is an ASGI-based (Asynchronous Server Gateway Interface) framework that can help build modern, manageable, and fast microservices. Because of its asynchronous core platform, this ASGI-based framework provides the best option when it comes to performance, reliability, and scalability over WSGI-based Django and Flask. When working with Python, Flask, and Django microservices, you’ll be able to put your knowledge to work with this practical guide to building seamlessly manageable and fast microservices.
You’ll begin by understanding the background of FastAPI and learning how to install, configure, and use FastAPI to decompose business units. You’ll explore a unique and asynchronous REST API framework that can provide a better option when it comes to building microservices. Next, the book will guide you on how to apply and translate microservices design patterns in building various microservices applications and RESTful APIs using the FastAPI framework.
By the end of this microservices book, you’ll be able to learn, build, deploy, test, and experiment with microservices and their components using the FastAPI framework.
This book is for Python web developers, advanced Python users, and backend developers using Flask or Django who want to learn how to use the FastAPI framework to implement microservices. Readers familiar with the REST API and microservices will also benefit from this book. Some parts of the book contain general concepts, processes, and instructions that intermediate-level developers and Python enthusiasts can relate to as well.
Cover Title Page Copyright Dedication Contributors Table of Contents Preface Part 1: Application-Related Architectural Concepts for FastAPI microservice development Chapter 1: Setting Up FastAPI for Starters Technical requirements Setting up the development environment Initializing and configuring FastAPI Designing and implementing REST APIs Managing user requests and server response Parameter type declaration Path parameters Query parameters Default parameters Optional parameters Mixing all types of parameters Request body Request headers Response data Handling form parameters Managing cookies Summary Chapter 2: Exploring the Core Features Technical requirements Structuring and organizing huge projects Implementing the API services Importing the module components Implementing the new main.py file Managing API-related exceptions A single status code response Multiple status codes Raising HTTPException Custom exceptions A default handler override Converting objects to JSON-compatible types Managing API responses Creating background processes Using asynchronous path operations Applying middleware to filter path operations Summary Chapter 3: Investigating Dependency Injection Technical requirements Applying IoC/DI Injecting a dependency function Injecting a callable class Building nested dependencies Caching the dependencies Declaring Depends() parameter types Injecting asynchronous dependencies Exploring ways of injecting dependencies Dependency injection on services Dependency injection on path operators Dependency injection on routers Dependency injection on main.py Organizing a project based on dependencies The model layer The repository layer The repository factory methods The service layer The REST API and the service layer The actual project structure Using third-party containers Using configurable containers – Dependency Injector Using a simple configuration – Lagom The FastAPI and Lagom integration Scoping of dependables Summary Chapter 4: Building the Microservice Application Technical requirements Applying the decomposition pattern Creating the sub-applications Mounting the submodules Creating a common gateway Implementing the main endpoint Evaluating the microservice ID Applying the exception handlers Centralizing the logging mechanism Utilizing the Loguru module Building the logging middleware Consuming the REST API services Using the httpx module Using the requests module Applying the domain modeling approach Creating the layers Identifying the domain models Building the repository and service layers Using the factory method pattern Managing a microservice’s configuration details Storing settings as class attributes Storing settings in the properties file Summary Part 2: Data-Centric and Communication-Focused Microservices Concerns and Issues Chapter 5: Connecting to a Relational Database Technical requirements Preparing for database connectivity Creating CRUD transactions using SQLAlchemy Installing the database driver Setting up the database connection Initializing the session factory Defining the Base class Building the model layer Implementing the repository layer Running the transactions Creating tables Implementing async CRUD transactions using SQLAlchemy Installing the asyncio-compliant database drivers Setting up the database’s connection Creating the session factory Creating the Base class and the model layer Building the repository layer Running the CRUD transactions Using GINO for async transactions Installing the database driver Establishing the database connection Building the model layer Implementing the CRUD transactions Running the CRUD transactions Creating the tables Using Pony ORM for the repository layer Installing the database driver Creating the database’s connectivity Defining the model classes Implementing the CRUD transactions Running the repository transactions Creating the tables Building the repository using Peewee Installing the database driver Creating the database connection Creating the tables and the domain layer Implementing the CRUD transactions Running the CRUD transaction Applying the CQRS design pattern Defining the handler interfaces Creating the command and query classes Creating the command and query handlers Accessing the handlers Summary Chapter 6: Using a Non-Relational Database Technical requirements Setting up the database environment Applying the PyMongo driver for synchronous connections Setting up the database connectivity Building the model layer Implementing the repository layer Running the transactions Creating async CRUD transactions using Motor Setting up the database connectivity Creating the model layer Running the CRUD transactions Implementing CRUD transactions using MongoEngine Establishing database connection Building the model layer Implementing the CRUD transactions Running the CRUD transactions Implementing async transactions using Beanie Creating the database connection Defining the model classes Implementing the CRUD transactions Running the repository transactions Building async repository for FastAPI using ODMantic Creating the database connection Creating the model layer Implementing the CRUD transactions Running the CRUD transaction Creating CRUD transactions using MongoFrames Creating the database connection Building the model layer Creating the repository layer Applying the repository layer Summary Chapter 7: Securing the REST APIs Technical requirements Implementing Basic and Digest authentication Using Basic authentication Using Digest authentication Implementing password-based authentication Installing the python-multipart module Using OAuth2PasswordBearer and OAuth2PasswordRequestForm Executing the login transaction Securing the endpoints Applying JWTs Generating the secret key Creating the access_token Creating the login transaction Accessing the secured endpoints Creating scope-based authorization Customizing the OAuth2 class Building the permission dictionary Implementing the login transaction Applying the scopes to endpoints Building the authorization code flow Applying OAuth2AuthorizationCodeBearer Implementing the authorization request Implementing the authorization code response Applying the OpenID Connect specification Using HTTPBearer Installing and configuring the Keycloak environment Setting the Keycloak realm and clients Creating users and user roles Assigning roles to clients Creating user permissions through scopes Integrating Keycloak with FastAPI Implementing the token verification Integrating Auth0 with FastAPI Integrating Okta with FastAPI Using built-in middlewares for authentication Summary Chapter 8: Creating Coroutines, Events, and Message-Driven Transactions Technical requirements Implementing coroutines Applying coroutine switching Designing asynchronous transactions Using the HTTP/2 protocol Creating asynchronous background tasks Using the coroutines Creating multiple tasks Understanding Celery tasks Creating and configuring the Celery instance Creating the task Calling the task Starting the worker server Monitoring the tasks Building message-driven transactions using RabbitMQ Creating the Celery instance Monitoring AMQP messaging Building publish/subscribe messaging using Kafka Running the Kafka broker and server Creating the topic Implementing the publisher Running a consumer on a console Implementing asynchronous Server-Sent Events (SSE) Building an asynchronous WebSocket Implementing the asynchronous WebSocket endpoint Implementing the WebSocket client Applying reactive programming in tasks Creating the Observable data using coroutines Creating background process Accessing API resources Customizing events Defining the startup event Defining shutdown events Summary Part 3: Infrastructure-Related Issues, Numerical and Symbolic Computations, and Testing Microservices Chapter 9: Utilizing Other Advanced Features Technical requirements Applying session management Creating user sessions Managing session data Removing the sessions Customizing BaseHTTPMiddleware Managing the CORS mechanism Customizing APIRoute and Request Managing body, form, or JSON data Encrypting and decrypting the message body Choosing the appropriate responses Setting up the Jinja2 template engine Setting up the static resources Creating the template layout Using ORJSONResponse and UJSONResponse Applying the OpenAPI 3.x specification Extending the OpenAPI schema definition Using the internal code base properties Using the Query, Form, Body, and Path functions Testing the API endpoints Writing the unit test cases Mocking the dependencies Running test methods Summary Chapter 10: Solving Numerical, Symbolic, and Graphical Problems Technical requirements Setting up the projects Using the Piccolo ORM The Beanie ODM Implementing symbolic computations Creating symbolic expressions Solving linear expressions Solving non-linear expressions Solving linear and non-linear inequalities Creating arrays and DataFrames Applying NumPy’s linear system operations Applying the pandas module Performing statistical analysis Generating CSV and XLSX reports Plotting data models Simulating a BPMN workflow Designing the BPMN workflow Implementing the workflow Using GraphQL queries and mutations Setting up the GraphQL platform Creating the record insertion, update, and deletion Implementing the query transactions Running the CRUD transactions Utilizing the Neo4j graph database Setting the Neo4j database Creating the CRUD transactions Summary Chapter 11: Adding Other Microservice Features Technical requirements Setting up the virtual environment Checking the API properties Implementing open tracing mechanisms Setting up service registry and client-side service discovery Implementing client-side service discovery Setting up the Netflix Eureka service registry Deploying and running applications using Docker Generating the requirements.txt file Creating the Docker image Using the Mongo Docker image Creating the containers Using Docker Compose for deployment Using NGINX as an API Gateway Integrating Flask and Django sub-applications Summary Index About Packt Other Books You May Enjoy