Interesting links on Python programming¶
This page is a compilation of links I found interesting while learning Python and while solving everyday problems. As I keep on learning this list evolves continuously :-)
“the most dangerous thought you can have as a creative person, is that you know what you are doing.” Bret Victor - The Future of Programming.
For Beginners¶
Python as a language¶
- What makes Python a great language?
- Python is known for being a language that’s easy to read, quick to develop in, and applicable to a wide range of scenarios
- Writing your first Python program
- How long did it take you to learn Python Wait, don’t answer that. It doesn’t matter. Ned Batchelder
Software engineering¶
- Cognitive Biases In Software Development
- What scientists must know about hardware to write fast code A simplified view - but not over-simplified - on how hardware affects performance. Written with Julia in mind rather than Python, but the principles remain valid.
- Clean architecture
- The Grand Unified Theory of Software Architecture
Python internals¶
Python for HPC¶
Here’s a list of approaches that rely on low-lever programming languages, as C, C++ and Fortran, for speeding up Python (sequential) code. Some of these approaches, e.g. Numba rely on automatic code transformation from Python, so there is no need to write low-level code yourself.
- Performance Python: Seven Strategies for Optimizing Your Numerical Code
- High performance Python 1
- High performance Python 2
- High performance Python 3
- Python Bindings: Calling C or C++ From Python
Approaches mimicking or wrapping OpenMP and MPI:
- Pymp – OpenMP-like Python Programming A really interesting concept, not as efficient as OpenMP itself (which incurs quite a bit of overhead itself), and, of course, limited to a single node. As the number of cores per node keeps increasing, pymp may be a good solution for problems that can do with a single node.
- High performance Python 4 Mpi4py, doing mpi from Python.
Other parallel processing approaches:
- Sequential Execution, Multiprocessing, and Multithreading IO-Bound Tasks in Python
- Common Issues Using Celery (And Other Task Queues)
- The Parallelism Blues: when faster code is slower
- Dask
Concepts and ideas:
- Does it ever make sense to use more concurrent processes than processor cores? You can have as many threads as you want as long as they’re doing nothing.
Code modernization¶
Profiling¶
Resource monitoring¶
Python idioms and readability¶
- The Elements of Python Stylez
- Practical decorators Reuven Lerner
- Elegant Solutions For Everyday Python Problems - PyCon 2018
- Yes, It’s Time to Learn Regular Expressions - PyCon 2017
- Decorators, unwrapped How do they work - PyCon 2017
- Decorators and descriptors decoded - PyCon 2017
- The Dictionary Even Mightier - PyCon 2017
- Looping Like a Pro in Python - PyCon 2017
- Readable Regular Expressions - PyCon 2017
- Passing Exceptions 101 Paradigms in Error Handling - PyCon 2017
- Readability Counts - PyCon 2017
- Modern Python Dictionaries: A confluence of a dozen great ideas - PyCon 2017
- Gang of 4 inspired decorators
- Python module of the week
- Type hints for busy programmers
- Exceptions
- Python Tips and Tricks, You Haven’t Already Seen - part 1
- Python Tips and Tricks, You Haven’t Already Seen - part 2
- 30 Python Best Practices, Tips, And Tricks
- pythonic things
- 71 Python Code Snippets for Everyday Problems
- Clean Code Concepts Adapted for Python
- The place of the ‘is’ syntax in Python
- 5 Things You’re Doing Wrong When Programming in Python
- 10 Python Tips and Tricks For Writing Better Code
- Tour of Python Itertools
- Getting the most out of Python collections
- Unpacking in Python: Beyond Parallel Assignment
- When Python Practices Go Wrong About the use of exec() and eval(). A presentation, so, the logic isn`t always obvious, but definitely an interesting topic. Here’s the corresponding video When Python Practices Go Wrong - Brandon Rhodes - code::dive 2019
- The Curious Case of Python’s Context Manager
- Demystifying Python’s Descriptor Protocol
- Why You Should Use More Enums In Python
- Regular Expressions: Regexes in Python (Part 1)
- Regular Expressions: Regexes in Python (Part 2)
- 10 Awesome Pythonic One-Liners Explained
- Stop writing classes
- Generators, Iterables, Iterators in Python: When and Where
- New Features in Python 3.9 You Should Know About
- The Curious Case of Python’s Context Manager
- Demystifying Python’s Descriptor Protocol
- Python 101 – Working with Strings
- A Guide to Python Lambda Functions
- Pythonic code review
- Python args and kwargs: Demystified
- Python Dictionary Iteration: Advanced Tips & Tricks
- Python Code style and pythonic idioms
Useful packages¶
- safer: a safer file writer
- sproc: subprocesses for subhumanses
- The 22 Most-Used Python Packages in the World
- Five Amazing Python Libraries you should be using!
- The most underrated python packages
- No Really, Python’s Pathlib is Great
- Python 101 – Creating Multiple Processes
- Python Packages: Five Real Python Favorites
- Python and PDF: A Review of Existing Tools
- A cross-platform Python module for copy and paste clipboard functions
- The Python pickle Module: How to Persist Objects in Python
- Pickle’s nine flaws
- Taichi:a programming language designed for high-performance computer graphics
- rich: rich text and beautiful formatting in the terminal
Exceptions¶
Type checking in Python¶
Design patterns¶
Testing¶
- Getting Started Testing: pytest edition
- tox nox and invoke Break the Cycle: Three excellent Python tools to automate repetitive tasks
- Hypothesis
- Escape from auto-manual testing with Hypothesis!
- Beyond Unit Tests: Taking Your Testing to the Next Level - PyCon 2018
- How to mock in Python? – (almost) definitive guide
- Why your mock doesn’t work
- Visual Testing with PyCharm and pytest - PyCon 2018
- “WHAT IS THIS MESS?” - Writing tests for pre-existing code bases - PyCon 2018
- Python Testing 201 with pytest
- 8 great pytest plugins
- Pytest Features, That You Need in Your (Testing) Life
- An Introduction To Test Driven Development
- How To Write Tests For Python
- How I’m testing in 2020
- Building Good Tests
- Property-based tests for the Python standard library (and builtins)
- a pytest plugin designed for analyzing resource usage
- ward - A modern Python test framework
- The Clean Architecture in Python - How to write testable and flexible code
- Effective Python Testing With Pytest
- Document your tests
- 15 amazing pytest plugins and more (an episode on an interesting blog).
- ARRANGE-ACT-ASSERT: A PATTERN FOR WRITING GOOD TESTS
- There’s no one right way to test your code
- Why you should document your tests
Debugging¶
Profiling¶
Scientific Python¶
Machine learning and datascience¶
- Scikit-learn, wrapping your head around machine learning - PyCon 2019
- Applied Deep Learning for NLP Using PyTorch
- Data Science Best Practices with pandas - PyCon 2019
- Thinking like a Panda: Everything you need to know to use pandas the right way
- Plotnine: Grammar of Graphics for Python
- Top 10 Python libraries of 2019
- Top 10 Python Packages for Machine Learning
- streamz: Build Pipelines to Manage Continuous Streams of Data
- nfstream - A flexible network data analysis framework
CLIs¶
Packaging¶
- Inside the Cheeseshop: How Python Packaging Works - PyCon 2018 historical overview with thorough explanation
- Share Your Code! Python Packaging Without Complication - PyCon 2017
- A Python alternative to Docker
- The Python Packaging Ecosystem
- Python Packaging Is Good Now
- Conda: Myths and Misconceptions
- The private PyPI server powered by flexible backends
- Packaging without setup.py
- PDM - Python Development Master
- Python Packaging Made Better: An Intro to Python Wheels
- Options for packaging your Python code: Wheels, Conda, Docker, and more
- What the heck is pyproject.toml?
Graphics¶
- matplotlib
- “Cyberpunk style” for matplotlib plots
- Effectively using matplotlib
- ModernGL : a python wrapper over OpenGL 3.3+
- Magnum: Lightweight and modular C++11/C++14 graphics middleware for games and data visualization
- Grammar of graphics for Pyhon (using plotnine and pandas)
- plotly Express
- widgets in matplotlib
Installing packages¶
Tools¶
- Software Development Checklist for Python Applications
- IPython and Jupyter in Depth: High productivity, interactive Python Matthias Bussonier
- Faster Python Programs - Measure, don’t Guess - PyCon 2019
- Python Tooling Makes a Project Tick
- Life Is Better Painted Black, or: How to Stop Worrying and Embrace Auto-Formatting
- Using GitHub, Travis CI, and Python to Introduce Collaborative Software Development - PyCon 2018
- What’s in your pip toolbox - PyCon 2017
- How can I get tox and poetry to work together to support testing multiple versions of a Python dependency?
- Understanding Best Practice Python Tooling by Comparing Popular Project Templates
- My unpopular meaning about Black code formatter
- Python static analysis tools
- Leverage Sublime project folders to ease your work
- Deep dive into how pyenv actually works by leveraging the shim design pattern
- 9 useful tricks of git branch
- gitutor
- Things You Want to Do in Git and How to Do Them
- Helpful git commands for beginners
Development environment, developement workflow¶
- pyenv+poetry+pipx <https://jacobian.org/2019/nov/11/python-environment-2020/>
- https://sourcery.ai/blog/python-best-practices/
- https://pypi.org/project/create-python-package/ a micc ‘light’
- Managing Python Environments
- Using Sublime Text for python
- How to Set Up a Python Project For Automation and Collaboration
- Hypermodern Python
- Thoughts on where tools fit into a workflow
- poetry
- Blazing fast CI with GitHub Actions, Poetry, Black and Pytest
Problem solving¶
Documentation¶
Django¶
Compilers¶
Notebooks¶
Windows¶
- Using WSL to Build a Python Development Environment on Windows This is promising: maybe we finally have a an environment on Windows with a minimal difference from Linux an MacOSX.