Python 3 conversion resources

Here’s a list of resources for Mac admins converting their scripts from Python 2 to Python 3.

Python 3 framework

https://www.python.org/downloads/mac-osx/ (generic/stock framework from python.org)

https://www.dropbox.com/s/2amjix194163li6/Python3.framework.zip?dl=0
(relocatable framework with pip, PyObjC, xattr, and six pre-installed)

python-modernize

https://python-modernize.readthedocs.io/en/latest/

pylint

https://pylint.readthedocs.io/en/latest/

Install python-modernize and pylint using pip:

pip install modernize
pip install pylint

-or-

Apple Installer pkg containing python-modernize and pylint:

https://www.dropbox.com/s/3e4gxs4fx4s05q9/py3portingtools-1.0.pkg?dl=0

six

https://six.readthedocs.io

six is installed as part of Apple’s Python 2.7 install; if you download the relocatable Python 3 framework from the link above, it also includes (a newer version of) six.

The Conservative Python 3 Porting Guide

https://portingguide.readthedocs.io/en/latest/index.html

Cheat Sheet: Writing Python 2-3 compatible code

https://python-future.org/compatible_idioms.html

One case-study

https://medium.com/@boxed/moving-a-large-and-old-codebase-to-python3-33a5a13f8c99

Python 3 conversion resources