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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68dc2d005e3081b12e7c93e925667ac95b299ee837c5b62f6682fb3d3d395cf8
|
|
| MD5 |
cc37b5df12fd9a14cb8e899522d3efe4
|
|
| BLAKE2b-256 |
7fd223ff994e050902e1ef673338581440ac16264c822c9f47057784047a7911
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b77b562e76748076efddac11457e595202accaa0d3f8706f4ef0066ae04d16f
|
|
| MD5 |
472c9c090b2325710ac69c1a082d084e
|
|
| BLAKE2b-256 |
4d7db43673e578e8e2b207fd734bce732200dfd00e853358ac3b6b298a619655
|