Skip to main content

A python script that traverses a whole package turning local absolute imports into relative ones.

Project description

abs2rel

A python script that traverses a whole package turning local absolute imports into relative ones.

Installation

pip install abs2rel

Usage

After installing, just go to your package top-level directory and execute the abs2rel command.

License

abs2rel is dedicated to the public domain with The Unlicense.

Efficiency

This command does not identify 100% of the possible local absolute imports. However, at its current state, it manages to identify all but a single import statement in a real package containing more than 200 python files (some with several local imports).

Future improvements should increase its efficiency even more. At its current state though, it can already reduce substantialy the time needed to convert local absolute imports from a Python package into local relative imports. Additionally, because the conversion happens programmatically, it is less error-prone than making the changes by hand.

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

abs2rel-1.0.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

abs2rel-1.0.0-py3-none-any.whl (3.7 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