[](https://travis-ci.org/bamos/python-scripts)
[](https://gemnasium.com/bamos/python-scripts)
This is a collection of short Python scripts I use in Linux.
Portions of this README are automatically generated with
[generate-readme.py](https://github.com/bamos/python-scripts#generate-readmepy)
to insert the script-level comments as descriptions below.
# Adding to your PATH
I have these added to my `PATH`
[variable](https://wiki.archlinux.org/index.php/Environment_variables)
to run from anywhere.
Clone the repo and add the following
to your `bashrc` or `zshrc`, replacing ``
with the location of the cloned repository.
See my [dotfiles](https://github.com/bamos/dotfiles)
repo for my complete Mac and Linux system configurations.
```Bash
# Add additional directories to the path.
pathadd() {
[ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]] && PATH="${PATH:+"$PATH:"}$1"
}
pathadd /python2.7
pathadd /python3
```
# Dependencies
These scripts are written in Python 3 except when external
libraries don't support Python 3.
Dependencies for Python 2 and 3 for all scripts are
included in `requirements-{2,3}.txt` and can be installed
using `pip` with `pip3 install -r requirements-3.txt`.
# Travis CI
Continuous integration is provided by Travis CI
[here](https://travis-ci.org/bamos/python-scripts).
[.travis.yml](https://github.com/bamos/python-scripts/blob/master/.travis.yml)
calls
[.travis-script-2.sh](https://github.com/bamos/python-scripts/blob/master/.travis-script-2.sh)
and
[.travis-script-3.sh](https://github.com/bamos/python-scripts/blob/master/.travis-script-3.sh)
to ensure `requirements-{2,3}.txt` have all of the Python 2 and Python 3 scripts
and that there are no careless errors that cause the scripts to
not execute the help message.
[pep8](https://github.com/jcrocholl/pep8) will fail the build
if pep8 styling conventions aren't met.
# Scripts
The subheadings link to the script contents on GitHub.
## [generate-readme.py](https://github.com/bamos/python-scripts/blob/master/generate-readme.py)
+ Authors: [Brandon Amos](http://bamos.github.io)
+ Created: 2015.03.27
Generates the README for
[bamos/python-scripts](https://github.com/bamos/python-scripts)
so that the README and scripts contain synchronized documentation.
Script descriptions are obtained by parsing the docstrings
and inserted directly into the README as markdown.
## [python2.7/music-organizer.py](https://github.com/bamos/python-scripts/blob/master/python2.7/music-organizer.py)
+ Authors: [Brandon Amos](http://bamos.github.io)
+ Created: 2014.04.19
This script (music-organizer.py) organizes my music collection for
iTunes and [mpv](http://mpv.io) using tag information.
The directory structure is `/