Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Python Real-World Projects
Python Real-World Projects

Python Real-World Projects: Craft your Python portfolio with deployable applications

By Steven F. Lott
R$204.99 R$80.00
Book Sep 2023 478 pages 1st Edition
eBook
R$204.99 R$80.00
Print
R$256.99
Subscription
Free Trial
eBook
R$204.99 R$80.00
Print
R$256.99
Subscription
Free Trial

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
Buy Now

Product Details


Publication date : Sep 15, 2023
Length 478 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781803246765
Category :

Estimated delivery fee Deliver to Brazil

Standard 10 - 13 business days

R$63.95

Premium 3 - 6 business days

R$203.95
(Includes tracking information)
Table of content icon View table of contents Preview book icon Preview Book

Python Real-World Projects

Chapter 1
Project Zero: A Template for Other Projects

This is a book of projects. To make each project a good portfolio piece, we’ll treat each project as an enterprise software product. You can build something that could be posted to a company’s (or organization’s) internal repository.

For this book, we’ll define some standards that will apply to all of these projects. The standards will identify deliverables as a combination of files, modules, applications, notebooks, and documentation files. While each enterprise is unique, the standards described here are consistent with my experience as a consultant with a variety of enterprises.

We want to draw an informal boundary to avoid some of the steps required to post to the PyPI website. Our emphasis is on a product with test cases and enough documentation to explain what it does. We don’t want to go all the way to creating a project in PyPI. This allows us to avoid the complications of a build system...

1.1 On quality

It helps to have a clear definition of expectations. For these expectations, we’ll rely on the ISO 25010 standard to define quality goals for each project. For more details, see https://iso25000.com/index.php/en/iso-25000-standards/iso-25010.

The ISO/IEC 25010:2011 standard describes Systems and software Quality Requirements and Evaluation (SQuaRE). This standard provides eight characteristics of software. These characteristics are as follows:

  • Functional suitability. Does it do what we need? It is complete, correct, and appropriate for the user’s expressed (and implied) needs? This is the focus of each project’s description.

  • Performance efficiency. Does it work quickly? Does it use the minimum resources? Does it have enough capacity to meet the user’s needs? We won’t address this deeply in this book. We’ll talk about writing performance tests and ways to address performance concerns.

  • Compatibility. Does it co-exist with other...

1.2 Suggested project sprints

We hesitate to provide a detailed step-by-step process for building software. For more experienced developers, our sequence of steps may not match their current practices. For less experienced developers, the suggested process can help by providing a rational order in which the deliverables can be built.

There was a time when a ”statement of work” with a detailed list of specific tasks was a central part of a software development effort. This was often part of a ”waterfall” methodology where requirements flowed to analysts who wrote specifications that flowed down to designers who wrote high-level designs that flowed down to coders. This wasn’t a great way to build software, and has been largely supplanted by Agile methods. For more information on Agility, see https://agilemanifesto.org.

The Agile approach lets us examine a project both as a series of steps to be completed, as well as a collection of deliverables that need...

1.3 List of deliverables

We’ll take another look at the project, this time from the view of what files will be created. This will parallel the outline of the activities shown in the previous section.

The following outline shows many of the files in a completed project:

  • The documentation in the docs directory. There will be other files in there, but you’ll be focused on the following files:

    • The Sphinx index.rst starter file with references to overview and API sections.

    • An overview.rst section with a summary of the project.

    • An api.rst section with .. automodule:: commands to pull in documentation from the application.

  • A set of test cases in the tests directory.

    • Acceptance tests aimed at Behave (or the pytest-bdd plug-in for Gherkin). When using Behave, there will be two sub-directories: a features directory and a steps directory. Additionally, there will be an environment.py file.

    • Unit test modules written with the pytest framework. These all have a name that starts...

1.4 Development tool installation

Many of the projects in this book are focused on data analysis. The tooling for data analysis is often easiest to install with the conda tool. This isn’t a requirement, and readers familiar with the PIP tool will often be able to build their working environments without the help of the conda tool.

We suggest the following tools:

  • Conda for installing and configuring each project’s unique virtual environment.

  • Sphinx for writing documentation.

  • Behave for acceptance tests.

  • Pytest for unit tests. The pytest-cov plug-in can help to compute test coverage.

  • Pip-Tool for building a few working files from the pyproject.toml project definition.

  • Tox for running the suite of tests.

  • Mypy for static analysis of the type annotations.

  • Flake8 for static analysis of code, in general, to make sure it follows a consistent style.

One of the deliverables is the pyproject.toml file. This has all of the metadata about the project in a single place. It lists packages...

1.5 Project 0 – Hello World with test cases

This is our first project. This project will demonstrate the pattern for all of the book’s projects. It will include these three elements.

  • Description: The description section will set out a problem, and why a user needs software to solve it. In some projects, the description will have very specific details. Other projects will require more imagination to create a solution.

  • Approach: The approach section will offer some guidance on architectural and design choices. For some projects there are trade-offs, and an Extras section will explore some of the other choices.

  • Deliverables: The deliverables section lists the expectations for the final application or module. It will often provide a few Gherkin feature definitions.

