April 29, 2024

Pluggy! Implementing plugin system in python

Plugin architecture is quite handy when you are designing a developer-facing library. A lot of times I wanted to allow users to inject their code in some way to extend the core library functions and add domain-specific customizations. I found a great approach while going through tox source code and discovered Pluggy which builds on top of Python’s entry_point feature. I was amazed to know thatentry_point is not just for CLI, but a clean plugin system that comes with Python....

April 23, 2024

Condition Variables - A cool synchronization technique!

I was a bit taken aback to come to know about condition-variables this late in my journey. Condition variables allow you to wait and notify other threads when a certain event occurs. I understood it best through an example. Following is a code sample for Producer-Consumer problem using mutexes. producer-consumer-just-mutex.py from threading import Thread, Lock import time, random mutex = Lock() items = [] def timer(t): while t: time.sleep(1) print(f"Time: {t}") t -= 1 def producer(): while True: with mutex: print("Acquired lock in producer") items....

October 23, 2023

Implementing a 2D renderer using Skia for p5

My open source journey started with p5py and I was very glad when the Processing Foundation offered to directly sponsor my GSoC project for the Summer’22 after not being able to get a slot under GSoC’22. I also owe this to my mentor Mark Zhang for all the selfless efforts he did for me to get this opportunity :) Project Description / Brief p5py started as a GSoC project in 2017 with the aim to replicate Processing APIs in pure pythonic code....

Autotype

Does exactly what the name says! This started as a small CLI script I wrote out of frustation from my college’s assessment portal. The issue was we had to do very long coding assigments on the portal and it was very laggy, with no copy-paste enabled and wasted a lot of time for me and my peers to get a solution working and tests passing on that portal. The solution was to code solutions on your local and then autotype it on the portal, and this is how Autotype was born....

Flagsmith

Flagsmith is an open source, fully featured, Feature Flag and Remote Config service. Use our hosted API, deploy to your own private cloud, or run on-premise. (copy-pasted straight from their GitHub) It’s quite fun to contribute there majorly due to high quality reviews. Migration to Poetry #2214 In this PR, I worked on migrating the entire project from plain old requirements.txt to using poetry. There were a lot of learnings and you can go through the comments to pick the best practices when using poetry....

p5py

p5 is a Python library that provides high level drawing functionality to help you quickly create simulations and interactive art using Python. It combines the core ideas of Processing. PS: Let me know if you want to help maintain this project! Refactoring of code to support single pattern to support multiple renderers at runtime My first exposure to implementing singleton design pattern. This PR basically dealt with refactoring the code base to remove dependency on Vispy specific APIs....

Sarthi

Vercel for Backend! Easily setup preview environments with just Docker I really wanted to have a tool that can enable preview environments for my projects without much husstle. I was majorly looking for something that can take in a docker-compose file at the root of project and gives you preview environments right out of the box, that can be self hosted on your server. This project uses a lot of other OSS projects to export logs, manage secrets, monitoring and for admin actions....