Skip to main content

A tool for refurbish and modernize Python codebases

Project description

Refurb

A tool for refurbish and modernize Python codebases.

Example

# main.py

with open("file.txt") as f:
    contents = f.read()

Running:

$ refurb main.py
tmp.py:3:1 [FURB101]: Use `y = Path(x).read_text()` instead of `with open(x, ...) as f: y = f.read()`

Installing

Before installing, it is recommended that you setup a virtual environment.

$ pip3 install refurb
$ refurb file.py

Why?

I love doing code reviews: I like taking something and making it better, faster, more elegant, and so on. Lots of static analysis tools already exist, but none of them seem to be focused on making code more elegant, more readable, more modern. That is what Refurb tries to do.

What Refurb IS NOT

Refurb is not a linter or a type checker. It is not meant as a first-line of defense for finding bugs, it is meant for making nice code look even better.

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

refurb-0.2.1.tar.gz (19.5 kB view hashes)

Uploaded Source

Built Distribution

refurb-0.2.1-py3-none-any.whl (23.1 kB view hashes)

Uploaded Python 3

Supported by

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