Increasing my Python productivity - Go, Python!
Blazingly fast!
I write a lot of Python. I normally use Pipenv
to manage my project dependencies.
My old Python workflow
The steps I take to create a new Python project are these:
- Make a new directory
- Initialise a git repo
- Initialise a
Pipenv
- Install
pytest
as a dev dependency - Create a
.gitignore
file and ignore some standard stuff - Create a
src
folder - Create a
tests
folder - Create a
main.py
entrypoint script - Install packages using Pipenv, open up the Pipfile and manually pin dependency versions because Pipenv lists dependencies using
<package name> = "*"
by default.
Doing this each time gets tiring. Really tiring!
“Go, Python!” - a little script to save a little bit of time
Lately, I’ve been watching a lot of ThePrimeagen’s videos on YouTube. The guy is obsessed with developer productivity so it got me thinking. How could I level up my own Python productivity? How can I become “blazingly fast” like him?
I decided to write a simple CLI! You can find it here. It works for me, but it might not work for you. Please contribute to it!
My new Python workflow
Blazingly fast!
- Navigate to root directory where I want my project directory to be created
- Issue
gopython
- Speficy a project directory name. If I want to create the project in the current directory, leave it blank.
- Install packages using
gopython -i <pacakge name>
and simultaneously pin package versions in the Pipfile - Start writing Python
Hooray!
My Python productivity has increased immensely. Unfortunately, my overall productivity has dropped because I’m currently learning Vim! The discomfort is immense. But it’ll all be worth it soon.
Justin