diff --git a/brew/.python-version b/brew/.python-version new file mode 100644 index 0000000..bd28b9c --- /dev/null +++ b/brew/.python-version @@ -0,0 +1 @@ +3.9 diff --git a/brew/brew_pyenv b/brew/brew_pyenv new file mode 100755 index 0000000..bfce7df --- /dev/null +++ b/brew/brew_pyenv @@ -0,0 +1,30 @@ + +#PYVER=$(brew list --versions python | cut -d ' ' -f2) +PYVER=$1 +PYMIN=$(echo "$PYVER" | cut -d. -f1,2) +PYPKG=$(echo "python@$PYMIN") + + +# Uninstall pyenv version +echo "Uninstalling $PYVER ..." +pyenv uninstall $PYVER +pyenv rehash + +# Create version symlink +cd ~/.pyenv/versions +ln -sfv "$(brew --prefix $PYPKG)" $PYMIN + +# Link include folder +cd "$(brew --prefix $PYPKG)" +ln -sfv Frameworks/Python.framework/Versions/$PYMIN/include/python$PYMIN include + +# Link executable commands +cd "$(brew --prefix $PYPKG)/bin" +ln -sfv idle3 idle +ln -sfv pip3 pip +ln -sfv python3 python +ln -sfv wheel3 wheel + +# Rehash +pyenv rehash + diff --git a/office/convert_pdf_doc b/office/convert_pdf_doc new file mode 100755 index 0000000..8c0e561 --- /dev/null +++ b/office/convert_pdf_doc @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from pdf2docx import parse +import argparse + +parser = argparse.ArgumentParser(description='Convert PDF file to DOCX format') +parser.add_argument('-if', dest='input', metavar='PATH', type=str, + help='Path to input PDF file') +parser.add_argument('-of', dest='output',metavar='PATH', type=str, + help='Path to output DOCX file') + +args = parser.parse_args() + +pdf_file = args.input +word_file = args.output +parse(pdf_file, word_file, start=0, end=None) +