For this initial project, the description isn’t going to be very complicated. Similarly, the approach part of this first project will be brief. We’ll dwell on the deliverables with some additional...

1.6 Summary

In this chapter, we’ve looked at the following topics:

  • An overview of the software quality principles that we’ll try to emphasize.

  • A suggested approach to completing the project as a sequence of project sprints.

  • A general overview of the list of deliverables for each project.

  • The tools suggested for creating these examples.

  • A sample project to act as a template for subsequent projects.

After creating this initial project, the next chapter will look at the general collection of projects. The idea is to create a complete data analysis tool set with a number of closely-related projects.

1.7 Extras

Here are some ideas for you to add to this project.

1.7.1 Static analysis - mypy, flake8

There are several common static analysis tools that are as essential as automated testing:

  • mypy checks type annotations to be sure the functions and classes will interact properly.

  • flake8 does other syntax checks to make sure the code avoids some of the more common Python mistakes.

  • black can be used to check the formatting to make sure it follows the recommended style. The black application can also be used to reformat a new file.

  • isort can be used to put a long collection of import statements into a consistent order.

Once the application passes the functional tests in the *.feature files, these additional non-functional tests can be applied. These additional tests are often helpful for spotting more nuanced problems that can make a program difficult to adapt or maintain.

1.7.2 CLI features

The command-language interface permits a single option, the --who option, to provide a...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Master Python and related technologies by working on 12 hands-on projects
  • Accelerate your career by building a personal project portfolio
  • Explore data acquisition, preparation, and analysis applications
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

In today's competitive job market, a project portfolio often outshines a traditional resume. Python Real-World Projects empowers you to get to grips with crucial Python concepts while building complete modules and applications. With two dozen meticulously designed projects to explore, this book will help you showcase your Python mastery and refine your skills. Tailored for beginners with a foundational understanding of class definitions, module creation, and Python's inherent data structures, this book is your gateway to programming excellence. You’ll learn how to harness the potential of the standard library and key external projects like JupyterLab, Pydantic, pytest, and requests. You’ll also gain experience with enterprise-oriented methodologies, including unit and acceptance testing, and an agile development approach. Additionally, you’ll dive into the software development lifecycle, starting with a minimum viable product and seamlessly expanding it to add innovative features. By the end of this book, you’ll be armed with a myriad of practical Python projects and all set to accelerate your career as a Python programmer.

What you will learn

Explore core deliverables for an application including documentation and test cases Discover approaches to data acquisition such as file processing, RESTful APIs, and SQL queries Create a data inspection notebook to establish properties of source data Write applications to validate, clean, convert, and normalize source data Use foundational graphical analysis techniques to visualize data Build basic univariate and multivariate statistical analysis tools Create reports from raw data using JupyterLab publication 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
Buy Now

Product Details


Publication date : Sep 15, 2023
Length 478 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781803246765
Category :

Estimated delivery fee Deliver to Brazil

Standard 10 - 13 business days

R$63.95

Premium 3 - 6 business days

R$203.95
(Includes tracking information)

Table of Contents

20 Chapters
Preface Chevron down icon Chevron up icon
1. Chapter 1: Project Zero: A Template for Other Projects Chevron down icon Chevron up icon
2. Chapter 2: Overview of the Projects Chevron down icon Chevron up icon
3. Chapter 3: Project 1.1: Data Acquisition Base Application Chevron down icon Chevron up icon
4. Chapter 4: Data Acquisition Features: Web APIs and Scraping Chevron down icon Chevron up icon
5. Chapter 5: Data Acquisition Features: SQL Database Chevron down icon Chevron up icon
6. Chapter 6: Project 2.1: Data Inspection Notebook Chevron down icon Chevron up icon
7. Chapter 7: Data Inspection Features Chevron down icon Chevron up icon
8. Chapter 8: Project 2.5: Schema and Metadata Chevron down icon Chevron up icon
9. Chapter 9: Project 3.1: Data Cleaning Base Application Chevron down icon Chevron up icon
10. Chapter 10: Data Cleaning Features Chevron down icon Chevron up icon
11. Chapter 11: Project 3.7: Interim Data Persistence Chevron down icon Chevron up icon
12. Chapter 12: Project 3.8: Integrated Data Acquisition Web Service Chevron down icon Chevron up icon
13. Chapter 13: Project 4.1: Visual Analysis Techniques Chevron down icon Chevron up icon
14. Chapter 14: Project 4.2: Creating Reports Chevron down icon Chevron up icon
15. Chapter 15: Project 5.1: Modeling Base Application Chevron down icon Chevron up icon
16. Chapter 16: Project 5.2: Simple Multivariate Statistics Chevron down icon Chevron up icon
17. Chapter 17: Next Steps Chevron down icon Chevron up icon
18. Other Books You Might Enjoy Chevron down icon Chevron up icon
19. Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
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.