Skip to content

Instantly share code, notes, and snippets.

View kgantsov's full-sized avatar
🇺🇦

Kostiantyn Hantsov kgantsov

🇺🇦
  • iconik.io
  • Stockholm, Sweden
View GitHub Profile
@kgantsov
kgantsov / peewee_rqlite.py
Created October 21, 2025 18:06
Minimalistic Peewee adapter for rqlite
import requests
import json
import time
from peewee import *
class RqliteCursor:
"""Minimal cursor-like wrapper for rqlite query responses."""
def __init__(self, rows=None, columns=None, lastrowid=None, rowcount=None):
self._rows = rows or []
self._columns = columns or []
@kgantsov
kgantsov / README.md
Last active November 12, 2025 07:23
Leader election with Consul

Leader election with Consul

Install the Python Consul client:

pip install python-consul

Run consul