Op werkdagen voor 23:00 besteld, morgen in huis Gratis verzending vanaf €20

FastAPI

Modern Python Web Development

Paperback Engels 2023 1e druk 9781098135508
Verkooppositie 4745Hoogste positie: 4745
Verwachte levertijd ongeveer 16 werkdagen

Samenvatting

FastAPI is a young yet solid framework that takes advantage of newer Python features in a clean design. As its name implies, FastAPI is indeed fast, rivaling similar frameworks in languages such as Golang. With this practical book, developers familiar with Python will learn how FastAPI lets you accomplish more in less time with less code.

Author Bill Lubanovic covers the nuts and bolts of FastAPI development with how-to guides on various topics such as forms, database access, graphics, maps, and more that will take you beyond the basics. This book also includes how-to guides that will get you up to speed on RESTful APIs, data validation, authorization, and performance. With its similarities to frameworks like Flask and Django, you'll find it easy to get started with FastAPI.

Through the course of this book, you will:
- Learn how to build web applications with FastAPI
- Understand the differences between FastAPI, Starlette, and pydantic
- Learn two features that set FastAPI apart: asynchronous functions and data type checking and validation
- Examine new features of Python 3.8+, especially type annotations
- Understand the differences between sync and async Python
- Learn how to connect with external APIs and services

Specificaties

ISBN13:9781098135508
Trefwoorden:Programmeren, Python
Taal:Engels
Bindwijze:paperback
Aantal pagina's:350
Uitgever:O'Reilly
Druk:1
Verschijningsdatum:17-11-2023
Hoofdrubriek:IT-management / ICT
ISSN:

Lezersrecensies

Wees de eerste die een lezersrecensie schrijft!

Over Bill Lubanovic

Bill Lubanovic has developed software with UNIX since 1977, GUIs since 1981, databases since 1990, and the Web since 1993. At a startup named Intran in 1982, he developed MetaForm -- one of the first commercial GUIs (before the Mac or Windows), on one of the first graphic workstations. At Northwest Airlines in the early 1990s, he wrote a graphic yield management system that generated millions of dollars in revenue; got the company on the Internet; and wrote its first Internet marketing test. He co-founded an ISP (Tela) in 1994, and a web development company (Mad Scheme) in 1999. Recently, he developed core services and distributed systems with a remote team for a Manhattan startup. Later, he integrating OpenStack services for two supercomputer companies. He now works for the Internet Archive, helping to develop the next-generation Wayback Machine in Python. He enjoys life in the Sangre de Sasquatch mountains of Minnesota with his wonderful wife Mary, children Tom and Karin, and cats Inga, Chester, and Lucy.

Andere boeken door Bill Lubanovic

Inhoudsopgave

Preface
Conventions Used in This Book
Using Code Examples
O’Reilly Online Learning
How to Contact Us
Acknowledgments

I. What’s New?
1. The Modern Web
Preview
Services and APIs
Kinds of APIs
HTTP
REST(ful)
JSON and API Data Formats
JSON:API
GraphQL
Concurrency
Layers
Data
Review

2. Modern Python
Preview
Tools
Getting Started
Python Itself
Package Management
Virtual Environments
Poetry
Source Formatting
Testing
Source Control and Continuous Integration
Web Tools
APIs and Services
Variables Are Names
Type Hints
Data Structures
Web Frameworks
Django
Flask
FastAPI
Review

II. A FastAPI Tour
3. FastAPI Tour
Preview
What Is FastAPI?
A FastAPI Application
HTTP Requests
URL Path
Query Parameters
Body
HTTP Header
Multiple Request Data
Which Method Is Best?
HTTP Responses
Status Code
Headers
Response Types
Type Conversion
Model Types and response_model
Automated Documentation
Complex Data
Review

4. Async, Concurrency, and Starlette Tour
Preview
Starlette
Types of Concurrency
Distributed and Parallel Computing
Operating System Processes
Operating System Threads
Green Threads
Callbacks
Python Generators
Python async, await, and asyncio
FastAPI and Async
Using Starlette Directly
Interlude: Cleaning the Clue House
Review

