Weekend project: Working on some python tools.

When you make a new python package on the command line, you have to do 2 things. First create a directory, then add a file "init.py". Python will not recognize any directories that do not have an init.py file in them as a python package.

We did this enough times that it made sense to make a simple script that adds a new commandline tool "mkpkg". All it does it create a directory along with a new init.py file in it. Optionally, you can add a -m argument followed by a message you'd like to appear in the """docstring""" of the package. This is useful if you are using any documentation system like sphinx. It can also be helpful if you're using an IDE - as you are provided information about the package you're importing from the docstring.

to use it, make sure you have pip installed, and then:

pip install https://github.com/Technigami/pymkpkg/archive/master.zip

now you can type:

mkpkg testpackage -m "This is a new test package."

which will create a directory called "testpackage" with a docstring and timestamp in the init.py file.

Note that if it were really clever ( which it is not yet), you should be able to type in mkpkg a.b.c -m "test, and it should go:

mkdir -p a/b/c touch a/init.py && touch b/init.py && touch c/init.py

(more or less, in python, and adding the appropriate docstrings)

Anyhow, enjoy!