万本电子书0元读

万本电子书0元读

顶部广告

Hands-On RESTful Python Web Services电子书

售       价:¥

5人正在读 | 0人评论 9.8

作       者:Gaston C. Hillar

出  版  社:Packt Publishing

出版时间:2018-12-26

字       数:72.5万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Explore the best tools and techniques to create lightweight, maintainable, and scalable Python web services Key Features *Combine Python with different data sources to build complex RESTful APIs from scratch *Configure and fine-tune your APIs using the best tools and techniques available *Use command-line and GUI tools to test CRUD operations performed by RESTful Web Services or APIs Book Description Python is the language of choice for millions of developers worldwide that builds great web services in RESTful architecture. This second edition of Hands-On RESTful Python Web Services will cover the best tools you can use to build engaging web services. This book shows you how to develop RESTful APIs using the most popular Python frameworks and all the necessary stacks with Python, combined with related libraries and tools. You’ll learn to incorporate all new features of Python 3.7, Flask 1.0.2, Django 2.1, Tornado 5.1, and also a new framework, Pyramid. As you advance through the chapters, you will get to grips with each of these frameworks to build various web services, and be shown use cases and best practices covering when to use a particular framework. You’ll then successfully develop RESTful APIs with all frameworks and understand how each framework processes HTTP requests and routes URLs. You’ll also discover best practices for validation, serialization, and deserialization. In the concluding chapters, you will take advantage of specific features available in certain frameworks such as integrated ORMs, built-in authorization and authentication, and work with asynchronous code. At the end of each framework, you will write tests for RESTful APIs and improve code coverage. By the end of the book, you will have gained a deep understanding of the stacks needed to build RESTful web services. What you will learn *Select the most appropriate framework based on requirements *Develop complex RESTful APIs from scratch using Python *Use requests handlers, URL patterns, serialization, and validations *Add authentication, authorization, and interaction with ORMs and databases *Debug, test, and improve RESTful APIs with four frameworks *Design RESTful APIs with frameworks and create automated tests Who this book is for This book is for web developers who have a working knowledge of Python and would like to build amazing web services by taking advantage of the various frameworks of Python. You should have some knowledge of RESTful APIs.
目录展开

Title Page

Copyright and Credits

Hands-On RESTful Python Web Services Second Edition

Dedication

About Packt

Why subscribe?

Packt.com

Contributors

About the author

About the reviewers

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Reader feedback

Customer support

Get in touch

Errata

Reviews

Piracy

Questions

Developing RESTful APIs and Microservices with Flask 1.0.2

Designing a RESTful API to interact with a simple data source

Understanding the tasks performed by each HTTP method

Understanding microservices

Working with lightweight virtual environments

Setting up a virtual environment with Flask and Flask-RESTful

Declaring status codes for the responses with an enumerable

Creating the model

Using a dictionary as a repository

Configuring output fields

Working with resourceful routing on top of Flask pluggable views

Configuring resource routing and endpoints

Making HTTP requests to the Flask API

Working with the curl and httpie command-line tools

Working with GUI tools – Postman and others

Consuming the API with other programming languages

Test your knowledge

Summary

Working with Models, SQLAlchemy, and Hyperlinked APIs in Flask

Designing a RESTful API to interact with a PostgreSQL 10.5 database

Understanding the tasks performed by each HTTP method

Installing packages with the requirements.txt file to simplify our common tasks

Creating the database

Configuring the database

Creating models with their relationships

Creating schemas to validate, serialize, and deserialize models

Combining blueprints with resourceful routing

Understanding and configuring resourceful routing

Registering the blueprint and running migrations

Verifying the contents of the PostgreSQL database

Creating and retrieving related resources

Test your knowledge

Summary

Improving Our API and Adding Authentication to it with Flask

Improving unique constraints in the models

Understanding the differences between the PUT and the PATCH methods

Updating fields for a resource with the PATCH method

Coding a generic pagination class

Adding pagination features

Understanding the steps to add authentication and permissions

Adding a user model

Creating schemas to validate, serialize, and deserialize users

Adding authentication to resources

Creating resource classes to handle users

Running migrations to generate the user table

Composing requests with the necessary authentication

Test your knowledge

