Skip to main content

A CLI tool for extracting and outlining the structure of Python code.

Project description

PyCodeMap

Version: 1.0.1

Description

PyCodeMap is a command-line tool to extract and outline the structure of Python code. It helps developers visualize the organization of classes, methods, functions, and attributes in their projects, providing a clear and detailed overview.

Installation

You can install PyCodeMap directly from PyPI:

pip install pycodemap

Usage

After installation, you can run the tool using the pycodemap command.

You can also use python -m pycodemap to run the tool from the command line.

Note that if pip installs the package into directory that is not in the PATH, you will need to add the directory to the PATH or use python -m pycodemap.

To add the directory to the PATH, you can run the following command or add it to your .bashrc or .zshrc file:

export PATH="$PATH:/path/to/pycodemap/directory"

Basic Commands

  • Analyze the current directory:

    pycodemap .
    python -m pycodemap .
    
  • Save the output to a file:

    pycodemap . -o structure.txt
    pycodemap . --output structure.txt
    
  • Show only functions:

    pycodemap . -c
    pycodemap . --functions-only
    
  • Show only classes:

    pycodemap . -c
    pycodemap . --classes-only
    
  • Exclude attributes from the output:

    pycodemap . -a
    pycodemap . --no-attributes
    
  • Minimalistic output:

    pycodemap . -m
    pycodemap . --minimalistic
    
  • Exclude specific directories or files:

    pycodemap . -i "dir_to_ignore|file_to_ignore"
    pycodemap . --ignore "dir_to_ignore|file_to_ignore"
    

You can combine multiple options to get the desired output.

pycodemap . -cam -i "dir_to_ignore|file_to_ignore"
pycodemap . --classes-only --no-attributes --minimalistic --ignore "dir_to_ignore|file_to_ignore"

Вы правы, в раздел для контрибьюторов обычно включают инструкции по созданию форка репозитория, так как контрибьюторы не всегда имеют прямой доступ для записи в основной репозиторий. Вот исправленная версия с учётом процесса форка и создания pull request:

Contributing

How to contribute

Follow these steps to set up your development environment and submit your changes:

  1. Fork the repository:

  2. Clone your forked repository:

    git clone https://github.com/your_username/PyCodeMap.git
    cd PyCodeMap
    
  3. Install pycodemap in editable mode from source code:

    pip install -e .
    

    Now you can develop and test your changes locally by running pycodemap. All changes will be automatically reflected in your local installation.

  4. Create a new branch for your feature or bugfix:

    git checkout -b your-feature-branch
    
  5. Set up pre-commit to ensure code quality:

    pip install pre-commit
    pre-commit install
    

    Before committing your changes, pre-commit checks your code for formatting. If issues are found, the commit process halts, and pre-commit automatically resolves them. You'll need to stage these changes and try to commit again.

  6. Make your changes and write tests.

  7. Run all tests:

    pytest
    
  8. Commit your changes and push them to your forked repository:

    git push origin your-feature-branch
    
  9. Create a pull request:

    • Go to the original PyCodeMap repository.
    • Click "Pull Requests" and then "New Pull Request."
    • Select your branch from your forked repository and create the pull request.

Guidelines

  • Ensure your code is formatted with black.
  • Use isort for imports and autoflake to remove unused imports.
  • Check your code with pylint using configuration from .pylintrc.
  • Write tests for any new features or bug fixes.
  • Provide a clear description of the changes in your pull request.

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

pycodemap-1.0.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

pycodemap-1.0.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file pycodemap-1.0.1.tar.gz.

File metadata

  • Download URL: pycodemap-1.0.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for pycodemap-1.0.1.tar.gz
Algorithm Hash digest
SHA256 55e865c02a54043b0889c2d28098ac01eb5604d0169cd4195f645b5d6c4daf5a
MD5 bf389a6800e5dde691da112a5b6d4d45
BLAKE2b-256 8e5fc7f5a24240ed02c54b6d71e0b5edbdff7e0ae83a1c9f755b7bc6feaacf99

See more details on using hashes here.

File details

Details for the file pycodemap-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pycodemap-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for pycodemap-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f3fd275a94f9f331cc72408b594a4c1f7a7b44957e4d58cb307f4eed62401a6
MD5 26854d99fd1915c8912b219c2c8ade4c
BLAKE2b-256 513244406dc693abc74604635fe6b35139d3ac170d39c56187c1178ce629ebd3

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