Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Python for Geeks
Python for Geeks

Python for Geeks: Build production-ready applications using advanced Python concepts and industry best practices

eBook
$31.99 $35.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Python for Geeks

Chapter 1: Optimal Python Development Life Cycle

Keeping in mind your prior experience with Python, we have skipped the introductory details of the Python language in this chapter. First, we will have a short discussion of the broader open source Python community and its specific culture. That introduction is important, as this culture is reflected in code being written and shared by the Python community. Then, we will present the different phases of a typical Python project. Next, we will look at different ways of strategizing the development of a typical Python project.

Moving on, we will explore different ways of documenting the Python code. Later, we will look into various options of developing an effective naming scheme that can greatly help improve the maintenance of the code. We will also look into various options for using source control for Python projects, including situations where developers are mainly using Jupyter notebooks for development. Finally, we explore the best practices to deploy the code for use, once it is developed and tested.

We will cover the following topics in this chapter:

  • Python culture and community
  • Different phases of a Python project
  • Strategizing the development process
  • Effectively documenting Python code
  • Developing an effective naming scheme
  • Exploring choices for source control
  • Understanding strategies for deploying the code
  • Python development environments

This chapter will help you understand the life cycle of a typical Python project and its phases so that you can fully utilize the power of Python.

Python culture and community

Python is an interpreted high-level language that was originally developed by Guido van Rossum in 1991. The Python community is special in the sense that it pays close attention to how the code is written. For that, since the early days of Python, the Python community has created and maintained a particular flavor in its design philosophy. Today, Python is used in a wide variety of industries, ranging from education to medicine. But regardless of the industry in which it is used, the particular culture of the vibrant Python community is usually seen to be part and parcel of Python projects.

In particular, the Python community wants us to write simple code and avoid complexity wherever possible. In fact, there is an adjective, Pythonic, which means there are multiple ways to accomplish a certain task but there is a preferred way as per the Python community conventions and as per the founding philosophy of the language. Python nerds try their best to create artifacts that are as Pythonic as possible. Obviously, unpythonic code means that we are not good coders in the eyes of these nerds. In this book, we will try to go as Pythonic as possible as we can in our code and design.

And there is something official about being Pythonic as well. Tim Peters has concisely written the philosophy of Python in a short document, The Zen of Python. We know that Python is said to be one of the easiest languages to read, and The Zen of Python wants to keep it that way. It expects Python to be explicit through good documentation and as clean and clear as possible. We can read The Zen of Python ourselves, as explained next.

In order to read The Zen of Python, open up a Python console and run the import this command, as shown in the following screenshot:

Figure 1.1 – The Zen of Python

Figure 1.1 – The Zen of Python

The Zen of Python seems to be a cryptic text discovered in an old Egyptian tomb. Although it is deliberately written in this casual cryptic way, there is a deeper meaning to each line of text. Actually, look closer—it can be used as a guideline to code in Python. We will refer to different lines from The Zen of Python throughout the book. Let's first look into some excerpts from it, as follows:

  • Beautiful is better than ugly: It is important to write code that is well-written, readable, and self-explanatory. Not only should it work—it should be beautifully written. While coding, we should avoid using shortcuts in favor of a style that is self-explanatory.
  • Simple is better than complex: We should not unnecessarily complicate things. Whenever facing a choice, we should prefer the simpler solution. Nerdy, unnecessary, and complicated ways of writing code are discouraged. Even when it adds some more lines to the source code, simpler remains better than the complex alternative.
  • There should be one-- and preferably only one --obvious way to do it: In broader terms, for a given problem there should be one possible best solution. We should strive to discover this. As we iterate through the design to improve it, regardless of our approach, our solution is expected to evolve and converge toward that preferable solution.
  • Now is better than never: Instead of waiting for perfection, let's start solving the given problem using the information, assumptions, skills, tools, and infrastructure we have. Through the process of iteration, we will keep improving the solution. Let's keep things moving instead of idling. Do not slack while waiting for the perfect time. Chances are that the perfect time will never come.
  • Explicit is better than implicit: The code should be as self-explanatory as possible. This should be reflected in the choice of variable names, the class, and the function design, as well as in the overall end-to-end (E2E) architecture. It is better to err on the side of caution. Always make it more explicit whenever facing a choice.
  • Flat is better than nested: A nested structure is concise but also creates confusion. Prefer a flat structure wherever possible.
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • All code examples have been tested with Python 3.7 and Python 3.8 and are expected to work with any future 3.x release
  • Learn how to build modular and object-oriented applications in Python
  • Discover how to use advanced Python techniques for the cloud and clusters

