Skip to content

Instantly share code, notes, and snippets.

View hoseinit's full-sized avatar

Sam Hamedi hoseinit

  • PAYBACK GmbH
  • Munich
View GitHub Profile
@hoseinit
hoseinit / logging_config.py
Created March 6, 2025 14:58
A logger which can be used accross the python module classes and write into a file which is labled based on date
import logging
import os
from datetime import datetime
class Logger:
_instance = None
def __new__(cls, log_prefix='projectname', level=logging.INFO, log_folder='logs'):
if cls._instance is None:
cls._instance = super(Logger, cls).__new__(cls)
@hoseinit
hoseinit / data-mover.py
Created January 26, 2026 15:47
A script to find the missing rows from a source table compared with destination table and create a cql file to import the diffs
#!/usr/bin/env python3
"""
Cassandra Data Import Tool - Offline CQL Generator
- Reads local CSV dumps for source and target tables
- Finds rows present in source but missing in target
- Writes a CQL script with INSERT statements (optionally IF NOT EXISTS)
- No direct Cassandra connection required
Run:
python3 generate_missing_inserts.py