Skip to content

Instantly share code, notes, and snippets.

Avatar

Theo van der Sluijs tvdsluijs

View GitHub Profile
@tvdsluijs
tvdsluijs / energielabel.py
Created Jun 7, 2022
Energie label opvragen via Python
View energielabel.py
# Dingen om te doen
# pip install requests
# API KEY ophalen bij https://epbdwebservices.rvo.nl
# mij een kleine donatie geven :-)
import requests
from dbase import MainSQL
from time import sleep
class EnergieLabel:
@tvdsluijs
tvdsluijs / p1_python_smart_meter.py
Created Nov 3, 2020
Python script om P1 slimme meter standen op te slaan in sqlite
View p1_python_smart_meter.py
# Python script om P1 weer te geven
# http://domoticx.com/p1-poort-slimme-meter-telegram-uitlezen-met-python/
import re
import os
import serial # pip install pyserial
import time
import sqlite3
import logging
View sudoku_solve.py
# SuDoKu Solver in Python
# With special thanks to Computerphile (Danke Thorsten!)
# https://www.youtube.com/watch?v=G_UYXzGuqvM FUN TO WATH
# Make a list of each row of Sudoku numbers, empty = 0
# Put each list (row) in a list and run!
import sys
@tvdsluijs
tvdsluijs / bulk-export.yml
Created Jul 2, 2020
Screaming Frog -bulk-export list of names and filenames (when using command line)
View bulk-export.yml
bulk_exports:
-
file: all_inlinks.csv
name: All Inlinks
-
file: all_outlinks.csv
name: All Outlinks
-
file: queued_urls.csv
name: Queued URLs
@tvdsluijs
tvdsluijs / img_ocr.py
Created Jul 2, 2020
Get text from Images with python and pytesseract
View img_ocr.py
import sys
import pytesseract
from pathlib import Path
from glob import glob
from os.path import join
class ImageOcr:
def __init__(self, my_path: Path = None):
@tvdsluijs
tvdsluijs / downtube.py
Created Sep 16, 2019
For downloading one or multiple youtube video's
View downtube.py
"""
Author : Theo van der Sluijs
License: MIT
Version: 1.0
V-Date: 16 sept 2019
email: theo@vandersluijs.nl
installation:
create a folder called : youtube
install pytube: pip install pytube
@tvdsluijs
tvdsluijs / jekyll2medium.py
Last active Jan 31, 2020
Import all you Markdown Jekyll files to Medium
View jekyll2medium.py
import requests
import json
import os
import re
import yaml
class ImportMDs:
def __init__(self, m_token=None, git_username=None):
try:
@tvdsluijs
tvdsluijs / feature2imagepath.py
Created Jul 13, 2019
Change jekyll feature-img, image tag to image: paht: and image:
View feature2imagepath.py
import re
import os
from tqdm import tqdm
class Feature2ImagePath:
def __init__(self):
self.my_file = None
self.backup_file = None
self.file_data = None
@tvdsluijs
tvdsluijs / exponential_growth.py
Created Jun 20, 2019
Small python script to show exponential growth
View exponential_growth.py
import locale
import math
import tableprint as tp
locale.setlocale(locale.LC_ALL, "")
class Expo_Growth:
def __init__(self, start=0, stop=10, words=True):
@tvdsluijs
tvdsluijs / slimmemeterportal.nl.py
Last active Apr 19, 2021
Small script to get your energy data from the slimmemeterportal.nl
View slimmemeterportal.nl.py
import requests
import calendar
import time
import datetime
from bs4 import BeautifulSoup
username = "" # fill in your slimmemeterportal username
password = "" # fill in your password
start_year = "" # fill in the year your started measurements