This file contains hidden or 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 | |
""" | |
Add a fiscal year column to a CSV file based on dates, | |
supporting both US and Japanese fiscal calendar systems. | |
""" | |
import argparse | |
from datetime import datetime | |
from pathlib import Path | |
import pandas as pd |
This file contains hidden or 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 | |
"""Display Unicode information for input string.""" | |
import sys | |
import unicodedata | |
from argparse import ArgumentParser | |
from dataclasses import dataclass | |
from typing import List, TextIO | |
@dataclass |
This file contains hidden or 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 bs4 import BeautifulSoup | |
# Constant for ruby-related annotation tags | |
RUBY_ANNOTATION_TAGS = ['rt', 'rp'] | |
def clean_ruby_annotations(soup: BeautifulSoup) -> BeautifulSoup: | |
""" | |
Cleans a BeautifulSoup object by removing ruby-related annotations. |
This file contains hidden or 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 subprocess | |
from argparse import ArgumentParser | |
from charset_normalizer import from_path | |
class ChardetJa: | |
"""Class for detecting the character encoding of files. |
This file contains hidden or 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 argparse import ArgumentParser | |
from pprint import pprint | |
from typing import List | |
COLOR_Y = "\033[93m" | |
COLOR_0 = "\033[0m" | |
def make_labeled_matrix(num_rows: int, num_cols: int, prefix: str = 'a') -> List[List[str]]: |
This file contains hidden or 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
# Sphinx: regex for converting list items into hyperlinks. | |
sed -E 's|^#\. (.*)$|#. `\1 <../../../../\1/docs/build/html/index.html>`_|g' |
This file contains hidden or 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 | |
# sed & awk for gzip-ed text files. | |
# The `zsmartcat` function reads the contents of a file, but it intelligently | |
# handles files that are either: | |
# 1. Gzip-compressed files (e.g., `.gz` files). | |
# 2. Regular text files (uncompressed files). | |
# The function decides whether to use `zcat` (to extract and display | |
# a gzip-compressed file) or the standard `cat` command (to display | |
# an uncompressed text file), based on the file type. |
This file contains hidden or 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 | |
""" | |
Quickstart script for Generic project. | |
This Python script, `pj_quickstart.py`, automates the creation of a generic | |
project directory structure. It also integrates Sphinx documentation and | |
performs additional configuration tasks. | |
""" | |
import argparse | |
import shutil | |
import subprocess |
This file contains hidden or 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 | |
class ConcatCSV: | |
""" | |
Handles concatenation of multiple CSV files in a specified directory into a single CSV file. |
NewerOlder