From 38732e5d4e2ea9a9475a482fbb650cc3c28510a3 Mon Sep 17 00:00:00 2001 From: Olemis Lang Date: Fri, 7 Jan 2022 21:12:56 -0500 Subject: [PATCH 1/3] [brew] - Integrate brew python as pyenv version --- brew/brew_pyenv | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 brew/brew_pyenv diff --git a/brew/brew_pyenv b/brew/brew_pyenv new file mode 100755 index 0000000..a7c49c4 --- /dev/null +++ b/brew/brew_pyenv @@ -0,0 +1,29 @@ + +PYVER=$(brew list --versions python | cut -d ' ' -f2) +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 + From d8553f59e33dc2d4fde8ebdde3335ed119d61698 Mon Sep 17 00:00:00 2001 From: Olemis Lang Date: Sat, 8 Jan 2022 23:15:47 -0500 Subject: [PATCH 2/3] [office] - Script to convert PDF to DOCX --- office/convert_pdf_doc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 office/convert_pdf_doc 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) + From 0821451ccaa896fd7c92d4460c788dd3c58bf085 Mon Sep 17 00:00:00 2001 From: Olemis Lang Date: Mon, 10 Jan 2022 14:19:45 -0500 Subject: [PATCH 3/3] [brew] - brew Python version for pyenv symlink is cmd line arg --- brew/.python-version | 1 + brew/brew_pyenv | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 brew/.python-version 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 index a7c49c4..bfce7df 100755 --- a/brew/brew_pyenv +++ b/brew/brew_pyenv @@ -1,5 +1,6 @@ -PYVER=$(brew list --versions python | cut -d ' ' -f2) +#PYVER=$(brew list --versions python | cut -d ' ' -f2) +PYVER=$1 PYMIN=$(echo "$PYVER" | cut -d. -f1,2) PYPKG=$(echo "python@$PYMIN")