Skip to main content

Generates scores for how many layers of local imports/exports are in a file

Project description

codedepth

Generates and graphs how many levels of imports are needed for each file in a project
Supported Languages
  • Python 🟢
  • Lua 🟢
  • JavaScript 🟡 (Some styles of import statement may not be detected as a dependency)

Dependencies

You will need Graphviz v2.48.0 installed as an application - installation instructions can be found at https://graphviz.org/download/

Quickstart

From the command line (this will use default parameters and output a ranked directional graph as a PDF):

> python -m codedepth <path of the target directory>

The PDF will be generated in the working directory. If <path of the target directory> is omitted, the working directory will be used as the target.

In a python script:

from codedepth import Scorer

scorer = Scorer(r"<path of the target directory>")  # Replace this path string with your own

# Calculates scores for all files in the target directory
scorer.parse_all()

"""
Generates a PDF saved in the working directory,
containing a ranked directional graph of the file dependencies for the target directory.
Once this is generated, it will be opened automatically.
Also generates and saves a file containing the DOT code required to create the graph
"""
scorer.plot_ranked()

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

codedepth-2.0.0.tar.gz (11.7 kB view details)

Uploaded Source

File details

Details for the file codedepth-2.0.0.tar.gz.

File metadata

  • Download URL: codedepth-2.0.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for codedepth-2.0.0.tar.gz
Algorithm Hash digest
SHA256 7fa69b7a8d588a2f1c10cd35f5747dec5493e43efeb847582e3d98cfe76a4d22
MD5 c33e1ae68058c7837b13c30fe3454e58
BLAKE2b-256 629cd7dbbb0e392d94d7e9f4d28e44b44e630ac5a9ee43a9a9d490c610de9bc9

See more details on using hashes here.

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