All Projects → bndr → Pycycle

bndr / Pycycle

Licence: mit
Tool for pinpointing circular imports in Python. Find cyclic imports in any project

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pycycle

Best Of Python
🏆 A ranked list of awesome Python open-source libraries and tools. Updated weekly.
Stars: ✭ 1,869 (+572.3%)
Mutual labels:  cli, utilities
Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+7321.58%)
Mutual labels:  cli, utilities
Haxor News
Browse Hacker News like a haxor: A Hacker News command line interface (CLI).
Stars: ✭ 3,342 (+1102.16%)
Mutual labels:  cli, utilities
Airshare
Cross-platform content sharing in a local network
Stars: ✭ 497 (+78.78%)
Mutual labels:  cli, utilities
Glom
☄️ Python's nested data operator (and CLI), for all your declarative restructuring needs. Got data? Glom it! ☄️
Stars: ✭ 1,341 (+382.37%)
Mutual labels:  cli, utilities
Saws
A supercharged AWS command line interface (CLI).
Stars: ✭ 4,886 (+1657.55%)
Mutual labels:  cli, utilities
Yaspin
A lightweight terminal spinner for Python with safe pipes and redirects 🎁
Stars: ✭ 413 (+48.56%)
Mutual labels:  cli, utilities
Fontfor
Find fonts which can show a specified character and preview them in terminal or browser.
Stars: ✭ 118 (-57.55%)
Mutual labels:  cli, utilities
Gitlab Cli
Create a merge request from command line in gitlab
Stars: ✭ 224 (-19.42%)
Mutual labels:  cli, utilities
Arduino Cli
Arduino command line tool
Stars: ✭ 3,173 (+1041.37%)
Mutual labels:  cli
Changes
changes automates python library release tasks.
Stars: ✭ 271 (-2.52%)
Mutual labels:  cli
Cliffy
NodeJS Framework for Interactive CLIs
Stars: ✭ 263 (-5.4%)
Mutual labels:  cli
Picocli
Picocli is a modern framework for building powerful, user-friendly, GraalVM-enabled command line apps with ease. It supports colors, autocompletion, subcommands, and more. In 1 source file so apps can include as source & avoid adding a dependency. Written in Java, usable from Groovy, Kotlin, Scala, etc.
Stars: ✭ 3,286 (+1082.01%)
Mutual labels:  cli
Starcli
✨ Browse GitHub trending projects from your command line
Stars: ✭ 269 (-3.24%)
Mutual labels:  cli
Pygogo
A Python logging library with superpowers
Stars: ✭ 265 (-4.68%)
Mutual labels:  cli
Tty Markdown
Convert a markdown document or text into a terminal friendly output.
Stars: ✭ 275 (-1.08%)
Mutual labels:  cli
Fastify Cli
Run a Fastify application with one command!
Stars: ✭ 260 (-6.47%)
Mutual labels:  cli
Github cli
GitHub on your command line. Use your terminal, not the browser.
Stars: ✭ 263 (-5.4%)
Mutual labels:  cli
Sagify
MLOps for AWS SageMaker. www.sagifyml.com
Stars: ✭ 277 (-0.36%)
Mutual labels:  cli
Pydoc Markdown
Create Python API documentation in Markdown format.
Stars: ✭ 273 (-1.8%)
Mutual labels:  cli

Pycycle: Find and fix circular imports in python projects

.. image:: https://img.shields.io/pypi/v/pycycle.svg :target: https://pypi.python.org/pypi/pycycle

.. image:: https://img.shields.io/pypi/l/pycycle.svg :target: https://pypi.python.org/pypi/pycycle

.. image:: https://img.shields.io/pypi/wheel/pycycle.svg :target: https://pypi.python.org/pypi/pycycle

.. image:: https://img.shields.io/pypi/pyversions/pipenv.svg :target: https://pypi.python.org/pypi/pycycle

.. image:: https://api.travis-ci.org/bndr/pycycle.svg?branch=master :target: https://travis-ci.org/bndr/pycycle


Pycycle is an experimental project that aims to help python developers fix their circular dependencies problems.

ImportError: Cannot import name X is a python exception that is related to the circular imports, but the exception tells nothing about where or what.

This tool automatically analyzes the imports of your projects, and looks for imports that may cause a circular dependency problem.

.. image:: https://i.imgur.com/8JeLQxu.gif

Features

  • Shows you the whole chain of the circular imports.
  • Gives you lines of code where each import is, for you to easily find and fix the problem.
  • Visualizes your imports in a graph (Not Yet Implemented)

Usage

::

$ pycycle
Usage: pycycle [OPTIONS] COMMAND [ARGS]...


Examples:
    Get the circular imports in current project:
    $ pycycle --here
    Look for circular imports in another project
    $ pycycle --source /home/user/workspace/awesome_project
    Ignore specific directories when looking for circular import
    $ pycycle --source /home/user/workspace/awesome_project --ignore some_dir,some_dir2
    Get verbose output
    $ pycycle --source /home/user/workspace/awesome_project --verbose

Options:
  --verbose        Verbose output.
  --here           Try to find cycles in the current project.
  --source TEXT    Try to find cycles in the path provided.
  --ignore TEXT    Comma separated directories that will be ignored during
                   analysis.
  --encoding TEXT  Change enconding with which the project is read.
  --help           Show this message then exit.
  --version        Show the version and exit.

::

$ pycycle --here
Project successfully transformed to AST, checking imports for cycles..
Cycle Found :(
a_module.a_file: Line 1 -> a_module.b_module.b_file: Line 1 -> c_module.c_file: Line 1 -> d_module.d_file: Line 1 =>> a_module.a_file
Finished.

::

$ pycycle --source /Users/vkravcenko/workspace/awesome_project
Target source provided:/Users/vkravcenko/workspace/awesome_project
Project successfully transformed to AST, checking imports for cycles..
No worries, no cycles here!
If you think some cycle was missed, please open an Issue on Github.
Finished.

Installation

::

$ pip install pycycle
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].