Description

Python is a multipurpose language that can be used for multiple use cases. Python for Geeks will teach you how to advance in your career with the help of expert tips and tricks. You'll start by exploring the different ways of using Python optimally, both from the design and implementation point of view. Next, you'll understand the life cycle of a large-scale Python project. As you advance, you'll focus on different ways of creating an elegant design by modularizing a Python project and learn best practices and design patterns for using Python. You'll also discover how to scale out Python beyond a single thread and how to implement multiprocessing and multithreading in Python. In addition to this, you'll understand how you can not only use Python to deploy on a single machine but also use clusters in private as well as in public cloud computing environments. You'll then explore data processing techniques, focus on reusable, scalable data pipelines, and learn how to use these advanced techniques for network automation, serverless functions, and machine learning. Finally, you'll focus on strategizing web development design using the techniques and best practices covered in the book. By the end of this Python book, you'll be able to do some serious Python programming for large-scale complex projects.

Who is this book for?

This book is for intermediate-level Python developers in any field who are looking to build their skills to develop and manage large-scale complex projects. Developers who want to create reusable modules and Python libraries and cloud developers building applications for cloud deployment will also find this book useful. Prior experience with Python will help you get the most out of this book.

What you will learn

  • Understand how to design and manage complex Python projects
  • Strategize test-driven development (TDD) in Python
  • Explore multithreading and multiprogramming in Python
  • Use Python for data processing with Apache Spark and Google Cloud Platform (GCP)
  • Deploy serverless programs on public clouds such as GCP
  • Use Python to build web applications and application programming interfaces
  • Apply Python for network automation and serverless functions
  • Get to grips with Python for data analysis and machine learning

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 20, 2021
Length: 546 pages
Edition : 1st
Language : English
ISBN-13 : 9781801073356
Vendor :
DeepMind
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Oct 20, 2021
Length: 546 pages
Edition : 1st
Language : English
ISBN-13 : 9781801073356
Vendor :
DeepMind
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 143.97
Clean Code in Python
$49.99
Python for Geeks
$43.99
Python Object-Oriented Programming
$49.99
Total $ 143.97 Stars icon

Table of Contents

19 Chapters
Section 1: Python, beyond the Basics Chevron down icon Chevron up icon
Chapter 1: Optimal Python Development Life Cycle Chevron down icon Chevron up icon
Chapter 2: Using Modularization to Handle Complex Projects Chevron down icon Chevron up icon
Chapter 3: Advanced Object-Oriented Python Programming Chevron down icon Chevron up icon
Section 2: Advanced Programming Concepts Chevron down icon Chevron up icon
Chapter 4: Python Libraries for Advanced Programming Chevron down icon Chevron up icon
Chapter 5: Testing and Automation with Python Chevron down icon Chevron up icon
Chapter 6: Advanced Tips and Tricks in Python Chevron down icon Chevron up icon
Section 3: Scaling beyond a Single Thread Chevron down icon Chevron up icon
Chapter 7: Multiprocessing, Multithreading, and Asynchronous Programming Chevron down icon Chevron up icon
Chapter 8: Scaling out Python Using Clusters Chevron down icon Chevron up icon
Chapter 9: Python Programming for the Cloud Chevron down icon Chevron up icon
Section 4: Using Python for Web, Cloud, and Network Use Cases Chevron down icon Chevron up icon
Chapter 10: Using Python for Web Development and REST API Chevron down icon Chevron up icon
Chapter 11: Using Python for Microservices Development Chevron down icon Chevron up icon
Chapter 12: Building Serverless Functions using Python Chevron down icon Chevron up icon
Chapter 13: Python and Machine Learning Chevron down icon Chevron up icon
Chapter 14: Using Python for Network Automation Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(20 Ratings)
5 star 65%
4 star 25%
3 star 5%
2 star 5%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




