a list of various scripts, examples, packages and docs that help me do stuff
time_display.py
- cli program to display datetimes for multiple regions and formats
--------- DETAILS ---------
VERSION: 0.1.0
--------- INSTALL ---------
> pip install rich pytz
--------- USAGE ---------
> python time_display.py
USA.PACIFIC: 2023-04-18 08:56 PM PDT-0700
USA.CENTRAL: 2023-04-18 10:56 PM CDT-0500
USA.EASTERN: 2023-04-18 11:56 PM EDT-0400
INDIA: 2023-04-19 09:26 AM IST+0530
yt_feed.py
- This script scrapes youtube for details about a list of channels
------------------ DETAILS ------------------
VERSION: 0.1.0
------------------ INSTALL ------------------
> pip install duckdb rich requests
------------------ USAGE ------------------
first create a config for what channels to scrape:
'''
# comments supported (channels.txt)
# <group icon \ text>, <group name>, <channel name>
📰, new, @60minutes
🤖, tech, @Microsoft
🤖, tech, @TwoMinutePapers
🚀, space, @SpaceX
'''
then configure the global user params:
SLEEP_SECONDS: how long the script waits before a new pull
N_POSTS: how many posts to display in the terminal output
CHANNELS: a config file for what channels to pull
NEW_DB: decide whether to create a new database on run
BACKUP_AFTER_N_SYNCS: (None) will not take a backup ever
(<int>) will take a backup every <int> number of syncs
BACKUP_PATH: (None) will create a new backup with the current datetime stamp
(<str>) will only backup to a specific path
RUN
> python yt_feed.py
clockify_pull.py
- Script to pull clockify time entries for the recent N days
# ----------------- DETAILS ----------------- #
VERSION = 0.1.5
# ----------------- CREATE CONFIG ----------------- #
config must be called "clockify.yaml"
'''
WORKSPACE_ID: "<YOUR WORKSPACE ID>"
API_KEY: "<CLOCKIFY API KEY>"
DAYS_TO_SYNC: <INT> # how many days back from yesterday to pull
DB_CONN: "<ODBC CONNECTION STRING>"
DEBUG: <BOOL> # if true will print extra detail
INTERACTIVE: <BOOL> # if true will wait for user input before quiting program
'''
# ----------------- INSTALLS ----------------- #
> pip install rich pyyaml pyodbc requests pyinstaller
# ----------------- BUILD A INSTALLER ----------------- #
> pyinstaller --onefile --icon .\static\clockify_pull_1.ico --name "clockify_pull_0.1.5.exe" .\scripts\clockify_pull.py
img_to_ico.py
- converts a image file to .ico
.ico
files are common for app\file\folder icons. this script will convert a png or jpg to ico
# ----------------- DETAILS ----------------- #
VERSION = 0.1.0
# ----------------- INSTALLS ----------------- #
> pip install rich Pillow typer
# ----------------- USAGE ----------------- #
# BASIC
> python img_to_ico.py <PATH>
# CUSTOM DIMENSIONS
> python img_to_ico.py <PATH> --px-dim 48
> python img_to_ico.py <PATH> --px-dim 256
# CUSTOM OUTFILE PATH
> python img_to_ico.py <PATH> --out <PATH>
duckdb_queries.sql
- a list of commands for duckdb (WIP)
script.py
- a generic python cli scripttyper_cli.py
- simple typer cli templatereadme.md
- template for repo readme
proc.py
- a class to handle subprocess across platforms