Advanced Python Development: Using Powerful Language Features in Real-World Applications
Matthew Wilkes
Résumé
Some powerful aspects of Python are often documented with contrived examples that explain the feature as a standalone example only. By following the design and build of a real-world application example from prototype to production quality you'll see not only how the various pieces of functionality work but how they integrate as part of the larger system design process. In addition, you'll benefit from the kind of useful asides and library recommendations that are a staple of conference Q&A sessions at Python conferences as well as discussions of modern Python best practice and techniques to better produce clear code that is easily maintainable.
Advanced Python Development is intended for developers who can already write simple programs in Python and want to understand when it's appropriate to use new and advanced language features and to do so in a confident manner. It is especially of use to developers looking to progress to a more senior level and to very experienced developers who have thus far used older versions of Python.
What You'll Learn
- Understand asynchronous programming
- Examine developing plugin architectures
- Work with type annotations
- Review testing techniques
- Explore packaging and dependency management
Developers at the mid to senior level who already have Python experience.
Chapter 2: Testing, Checking and LintingChapter Goal: Progress the prototype to a series of reliable functions thatcan be testedNo of pages: 30Sub - Topics1 Testing with PyTest (especially fixtures and MUT style)2 Type hinting and checking with mypy3 Linting with flake8 and autoformatting with black4 pre-commit and commit hooks5 GitHub CI integration for easier contributions
Chapter 3: Packaging ScriptsChapter Goal: Create an installable package that gives a single script toread the sensor valueNo of pages : 30Sub - Topics:1 setup.py and setuptools when it comes to packaging (not pip /setup.py for environment management, that's in chapter 1)2 Namespace packages3 Console entrypoint4 argparseHelpful aside: Package name conflicts, installing from GitHub releases,release hashing, wheels
Chapter 4: From Script to LibraryChapter Goal: Extend the package to allow reading of multiple sensorsthrough the command lineNo of pages: 20Sub - Topics:1. Abstract Base Classes2. Second sensor value3. argparse subcommands
Chapter 5: Alternative InterfacesChapter Goal: Make the script functionality available as a HTTPmicroserviceNo of pages : 40Sub - Topics:1 Simple API servers using flask2 Plugin architecture using entrypoints3 Dynamic dispatch4 Serialisation considerations with custom classes (like units from pintspackage)
Chapter 6: Speeding Things UpChapter Goal: Discuss optimisation strategies, what the tradeoffs betweenasync and different types of caching are. We'll use cachinghere, but async laterNo of pages : 25Sub - Topics:1 asyncio vs lru_cache vs redis vs sqlite etc2 Use of timeit3 File operations using context managers
Chapter 7: Aggregation ProcessChapter Goal: Create a new package, read configuration files, do a basicHTTP loopNo of pages : 25Sub - Topics:1 cookiecutter2 Config files (configparser vs json vs yaml)3 Requests library4 More depth in pytest usage
Chapter 8: Asynchronous ProgrammingChapter Goal: Understand the event loop, especially async for loops,demonstrate how it's a good fit for the aggregation processNo of pages : 40Sub - Topics:1 Defining asynchronous functions2 Using the event loop3 Syntactic sugar for loops and iterators4 Async tasks vs await5 async executors
Chapter 9: Asynchronous DatabasesChapter Goal: Understand async executors, using sqlalchemy and JSONBNo of pages : 30Sub - Topics:1 sqlalchemy (and why pandas isn't a good fit here)2 JSONB format and schemaless3 aiofile, asyncpg and usability/speed tradeoffs
Chapter 10: Viewing the DataChapter Goal: Creating Jupyter notebooks and using matplotlibNo of pages : 35Sub - Topics:1 Calling async functions from Jupyter Notebooks2 Binding function calls to ipywidgets for interactive reports3 Examples of matplotlib4 GeoJSON
Chapter 11: Fault ToleranceChapter Goal: Extending ABC interfaces and efficient use of iterables forlarge HTTP responsesNo of pages : 20Sub - Topics:1 Using __subclasshook__ effectively2 Chunked responses vs framing3 JSON deserialisation of partial data and efficient data transfer
Chapter 12: Callbacks and Data AnalysisChapter Goal: Using generators, iterators and coroutines for dataanalysis, async timeoutsNo of pages : 30Sub - Topics:1 Iterator based filtering2 Coroutine based plugins, for example a coroutine that pulls historicaldata and compares it to the current value to decide if an alarm shouldbe raised3 waitfor and executor timeout considerations
Matthew Wilkes is a European software developer who has worked with Python on web projects for the last fifteen years. As well as developing software, he has long experience in mentoring Python developers in a commercial setting.
He is also very involved in open source software, with commits to many popular
frameworks. His contributions in that space are focused on the details of database and security interactions of web frameworks.
Caractéristiques techniques
| PAPIER | |
| Éditeur(s) | Apress |
| Auteur(s) | Matthew Wilkes |
| Parution | 25/07/2020 |
| Nb. de pages | 605 |
| EAN13 | 9781484257920 |
Avantages Eyrolles.com
Consultez aussi
- Les meilleures ventes en Graphisme & Photo
- Les meilleures ventes en Informatique
- Les meilleures ventes en Construction
- Les meilleures ventes en Entreprise & Droit
- Les meilleures ventes en Sciences
- Les meilleures ventes en Littérature
- Les meilleures ventes en Arts & Loisirs
- Les meilleures ventes en Vie pratique
- Les meilleures ventes en Voyage et Tourisme
- Les meilleures ventes en BD et Jeunesse