Back to Browse

Build w/ Python 4: Python Code Refactoring (Modular python functions)

388 views
Apr 9, 2022
26:06

How do we go from a long all-encompassing monolithic python function to small, testable, modular python functions? That's what this episode is about. We explore the mental models required to write modular python functions, making them more maintainable, testable and predictable. If you want to follow along the full series, fork the code from the repo or go to the full playlist where we build a python package for a terminal-based productivity tool. Full Playlist: https://www.youtube.com/playlist?list=PLXsFtK46HZxXIVE4tRjwMjwKFVaQSdT5W Watch Part 0 [Taskwarrior: Terminal-based task management for getting things done (GTD) | Productivity tutorial]: https://youtu.be/cDYIes9avW4 Watch Part 1 [Build w/ Python 1: Command line productivity scoreboard for TaskWarrior]: https://youtu.be/lT2jqmhRkxo Watch Part 2 [Build w/ Python 2: Colorful terminal CLI, argparse, python package structure (production-ready)]: https://youtu.be/DpvnLO6vw2I [Build w/ Python 3: Build & Publish our Python Package!] :https://youtu.be/2M9jyjPAR2k This episode covers how to write modular python functions through code refactoring our python package! Breaking up one big function into several smaller functions for unit testing! Anyone in the world can now just run `pip install taskquant` and see a scoreboard of their task by doing `tq` (stands for "TaskQuant") Link to code repo: https://github.com/onlyphantom/taskquant Link to PyPI: https://pypi.org/project/taskquant/ Link to tasklib: https://github.com/GothenburgBitFactory/tasklib Link to TaskWarrior: https://github.com/GothenburgBitFactory/taskwarrior

Download

0 formats

No download links available.

Build w/ Python 4: Python Code Refactoring (Modular python functions) | NatokHD