My personal Python "Recipe Book".
I have a summary and description for some scripts and I'm planning to do some kind of search based on these two, for now it's just a bunch of scripts in a repository.
Turn a list of values into a column for Sheets API
Testing the speed of pathlib and os doing path operations
Simple test of concatinating and creating a directory
pathlib Path object operations
Showing the same operations that can be done with os module, instead using pathlib module
A quick script using ipaddress module to ping all hosts in a network
Uses multiprocessing to ping address more quickly by proving multiple networks. Change WORKER_COUNT for speed.
Sort a list of filenames, with using one or 3 keys
Testing the difference between shallow and deep copy
Global variables
Testing how global variables work within different scopes.
Parsing given paths into pieces and choosing the correct client
PoC Script runner Script with virtualenvironment setup
Overcomplicated script with setting up the dummy data processing script and deleting it using a context manager. PoC part is on the command_list and Popen line.
Return the path object based on the currently used system
Merge a dictionary in a different function to update the dictionary
Filter a list of dates based on the date range
Handling process interrupt/termination signals
Testing how to handle evens when the system or process is suddenly asked to shut down, useful for data processing when the task is half finished and state needs to be stored/restored.
Remove all comments and docstrings from a Python file
Thanks to StackOverflow user SurpriseDog, https://stackoverflow.com/a/56285204 for the strip function
Recurse into a dictionary to safely get a value.
From a given dictionary (or JSON), return a nested value using the varargs in the function parameters, otherwise return the default value.
Testing Python zip and unzip functionality
Print documentation for all python modules in the current folder
Simple script to get all docs from all modules
Generate a list of dates between a certain range
Learning about sanitizing paths and bypassing it
Small experiment to test out bypassing path sanitization methods, includes a few validator functions for a single given path
Read a YAML file which includes anchors
Simple Python implementation of a linked list
Learned from https://realpython.com/linked-lists-python/ check them out
Get all IP addresses from a string using regex.
Duplicate an existing spreadsheet to a folder with sharing
Script creates a new spreadsheet based on a template and copies to to the specified folder (using it's Google Drive folder ID) and gives write permissions to a given domain.
Script for grabbing all module docstrings and creating a readme section
I wanted to utilize the docstrings in my Python Recipe GitHub repo, thus this script.
Task scheduler to send a request to a Flask endpoint
Using APScheduler schedule a task/function to execute on a specific interval, in this case, a function that sends POST requests to a local flask endpoint.
Testing the lambda function in filter and sorting
Print a function signature for give callable
Getting a client based on a match pattern and protocol
Getting only the exception from a traceback
Choosing authentication methods based on a pattern
Simple screen recorder script for a Linux based OS
The command strings for Popen can be easily adjusted for Mac OS and Windows. This script can be used in a CI or anywhere else, I had an edge case where I couldn't use library for doing automated UI tests and needed a foolproof way to see what's going on.
Cheatsheet for f-strings (Just because I keep forgetting how to use them)
Ways to use the f-string to perform more than interpolating variables, which includes substitution, raw printing, padding and formatting decimals.