Level up your SRE game — Best of this week — 15th Jan 2023
“The more that you read, the more things you will know. The more that you learn, the more places you’ll go.” — Dr. Seuss
I compile Site Reliability Engineering/DevOps related articles every week and help you keep up your learning game.
This week we covered:
- Python best practices — cookiecutter template
- Navigate through large codebase easily in vscode
- A guide to improve your Python OOP skills
- Logging in python — oversimplified
I also write about the tools and tips related to Software Development and SRE regularly on my Linkedin profile. You can check out my profile here: https://www.linkedin.com/in/vikasyadav94/
Python best practices — cookiecutter template
Time saved is money earned!
When starting a new Python project, it is tempting to just dive in and start coding. Spending some time to set up a project with the best tools can save immense time and lead to a happier coding experience.
Here’s a cookiecutter template that lets you get started fast with a new project: https://lnkd.in/erk4kTS3
This project offers the following configuration out of the box
-> Testing with pytest
-> Formatting with black
-> Import sorting with isort
-> Static typing with mypy
-> Linting with flake8
-> Git hooks that run all the above with pre-commit
-> Deployment ready with Docker
-> Continuous Integration with GitHub Actions
Give it a shot for your next scripting idea and start writing better code!
#python #programming #github #opensource
Navigate through large codebase easily in vscode
Navigating through a large codebase can get difficult at times! What if you could bookmark any line of code that you frequently use and then quickly navigate through all the bookmarks?
Check out this plugin of vscode: https://lnkd.in/ehQWTEZS
Not only is this plugin a huge time saver, but it also helps to keep your workspace organized and tidy. No more searching through multiple files to find what you need — with Bookmarks, it’s just a quick shortcut away.
Install the Bookmarks plugin for VSCode today and start bookmarking your way to efficiency!
#vscode #bookmarks #plugin #softwareengineering
A guide to improve your Python OOP skills
I used to write a lot of amateur python code till I landed upon this book. You can’t believe how efficient you can get if you learn to do Object-oriented programming right with python.
Here are some interesting things you can learn from this book:
👉 Discover SOLID design patterns and principles and how to implement them in python.
👉 Design testable code using pytest and fixtures — Writing testable code in python is an art — if you do it right the rewards are exponential.
👉 Understand how to design context managers that leverage the ‘with’ statement — comes in very handy in scenarios where you are accessing IO-intensive resources.
👉 Create a new type of collection using the standard library and design techniques — See how to extend and work with the collections library of python.
And much more. I highly recommend this book to anyone who wants to level up their game in python.
Logging in python — oversimplified
Logging in Python was never this simple!
I am a power user of Python logging library but I’ve fallen in love with this one because of its simplicity.
Loguru makes logging easy and intuitive! Whether you’re new to programming or a seasoned pro, Loguru provides a simple and elegant way to log messages, exceptions, and even performance metrics with minimal setup.
Loguru offers
-> Quick logging with zero config
-> Customizable formatting of log messages
-> Ability to send logs to a file or remote server with minimal configuration
-> Automatic file rotation
-> Easy to use API
Checkout loguru here: https://lnkd.in/eWxW7cmu