Summary

Testing and Deploying an API in a Microservice with Flask

Setting up unit tests with pytest

Creating a database for testing

Creating fixtures to perform setup and teardown tasks for running clean tests

Writing the first round of unit tests

Running unit tests with pytest and checking testing coverage

Improving testing coverage

Understanding strategies for deployments and scalability

Test your knowledge

Summary

Developing RESTful APIs with Django 2.1

Designing a RESTful API to interact with a simple SQLite database

Understanding the tasks performed by each HTTP method

Setting up the virtual environment with Django REST framework

Creating the models

Managing serialization and deserialization

Understanding status codes for the responses

Writing API views

Making HTTP requests to the Django API

Working with command-line tools - curl and httpie

Working with GUI tools - Postman and others

Test your knowledge

Summary

Working with Class-Based Views and Hyperlinked APIs in Django 2.1

Using model serializers to eliminate duplicate code

Working with wrappers to write API views

Using the default parsing and rendering options and moving beyond JSON

Browsing the API

Designing a RESTful API to interact with a complex PostgreSQL 10.5 database

Understanding the tasks performed by each HTTP method

Declaring relationships with the models

Installing packages with the requirements.txt file to work with PostgreSQL

Configuring the database

Running migrations

Verifying the contents of the PostgreSQL database

Managing serialization and deserialization with relationships and hyperlinks

Creating class-based views and using generic classes

Taking advantage of generic class-based views

Working with endpoints for the API

Browsing an API with relationships

Creating and retrieving related resources

Test your knowledge

Summary

Improving Our API and Adding Authentication to it with Django

Adding unique constraints to the models

Updating a single field for a resource with the PATCH method

Taking advantage of pagination

Customizing pagination classes

Understanding authentication, permissions, and throttling

Adding security-related data to the models

Creating a customized permission class for object-level permissions

Persisting the user that makes a request and configuring permission policies

Setting a default value for a new required field in migrations

Composing requests with the necessary authentication

Browsing the API with authentication credentials

Test your knowledge

Summary

Throttling, Filtering, Testing, and Deploying an API with Django 2.1

Installing packages with the requirements.txt file to work with filters, throttling, and tests

Understanding filtering, searching, and ordering classes

Configuring filtering, searching, and ordering for views

Executing HTTP requests to test filtering, searching, and ordering

Filtering, searching and ordering in the Browsable API

Understanding throttling classes and goals

Configuring throttling policies

Executing HTTP requests to test throttling policies

Setting up unit tests with pytest

Writing the first round of unit tests

Running unit tests with pytest

Improving testing coverage

Running Django RESTful APIs on the cloud

Test your knowledge

Summary

Developing RESTful APIs with Pyramid 1.10

Designing a RESTful API to interact with a simple data source

Setting up the virtual environment with Pyramid 1.10

Creating a new Pyramid project based on a template

Creating the model

Using a dictionary as a repository

Creating a Marshmallow schema to validate, serialize, and deserialize the model

Working with view callables and view configurations

Understanding and configuring view handlers

Making HTTP requests to the API with command-line tools

Test your knowledge

Summary

Developing RESTful APIs with Tornado 5.1.1

Designing a RESTful API to interact with slow sensors and actuators

Understanding the tasks performed by each HTTP method

Setting up a virtual environment with Tornado 5.1.1

Creating classes that represent a drone

Writing request handlers

Mapping URL patterns to request handlers

Making HTTP requests to the Tornado API

Working with command-line tools - curl and httpie

Working with GUI tools - Postman and others

Test your knowledge

Summary

Working with Asynchronous Code, Testing, and Deploying an API with Tornado

Understanding synchronous and asynchronous execution

Refactoring code to take advantage of asynchronous decorators

Mapping URL patterns to asynchronous request handlers

Making HTTP requests to the Tornado non-blocking API

Setting up unit tests with pytest

Writing the first round of unit tests

Running unit tests with pytest and checking testing coverage

Improving testing coverage

Understanding strategies for deploying Tornado APIs to the cloud

Test your knowledge

Summary

Assessment

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

Chapter 7

Chapter 8

Chapter 9

Chapter 10

Chapter 11

Other Books You May Enjoy

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部