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
€23.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781801070119
Vendor :
DeepMind
Category :
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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
€264.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 106.97
Clean Code in Python
€37.99
Python for Geeks
€32.99
Python Object-Oriented Programming
€35.99
Total 106.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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.