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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file refurb-0.2.1.tar.gz.

File metadata

  • Download URL: refurb-0.2.1.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.5 Linux/5.18.16-arch1-1

File hashes

Hashes for refurb-0.2.1.tar.gz
Algorithm Hash digest
SHA256 68dc2d005e3081b12e7c93e925667ac95b299ee837c5b62f6682fb3d3d395cf8
MD5 cc37b5df12fd9a14cb8e899522d3efe4
BLAKE2b-256 7fd223ff994e050902e1ef673338581440ac16264c822c9f47057784047a7911

See more details on using hashes here.

File details

Details for the file refurb-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: refurb-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.5 Linux/5.18.16-arch1-1

File hashes

Hashes for refurb-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b77b562e76748076efddac11457e595202accaa0d3f8706f4ef0066ae04d16f
MD5 472c9c090b2325710ac69c1a082d084e
BLAKE2b-256 4d7db43673e578e8e2b207fd734bce732200dfd00e853358ac3b6b298a619655

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