Skip to main content

Find divisions in Python code

Project description

shldn

Sheldon Cooper ALWAYS points out what (he thinks) is wrong with people and their work

What is it?

shldn is a console-application that finds all the division operations in Python source code to facilitate transitioning Python 2 code to Python 3. It uses Python's AST module to process and parse the code. It, then traverses the abstract syntax tree to find all the division operations, and prints them in a normal or more readable format to the console.

Motivation

  • Python 2 won't be supported past 2020

    tic tac tic tac...

  • Division in Python 3 always returns a float; whereas division in Python 2 can return an int

  • Critical for large Python 2 code bases that perform division operations

Requirements

  • Python 3

Install

Method 1: Install from Pypi Method

pip3 install shldn

Or, if you use pipenv,

pipenv install shldn

Method 2: Clone repository

Move to the desired directory to install shldn

git clone https://github.com/NablaZeroLabs/shldn.git

Usage

Method 1 (Installed from Pypi):

In environment installed:

  1. Check if installed
pip list
  1. Execute
shldn [-h] [-hr] [-r] path

Method 2 (Cloned repo):

  1. Execute
python3 leonard.py [-h] [-hr] [-r] path

Arguments

positional arguments:
  path                  path to python source file(s)

optional arguments:
  -h, --help            show this help message and exit
  -hr, --human_readable
                        set for friendlier output
  -r, --recursive       recursively check python files in path

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

More Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shldn-1.2.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shldn-1.2.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file shldn-1.2.1.tar.gz.

File metadata

  • Download URL: shldn-1.2.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for shldn-1.2.1.tar.gz
Algorithm Hash digest
SHA256 11b366a6d894d3aee853c41077570982831ce11540d977f136c5e60a3dc5c71a
MD5 b5fa354e4109d8adc6d7d885f739e19b
BLAKE2b-256 9c18e60e1055af3ae7a5bb42ee98a2356e8d403d8e7a31054492e8841604cb72

See more details on using hashes here.

File details

Details for the file shldn-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for shldn-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d72d78980536575d7bb12bbe2acbd38ab2fafd1ea4ba923de23aafbf6f8c433a
MD5 9c89fdb9a2833bdfe54db65923734376
BLAKE2b-256 310e76f4485cfde6f09f13257ac7d71278762ab16aeee8551de3ebaacd1142b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page