MLEngineer Jan 08, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Right away, this book gets at the 'Pythonic way' to write code and more importantly read & think about code.Very nice book for both beginners and experts. Python is very good for learning, approaching, and mastering many programming paradigms: like ML for example.Great book about becoming a better programmer.
Amazon Verified review Amazon
Anand pL Dec 29, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is an industry-level book that will help you to develop the coding skills in Python that can be used for tackling complex real-world problems that will help you to perform Automation in difficult use cases.In this book, you’ll build on that foundational knowledge to learn how to leverage tools, libraries, and best practices to write exceptionally robust, efficient, maintainable, and well-performing code.This book explains the tricks and traps that turn a few lines of Python code into much more than expected, which often leads to bugs and crashes if not written or understood correctly.It also covers techniques for catching performance issues before they occur and debugging code efficiently when problems arise.The content of this book is culled from code examples provided by experienced Python programmers who have encountered the same problems that you will encounter and deal with them effectively.
Amazon Verified review Amazon
Lucinda Linde Nov 06, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Python for GeeksBuild production-ready applications using advanced Python concepts and industry best practicesBy, Muhammad AsifDisclaimer: This review has been requested by the publisher, and I am giving my honest review of this book. This review is based on reading the book. As with any Packt publication, it's also necessary to try out the code, which I will at a later point in time.OverviewThis book is aimed at the intermediate Python practitioner who wants to take their coding skill to the next level. The book starts by outlining what it takes to be ‘Pythonic’. One of the great things about Python is that there is a welcome consistency for how things work (unlike R, where any given package can have its own idiosyncratic personality). After the basics of writing code in a Pythonic manner, the book covers reusability of code- functions, modules, the core things to know for modularizing complex code and reusing code.The chapter on Advanced Object-Oriented programming helped fill a gap of knowledge and I hope to benefit from these new learnings. The rest of the book goes into advanced programming: advanced libraries, testing, automation, advanced tips and tricks, multi-threading (etc.), scaling Python across Clusters (PySpark etc.), Python in Google Cloud, Web Development (Flask), APIs, Microservices (Django), Serverless Functions, machine learning, network automation. Given the extensive functionalities covered, it will be a long time before I outgrow Python for Geeks.I'd give this book 4.6 stars, but gave it a 5 because of rounding.What I like about this bookThis is a great reference book to give a foundational understanding when encountering new levels of advanced Python programming. I also like that there are many code examples to illustrate the concept being discussed. The book says to type in the code oneself, which is an important way to cement the learning. And the outputs aren’t in the book, you have to go type in the text to see the output.The code examples build on the things created in previous chapters, which greatly aids in understanding the incremental functionality and power covered in each chapter.The chapter with Advanced Tips and Tricks has powerful ways to code: itertools, lambda functions etc. These are elegant ways to accomplish some complex tasks. I will use more of these for sure.What I don’t like about this bookI have seen other books or tutorials that explain things in a more intuitive way. For example, if I compare how functions and modules are explained in this book, it’s more formal than another book I recently read. The difference is this book efficiently explains what is what. The other book asks and answers the questions that someone learning about modules might have. Different readers will respond better to different styles- one can’t please everyone with one book or one style.After writing this review, I read the other reviews. Some reviewers wanted more tutorial, some wanted less. I’m in the camp that would have liked more tutorial. But that would have required covering less ground. It’s a tough balance to strike.OverallPython for Geeks explains the advanced functionalities that enable an intermediate python programmer to step up to being an advance programmer. It’s valuable to have all these areas from functions to multi-threading in one place with consistent examples. I will use this reference to improve my advanced python programming skills.
Amazon Verified review Amazon
TeamWoliston Dec 02, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Rife with easy to understand examples, this very clear Python reference is a great way to not only learn/improve your python skills, but also learn how to use Python in cutting edge applications such as cloud computing, AI, machine learning, Web 2.0 programming, serverless computing, general testing/automation and network automation.Based on very sounds software engineering methodologies, Asif provides a an accurate, concise and practical guide to using Python to solve modern real world problems and provide state of art digital services. Whether you just starting to learn Python or are a seasoned professional, this book will be one of the key references you keep turning to over and over again.If I had to recommend one book on Python; this would be it!
Amazon Verified review Amazon
Amazon Customer Nov 05, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Reading this book is a great pleasure. It's a great choice for people who are already familiar with python and want to improve their engineering skills. For python, it covers the most important engineering topics and good practices you need with all kinds of examples. It teaches in-depth about what python is capable of, which you will never know by simply searching on Google because you will not even think about improving your code in that direction unless you have read this book! It also shows how to develop and deploy applications on servers with python, which can be very helpful if you have such needs. Last but not least, be reading this book, you will learn a great number of good python habits and engineering patterns. This is also what I think helps me most, as I spent most of my time learning math/stats!
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.