Building RESTful Python Web Services
eBook - ePub

Building RESTful Python Web Services

Gaston C. Hillar

Share book
  1. 418 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Building RESTful Python Web Services

Gaston C. Hillar

Book details
Book preview
Table of contents
Citations

About This Book

Create web services that are lightweight, maintainable, scalable, and secure using the best tools and techniques designed for Python

About This Book

  • Develop RESTful Web Services using the most popular frameworks in Python
  • Configure and fine-tune your APIs using the best tools and techniques available
  • This practical guide will help you to implement complete REST-based APIs from scratch

Who This Book Is For

This book is for web developers who have 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.

What You Will Learn

  • Develop complex RESTful APIs from scratch with Python combined with and without data sources
  • Choose the most appropriate (micro) framework based on the specific requirements of a RESTful API / web service
  • Debug, test, and profile RESTful APIs with each of the frameworks
  • Develop a complex RESTful API that interacts with a PostgreSQL database
  • Add authentication and permissions to a RESTful API built in each of the frameworks
  • Map URL patterns to request handlers and check how the API works
  • Profile an existing API and refactor it to take advantage of asynchronous code

In Detail

Python is the language of choice for millions of developers worldwide, due to its gentle learning curve as well as its vast applications in day-to-day programming. It serves the purpose of building great web services in the RESTful architecture. This book will show you the best tools you can use to build your own web services.

Learn how to develop RESTful APIs using the popular Python frameworks and all the necessary stacks with Python, Django, Flask, and Tornado, combined with related libraries and tools. We will dive deep into each of these frameworks to build various web services, and will provide use cases and best practices on when to use a particular framework to get the best results.

We will show you everything required to successfully develop RESTful APIs with the four frameworks such as request handling, URL mapping, serialization, validation, authentication, authorization, versioning, ORMs, databases, custom code for models and views, and asynchronous callbacks. At the end of each framework, we will add authentication and security to the RESTful APIs and prepare tests for it.

By the end of the book, you will have a deep understanding of the stacks needed to build RESTful web services.

Style and approach

The book takes a straightforward approach, not spending time getting you started with RESTful APIs and web services. It will give you the best use cases for each framework to build great web services in Python.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Building RESTful Python Web Services an online PDF/ePUB?
Yes, you can access Building RESTful Python Web Services by Gaston C. Hillar in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Servicios web y API. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781786462251

Building RESTful Python Web Services


Building RESTful Python Web Services

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2016
Production reference: 1201016
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-225-1
www.packtpub.com

Credits

Author
Gastón C. Hillar
Copy Editor
Sneha Singh
Reviewer
Elmer Thomas
Project Coordinator
Sheejal Shah
Commissioning Editor
Aaron Lazar
Proofreader
Safis Editing
Acquisition Editor
Reshma Raman
Indexer
Rekha Nair
Content Development Editor
Divij Kotian
Graphics
Jason Monteiro
Technical Editor
Gebin George
Production Coordinator
Melwyn Dsa

About the Author

Gastón C. Hillar is Italian and has been working with computers since he was eight. He began programming with the legendary Texas TI-99/4A and Commodore 64 home computers in the early 80s. He has a Bachelor's degree in Computer Science from which he graduated with honors, and an MBA from which he graduated with an outstanding thesis. At present, Gastón is an independent IT consultant and freelance author who is always looking for new adventures around the world.
He has been a senior contributing editor at Dr. Dobb’s and has written more than a hundred articles on software development topics. Gaston was also a former Microsoft MVP in technical computing. He has received the prestigious Intel® Black Belt Software Developer award eight times.
He is a guest blogger at Intel® Software Network (http://software.intel.com). You can reach him at [email protected] and follow him on Twitter at http://twitter.com/gastonhillar. Gastón's blog is http://csharpmulticore.blogspot.com.
He lives with his wife, Vanesa, and his two sons, Kevin and Brandon.

Acknowledgments

At the time of writing this book, I was fortunate to work with an excellent team at Packt Publishing , whose contributions vastly improved the presentation of this book. Reshma Raman and Aaron Lazar allowed me to provide them ideas to develop this book and I jumped into the exciting project of teaching how to use many popular web frameworks to develop RESTful Web Services with Python 3.5. Divij Kotian helped me realize my vision for this book and provided many sensible suggestions regarding the text, the format and the flow. The reader will notice his great work. It was great working with Divij in another book. In fact, it is the third book in which I was able to work with Reshma and Divij. It’s been great working with them in another project and I can’t wait to work with them again. I would like to thank my technical reviewers and proofreaders, for their thorough reviews and insightful comments. I was able to incorporate some of the knowledge and wisdom they have gained in their many years in the software development industry. This book was possible because they gave valuable feedback.
Gebin George did a wonderful job when the book moved into the production stage. He has made all the necessary adjustments to generate the final version of the book with an outstanding layout. Gebin made the book easy to read in its different versions and made sure I was happy with the results. A book like this one with so many tables, figures, pieces of code, commands and sample outputs requires skilled people with eye for detail during all the stages. I was fortunate to have Gebin onboard. I would like to thank my technical reviewers and proofreaders, for their thorough reviews and insightful comments. I was able to incorporate some of the knowledge and wisdom they have gained in their many years in the software development industry. This book was possible because they gave valuable feedback.
I usually start writing notes about ideas for a book when I spend time at software development conferences and events. I wrote the initial idea for this book in San Francisco, California, at Intel Developer Forum 2015. One year later, at Intel Developer Forum 2016, I had the chance to discuss with many software engineers the book I was finishing and incorporate their suggestions in the final drafts.
The entire process of writing a book requires a huge amount of lonely hours. I wouldn’t be able to write an entire book without dedicating some time to play soccer against my sons Kevin and Brandon, and my nephew, Nicolas. Of course, I never won a match. However, I did score a few goals.

About the Reviewer

Elmer Thomas completed a B.S. in Computer Engineering and a M.S. in Electrical Engineering at the University of California, Riverside. His focus was on Control Systems, specifically GPS navigation systems, spending several years serving as a research assistant, building software and hardware for self driving cars at U.C. Riverside and Berkeley, resulting in 2 co-publications: Aided Integer Ambiguity Resolution Algorithm and Data Fusion via Kalman Filter: GPS & INS. During the final years of his Masters program, he added a few mentors, partners and some business skills through the Tuck Executive Program at Dartmouth to his repertoire and co-founded several companies with varying degrees of success over the next 7 years. During this time he helped hundreds of business profit while achieving over 50 awards from local and state government for service in the community.
While building businesses, Elmer served on various boards to help foster growth in local business communities in Riverside and Orange County, including the Riverside Technology CEO Forum, the TechBiz Connection, OCTANe and TriTech. Next, he began serving at SendGrid, an email API and Service Company, as one of the first 5 employees in a now 300+ employee company on the verge of going public. Service began as the web development manager, and then he moved into a product development role while helping build out a quality assurance program. After spending 2 years traveling to over 50 events, speaking, teaching and mentoring as a Developer Evangelist within the Send Grid marketing department, Elmer then served as the Hacker in Residence on the community team at S...

Table of contents