5. Pydantic, Type Hints, and Models Tour
Preview
Type Hinting
Data Grouping
Alternatives
A Simple Example
Validate Types
Validate Values
Review

6. Dependencies
Preview
What’s a Dependency?
Problems with Dependencies
Dependency Injection
FastAPI Dependencies
Writing a Dependency
Dependency Scope
Single Path
Multiple Paths
Global
Review

7. Framework Comparisons
Preview
Flask
Path
Query Parameter
Body
Header
Django
Other Web Framework Features
Databases
Recommendations
Other Python Web Frameworks
Review

III. Making a Website
8. Web Layer
Preview
Interlude: Top-Down, Bottom-Up, Middle-Out?
RESTful API Design
File and Directory Site Layout
The First Website Code
Requests
Multiple Routers
Build the Web Layer
Define Data Models
Stub and Fake Data
Create Common Functions Through the Stack
Create Fake Data
Test!
Using the FastAPI Automated Test Forms
Talking to the Service and Data Layers
Pagination and Sorting
Review

9. Service Layer
Preview
Defining a Service
Layout
Protection
Functions
Test!
Other Service-Level Stuff
Logging
Metrics, Monitoring, Observability
Tracing
Other
Review

10. Data Layer
Preview
DB-API
SQLite
Layout
Making It Work
Test!
Full Tests
Unit Tests
Review

11. Authentication and Authorization
Preview
Interlude 1: Do You Need Authentication?
Authentication Methods
Global Authentication: Shared Secret
Simple Individual Authentication
Fancier Individual Authentication
OAuth2
User Model
User Data Layer
User Fake Data Layer
User Service Layer
User Web Layer
Test!
Top Layer
Authentication Steps
JWT
Third-Party Authentication: OIDC
Authorization
Middleware
CORS
Third-Party Packages
Review

12. Testing
Preview
Web API Testing
Where to Test
What to Test
Pytest
Layout
Automated Unit Tests
Mocking
Test Doubles and Fakes
Web
Service
Data
Automated Integration Tests
The Repository Pattern
Automated Full Tests
Security Testing
Load Testing
Review

13. Production
Preview
Deployment
Multiple Workers
HTTPS
Docker
Cloud Services
Kubernetes
Performance
Async
Caches
Databases, Files, and Memory
Queues
Python Itself
Troubleshooting
Kinds of Problems
Logging
Metrics
Review

IV. A Gallery
14. Databases, Data Science, and a Little AI
Preview
Data Storage Alternatives
Relational Databases and SQL
SQLAlchemy
SQLModel
SQLite
PostgreSQL
EdgeDB
Nonrelational (NoSQL) Databases
Redis
MongoDB
Cassandra
Elasticsearch
NoSQL Features in SQL Databases
Database Load Testing
Data Science and AI
Review

15. Files
Preview
Multipart Support
Uploading Files
File()
UploadFile
Downloading Files
FileResponse
StreamingResponse
Serving Static Files
Review

16. Forms and Templates
Preview
Forms
Templates
Review

17. Data Discovery and Visualization
Preview
Python and Data
PSV Text Output
csv
python-tabulate
pandas
SQLite Data Source and Web Output
Chart/Graph Packages
Chart Example 1: Test
Chart Example 2: Histogram
Map Packages
Map Example
Review

18. Games
Preview
Python Game Packages
Splitting Game Logic
Game Design
Web Part One: Game Initialization
Web Part Two: Game Steps
Service Part One: Initialization
Service Part Two: Scoring
Test!
Data: Initialization
Let’s Play Cryptonamicon
Review

A. Further Reading
Python
FastAPI
Starlette
Pydantic

B. Creatures and Humans
Creatures
Explorers
Explorer Publications
Other Sources

Index
About the Author

Managementboek Top 100

Rubrieken

Populaire producten

    Personen

      Trefwoorden

        FastAPI