Some tiny python utils so I can be lazier.
So maybe I stop writing the same things over and over.
# Python 3.9+ only (due to PEP 585 type annotations) pip install mbforbes-python-utils
from mbforbes_python_utils import read, write, flatten # read() removes leading/trailing whitespace. contents = read("foo.txt") # write() creates intermediate directories if needed. # Pass `info_print = False` to disable printing. write("bar/baz.txt", contents) # flatten() flattens lists. flatten([[1, [2, ]]]) # -> [1, 2, 3]
I don't do this enough to remember how to do it
# Increment version in setup.py. Then, pip install twine wheel python setup.py sdist bdist_wheel twine check dist/* # If the above failed, `rm -rf build/ dist/ *.egg-info` before retrying twine upload dist/*
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for mbforbes_python_utils-0.4.0.tar.gz
Hashes for mbforbes_python_utils-0.4.0-py3-none-any.whl