This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import re | |
from pathlib import Path | |
import pandas as pd | |
def glob_backlog_csvs(csv_dir): | |
csv_files = list(Path(csv_dir).glob('Backlog-Issues*.csv')) | |
if csv_files: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import calendar | |
from datetime import date | |
import numpy as np | |
def ordinal(n): | |
"""Converts an integer to its ordinal representation. | |
Reference: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from collections import namedtuple | |
from datetime import datetime | |
def get_week_dates(date_str): | |
"""Return the dates within the same week as the given date. | |
Args: | |
date_str (str): A date string in ISO format (e.g., '2021-01-01'). | |
Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from datetime import datetime | |
from pathlib import Path | |
import pandas as pd | |
from icalendar import Calendar | |
def extract_vevents(ics_file, from_yymmdd='1677-09-21', to_yymmdd='2262-04-11'): | |
"""Extract dates, locations, and summaries of events within a specified period |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
def isbinary(file): | |
"""Simple non/binary file classifier. | |
""" | |
with open(file, encoding='utf8') as f: | |
try: | |
f.read(256) | |
return False | |
except UnicodeDecodeError: | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# Begin Help block | |
my_name=$(basename "$0") | |
display_help() { | |
cat <<EOF | |
*** Run Sphinx "make clean" in a subshell. *** | |
usage: $my_name <No args are required> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import time | |
import pandas as pd | |
from openpyxl import load_workbook | |
from openpyxl.utils import coordinate_to_tuple | |
from openpyxl.workbook.views import BookView | |
def populate_template_excel( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Mimic do-while loop with an emergency brake feature. | |
""" | |
def dummy_func(): | |
for i in range(8): | |
yield i | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import csv | |
def is_sql_kwd(word_in): | |
"""Check if the word is an SQL keyword or reserved word. | |
Args: | |
word_in (str): | |
Returns: | |
bool: If word_in is a SQL keyword/reserved word (True) or not (False). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# Begin Help block | |
my_name=$(basename "$0") | |
display_help() { | |
cat <<EOF | |
*** Run Sphinx "make html" in a subshell. *** | |
usage: $my_name <No args are required> |