Enhance your coding skills using the new features introduced in Python 3.9
Implement the refactoring techniques and SOLID principles in Python
Apply microservices to your legacy systems by implementing practical techniques
Description
Experienced professionals in every field face several instances of disorganization, poor readability, and testability due to unstructured code.
With updated code and revised content aligned to the new features of Python 3.9, this second edition of Clean Code in Python will provide you with all the tools you need to overcome these obstacles and manage your projects successfully.
The book begins by describing the basic elements of writing clean code and how it plays a key role in Python programming. You will learn about writing efficient and readable code using the Python standard library and best practices for software design.
The book discusses object-oriented programming in Python and shows you how to use objects with descriptors and generators. It will also show you the design principles of software testing and how to resolve problems by implementing software design patterns in your code. In the concluding chapter, we break down a monolithic application into a microservices-based one starting from the code as the basis for a solid platform.
By the end of this clean code book, you will be proficient in applying industry-approved coding practices to design clean, sustainable, and readable real-world Python code.
Who is this book for?
This book is designed to benefit new as well as experienced programmers. It will appeal to team leads, software architects and senior software engineers who would like to write Pythonic code to save on costs and improve efficiency. The book assumes that you have a strong understanding of programming
What you will learn
Set up a productive development environment by leveraging automatic tools
Leverage the magic methods in Python to write better code, abstracting complexity away and encapsulating details
Create advanced object-oriented designs using unique features of Python, such as descriptors
Eliminate duplicated code by creating powerful abstractions using software engineering principles of object-oriented design
Create Python-specific solutions using decorators and descriptors
Refactor code effectively with the help of unit tests
Build the foundations for solid architecture with a clean code base as its cornerstone
I'd describe myself as a proficient Python programmer but certainly no expert. I primarily use C/C++ but I've used Python for scripting/algorithms before. Fortunately, this book does a good job of teaching concepts in Python for both new and old users, as well as strong code design for any language.The book starts with a general introduction to good coding practices, then goes over the main features of Python before diving into how these coding practices apply to Python. The book shows lots of clear code examples and visualizations throughout its chapters. I think it does a really great job in getting the reader to think critically about code design, both in the abstract and in concrete implementation with Python.I was introduced to a lot of different terminology and features of Python; I intend to use the book both as a reference and as a launchpad for further self-learning. Definitely recommend if you want to strengthen your Python and code design skills!
Amazon Verified review
Jeff MahoneyJul 25, 2022
5
I enjoyed this book as this is the sort of information you can only get from an experienced developer. Codecademy cannot teach you these principles. Although I’m a beginner programmer, I was still able to pick up a good amount of clean code techniques from this book (though the books seems to appeal to the intermediate level).
Amazon Verified review
Amazon CustomerJun 05, 2021
5
Take it to the next leve
Amazon Verified review
SathyaMay 16, 2021
5
Full disclosure: I got a review copy of this for free.This is a great book for Python programmers who're looking at improving their skills. If you're looking at learning Python, this isn't for you. If you're a intermediate programmer looking to improve your code structing tools, this is a fantastic resource.The book starts with code formatting, meaning of clean code and generous references to PEP and why code formatting, doc strings and style guides are helpful - which is usually not dived into (usually most of them are like - do this, trust us). Also appreciated is a section on type consistency checking with mypy and setting up auto type checks with examples using Makefiles.Along the way, the book focuses on making your code more Pythonic with healthy references to slices, context managers, custom iterable objects, dunder methods , generators, yields and async code.Also notable is an entire chapter dedicated to design principles, unit testing, mocks and some examples on how to start testing with unittest and pytest frameworks. The book ends with couple of chapters dedicated to common design patterns and architecture and you're likely to refer to these chapters quite a lot of times as you implement the techniques in your programs.Overall a great book
Amazon Verified review
Josh MichielsenMay 15, 2021
5
Disclaimer: Packt sent me a copy of this book for the purposes of review. I was not paid for this review, nor have they asked me what to say.This is a great book for inexperienced developers looking to get into Python the right way. The author is knowledgable and introduces concepts in a very easy to understand manner. The book is definitely dense, however! I would recommend taking a first pass at this book, but leaving to on the desk as a reference text as you continue to learn.One of the things I really like about this book is that the author really focuses on teaching readers to write Python the way it was meant to be written. "Pythonic" code is one of those things that you need to see to understand what it is, but this book definitely gives a great demonstration of pythonic code. Part of writing Pythonic code is understanding context - and Mariano does a solid job of ensuring readers that there are contexts where practicality is more important than purity.Overall - whether you're new to programming, or you're already a programmer but looking to get into Python - give this book a go, I don't think you'll be disappointed.
Mariano Anaya is a software engineer who spends most of his time creating software with Python and mentoring fellow programmers. Mariano's principal areas of interest besides Python are software architecture, functional programming, distributed systems, and speaking at conferences. He was a speaker at Euro Python 2016 and 2017. To know more about him, you can refer to his GitHub account with the username rmariano. His speakerdeck username is rmariano.
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?
If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:
Register on our website using your email address and the password.
Search for the title by name or ISBN using the search option.
Select the title you want to purchase.
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.
Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook?
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
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?
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?
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.