prospector

Inspects Python source files and provides information about type and location of classes, methods etc

https://github.com/prospector-dev/prospector

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 96 committers (1.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary

Keywords

hactoberfest linter linters-config statistical-analysis

Keywords from Contributors

closember templates data-profilers apps asyncio distributed datacleaner parallel pipeline-testing code-quality
Last synced: 6 months ago · JSON representation

Repository

Inspects Python source files and provides information about type and location of classes, methods etc

Basic Info
  • Host: GitHub
  • Owner: prospector-dev
  • License: gpl-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 1.95 MB
Statistics
  • Stars: 2,030
  • Watchers: 34
  • Forks: 175
  • Open Issues: 35
  • Releases: 72
Topics
hactoberfest linter linters-config statistical-analysis
Created over 12 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Security Support

README.rst

prospector
==========

.. image:: https://img.shields.io/pypi/v/prospector.svg
   :target: https://pypi.python.org/pypi/prospector
   :alt: Latest Version of Prospector
.. image:: https://github.com/PyCQA/prospector/actions/workflows/tests.yml/badge.svg
   :target: https://github.com/PyCQA/prospector/actions/workflows/tests.yml
   :alt: Build Status
.. image:: https://img.shields.io/coveralls/PyCQA/prospector.svg?style=flat
   :target: https://coveralls.io/r/PyCQA/prospector
   :alt: Test Coverage
.. image:: https://readthedocs.org/projects/prospector/badge/?version=latest
   :target: https://prospector.readthedocs.io/
   :alt: Documentation


About
-----

Prospector is a tool to analyse Python code and output information about
errors, potential problems, convention violations and complexity.

It brings together the functionality of other Python analysis tools such as
`Pylint `_,
`pycodestyle `_,
and `McCabe complexity `_.
See the `Supported Tools `_
documentation section for a complete list.

The primary aim of Prospector is to be useful 'out of the box'. A common complaint of other
Python analysis tools is that it takes a long time to filter through which errors are relevant
or interesting to your own coding style. Prospector provides some default profiles, which
hopefully will provide a good starting point and will be useful straight away, and adapts
the output depending on the libraries your project uses.

Installation
------------

Prospector can be installed from PyPI using ``pip`` by running the following command::

    pip install prospector

Optional dependencies for Prospector, such as ``pyroma`` can also be installed by running::

    pip install prospector[with_pyroma]

Some shells (such as ``Zsh``, the default shell of macOS Catalina) require brackets to be escaped::

    pip install prospector\[with_pyroma\]

For a list of all of the optional dependencies, see the optional extras section on the ReadTheDocs
page on `Supported Tools Extras `_.

For local development, `poetry `_ is used. Check out the code, then run::

    poetry install

And for extras::

    poetry install -E with_everything

For more detailed information on installing the tool, see the
`installation section `_ of the tool's main page
on ReadTheDocs.

Documentation
-------------

Full `documentation is available at ReadTheDocs `_.

Usage
-----

Simply run prospector from the root of your project::

    prospector

This will output a list of messages pointing out potential problems or errors, for example::

    prospector.tools.base (prospector/tools/base.py):
        L5:0 ToolBase: pylint - R0922
        Abstract class is only referenced 1 times

Options
```````

Run ``prospector --help`` for a full list of options and their effects.

Output Format
~~~~~~~~~~~~~

The default output format of ``prospector`` is designed to be human readable. For parsing
(for example, for reporting), you can use the ``--output-format json`` flag to get JSON-formatted
output.

Profiles
~~~~~~~~

Prospector is configurable using "profiles". These are composable YAML files with directives to
disable or enable tools or messages. For more information, read
`the documentation about profiles `_.

If your code uses frameworks and libraries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Often tools such as pylint find errors in code which is not an error, for example due to attributes of classes being
created at run time by a library or framework used by your project.
For example, by default, pylint will generate an error for Django models when accessing ``objects``, as the
``objects`` attribute is not part of the ``Model`` class definition.

Prospector mitigates this by providing an understanding of these frameworks to the underlying tools.

Prospector will try to intuit which libraries your project uses by
`detecting dependencies `_ and automatically turning on
support for the requisite libraries. You can see which adaptors were run in the metadata section of the report.

If Prospector does not correctly detect your project's dependencies, you can specify them manually from the commandline::

    prospector --uses django celery

Additionally, if Prospector is automatically detecting a library that you do not in fact use, you can turn
off autodetection completely::

    prospector --no-autodetect

Note that as far as possible, these adaptors have been written as plugins or augmentations for the underlying
tools so that they can be used without requiring Prospector. For example, the Django support is available as a pylint plugin.

Strictness
~~~~~~~~~~

Prospector has a configurable 'strictness' level which will determine how harshly it searches for errors::

    prospector --strictness high

Possible values are ``verylow``, ``low``, ``medium``, ``high``, ``veryhigh``.

Prospector does not include documentation warnings by default, but you can turn
this on using the ``--doc-warnings`` flag.

pre-commit
----------

If you'd like Prospector to be run automatically when making changes to files in your Git
repository, you can install `pre-commit `_ and add the following
text to your repositories' ``.pre-commit-config.yaml``:

.. code-block:: yaml

    repos:
    - repo: https://github.com/PyCQA/prospector
      rev: v1.16.1 # The version of Prospector to use, if not 'master' for latest
      hooks:
        - id: prospector

This only installs base prospector - if you also use optional tools, for example bandit and/or mypy, then you can add
them to the hook configuration like so:

.. code-block:: yaml

    repos:
    - repo: https://github.com/PyCQA/prospector
      rev: v1.16.1
      hooks:
        - id: prospector
          additional_dependencies:
            - ".[with_mypy,with_bandit]"
          args: [
            '--with-tool=mypy',
            '--with-tool=bandit',
            ]

Additional dependencies can be `individually configured `_ in your `prospector.yml` file :

.. code-block:: yaml

    # https://bandit.readthedocs.io/en/latest/config.html
    bandit:
    options:
        skips:
        - B201
        - B601
        - B610
        - B611
        - B703

    # https://mypy.readthedocs.io/en/stable/command_line.html
    mypy:
    options:
        ignore-missing-imports: true

For prospector options which affect display only - those which are not configurable using a profile - these can be
added as command line arguments to the hook. For example:

.. code-block:: yaml

    repos:
    - repo: https://github.com/PyCQA/prospector
      rev: v1.16.1
      hooks:
        - id: prospector
          additional_dependencies:
            - ".[with_mypy,with_bandit]"
          args:
            - --with-tool=mypy
            - --with-tool=bandit
            - --summary-only
            - --zero-exit



License
-------

Prospector is available under the GPLv2 License.

Owner

  • Name: prospector-dev
  • Login: prospector-dev
  • Kind: organization

GitHub Events

Total
  • Create event: 84
  • Release event: 17
  • Issues event: 40
  • Watch event: 88
  • Delete event: 52
  • Issue comment event: 132
  • Push event: 308
  • Pull request review comment event: 64
  • Pull request review event: 163
  • Pull request event: 152
  • Fork event: 10
Last Year
  • Create event: 84
  • Release event: 17
  • Issues event: 40
  • Watch event: 88
  • Delete event: 52
  • Issue comment event: 132
  • Push event: 308
  • Pull request review comment event: 64
  • Pull request review event: 163
  • Pull request event: 152
  • Fork event: 10

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 1,240
  • Total Committers: 96
  • Avg Commits per committer: 12.917
  • Development Distribution Score (DDS): 0.508
Past Year
  • Commits: 122
  • Committers: 11
  • Avg Commits per committer: 11.091
  • Development Distribution Score (DDS): 0.336
Top Committers
Name Email Commits
carlio g****t@c****m 610
Carlos Coelho c****s@v****r 166
Stéphane Brunner s****r@c****m 88
Pierre Sassoulas p****s@g****m 49
Carl Crowder c****l@z****m 38
pre-commit-ci[bot] 6****] 33
Jason Simeone j****y@c****t 31
dependabot[bot] 4****] 20
carlio m****l@c****m 18
Jeff Quast j****t@i****m 18
Christian Clauss c****s@m****m 18
Carl c****l@c****m 10
Benjamin Krajancic 1****c 6
Nasy n****x 5
SergeyKosarchuk s****k@g****m 4
Sam Spilsbury s****z@g****m 4
Anthony Ricaud a****y@r****e 4
David Pugh d****h@g****m 3
Alistair Lynn a****n@g****m 3
Kostiantyn Kubatkin k****n@k****t 3
Guy Kisel g****l@g****m 3
Rylan r****s@g****m 3
Sijis Aviles s****b@g****m 3
Daniel Roschka d****a@c****u 3
Michael Tinsley m****3@g****m 3
Takuya Noguchi t****h@g****m 2
Tim Gates t****s@i****m 2
Valeriu Predoi v****i@g****m 2
gopackgo90 c****n@l****m 2
stdweird s****t@u****e 2
and 66 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 119
  • Total pull requests: 171
  • Average time to close issues: about 1 year
  • Average time to close pull requests: 8 days
  • Total issue authors: 64
  • Total pull request authors: 21
  • Average comments per issue: 2.84
  • Average comments per pull request: 1.36
  • Merged pull requests: 141
  • Bot issues: 0
  • Bot pull requests: 32
Past Year
  • Issues: 22
  • Pull requests: 135
  • Average time to close issues: 8 days
  • Average time to close pull requests: 4 days
  • Issue authors: 10
  • Pull request authors: 10
  • Average comments per issue: 2.23
  • Average comments per pull request: 1.13
  • Merged pull requests: 110
  • Bot issues: 0
  • Bot pull requests: 32
Top Authors
Issue Authors
  • carlio (19)
  • sbrunner (10)
  • jquast (7)
  • techdragon (5)
  • ssokolow (4)
  • rpatterson (4)
  • karyon (3)
  • robertalexa (2)
  • thedrow (2)
  • pmav99 (2)
  • simminni (2)
  • pythonmobile (2)
  • julianpollmann (2)
  • valeriupredoi (2)
  • guykisel (2)
Pull Request Authors
  • sbrunner (104)
  • pre-commit-ci[bot] (24)
  • Pierre-Sassoulas (16)
  • jayclassless (13)
  • carlio (11)
  • dependabot[bot] (5)
  • jquast (4)
  • julianpollmann (4)
  • ZuluPro (2)
  • kostiantyn-priv (2)
  • joacortez (2)
  • guykisel (2)
  • trbs (1)
  • kirang89 (1)
  • cclauss (1)
Top Labels
Issue Labels
investigate (31) enhancement (13) bug (8) dependencies (2) question (1) duplicate (1)
Pull Request Labels
dependencies (5) python (4) bug (2) enhancement (1) github_actions (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 484,306 last-month
  • Total docker downloads: 761,020,905
  • Total dependent packages: 84
  • Total dependent repositories: 1,455
  • Total versions: 143
  • Total maintainers: 1
pypi.org: prospector

Prospector is a tool to analyse Python code by aggregating the result of other tools.

  • Versions: 143
  • Dependent Packages: 84
  • Dependent Repositories: 1,455
  • Downloads: 484,306 Last month
  • Docker Downloads: 761,020,905
Rankings
Docker downloads count: 0.1%
Dependent packages count: 0.3%
Dependent repos count: 0.3%
Downloads: 0.3%
Average: 1.1%
Stargazers count: 1.6%
Forks count: 3.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • sphinx >=3.1,<4
  • sphinx-argparse *
poetry.lock pypi
  • atomicwrites 1.4.0 develop
  • attrs 21.4.0 develop
  • backports.zoneinfo 0.2.1 develop
  • bleach 4.1.0 develop
  • cffi 1.15.0 develop
  • cfgv 3.3.1 develop
  • coverage 5.5 develop
  • coveralls 3.3.1 develop
  • cryptography 36.0.1 develop
  • distlib 0.3.4 develop
  • docopt 0.6.2 develop
  • filelock 3.4.1 develop
  • identify 2.4.4 develop
  • importlib-resources 5.2.3 develop
  • iniconfig 1.1.1 develop
  • jeepney 0.7.1 develop
  • keyring 23.4.1 develop
  • nodeenv 1.6.0 develop
  • packaging 21.3 develop
  • pkginfo 1.8.2 develop
  • pluggy 1.0.0 develop
  • pre-commit 2.17.0 develop
  • py 1.11.0 develop
  • py-cpuinfo 8.0.0 develop
  • pycparser 2.21 develop
  • pyparsing 3.0.7 develop
  • pytest 6.2.5 develop
  • pytest-benchmark 3.4.1 develop
  • pytest-cov 2.12.1 develop
  • pywin32-ctypes 0.2.0 develop
  • readme-renderer 32.0 develop
  • requests-toolbelt 0.9.1 develop
  • rfc3986 1.5.0 develop
  • secretstorage 3.3.1 develop
  • six 1.16.0 develop
  • tox 3.24.5 develop
  • tqdm 4.63.0 develop
  • twine 3.8.0 develop
  • types-pyyaml 6.0.4 develop
  • tzdata 2021.5 develop
  • tzlocal 3.0 develop
  • virtualenv 20.13.2 develop
  • webencodings 0.5.1 develop
  • astroid 2.9.3
  • bandit 1.7.1
  • certifi 2021.10.8
  • charset-normalizer 2.0.12
  • colorama 0.4.4
  • docutils 0.18.1
  • dodgy 0.2.1
  • flake8 4.0.1
  • flake8-polyfill 1.0.2
  • frosted 1.4.1
  • gitdb 4.0.9
  • gitpython 3.1.20
  • idna 3.3
  • importlib-metadata 4.2.0
  • isort 5.10.1
  • lazy-object-proxy 1.7.1
  • mccabe 0.6.1
  • mypy 0.931
  • mypy-extensions 0.4.3
  • pbr 5.8.1
  • pep8-naming 0.10.0
  • pies 2.6.7
  • platformdirs 2.4.0
  • pycodestyle 2.8.0
  • pydocstyle 6.1.1
  • pyflakes 2.4.0
  • pygments 2.11.2
  • pylint 2.12.2
  • pylint-celery 0.3
  • pylint-django 2.5.2
  • pylint-flask 0.6
  • pylint-plugin-utils 0.7
  • pyroma 3.2
  • pyyaml 6.0
  • requests 2.27.1
  • requirements-detector 0.7
  • setoptconf-tmp 0.3.1
  • smmap 5.0.0
  • snowballstemmer 2.2.0
  • stevedore 3.5.0
  • toml 0.10.2
  • tomli 1.2.3
  • typed-ast 1.5.2
  • typing-extensions 4.1.1
  • urllib3 1.26.8
  • vulture 2.3
  • wrapt 1.13.3
  • zipp 3.6.0
pyproject.toml pypi
  • coverage ^5.5 develop
  • coveralls ^3.2.0 develop
  • pre-commit ^2.14.0 develop
  • pytest ^6.2.4 develop
  • pytest-benchmark ^3.4.1 develop
  • pytest-cov ^2.12.1 develop
  • tox ^3.24.5 develop
  • twine ^3.8.0 develop
  • types-PyYAML ^6.0.4 develop
  • tzlocal ^3.0 develop
  • PyYAML *
  • bandit >=1.5.1
  • dodgy ^0.2.1
  • frosted >=1.4.1
  • mccabe ^0.6.0
  • mypy >=0.600
  • pep8-naming >=0.3.3,<=0.10.0
  • pycodestyle >=2.6.0,<2.9.0
  • pydocstyle >=2.0.0
  • pyflakes >=2.2.0,<3.*
  • pylint >=2.8.3
  • pylint-celery 0.3
  • pylint-django ~2.5
  • pylint-flask 0.6
  • pylint-plugin-utils ~0.7
  • pyroma >=2.4
  • python >=3.6.2,<4.0
  • requirements-detector ^0.7
  • setoptconf-tmp ^0.3.1
  • toml ^0.10.2
  • vulture >=1.5
.github/workflows/codeql-analysis.yml actions
  • actions/checkout v2 composite
  • github/codeql-action/analyze v1 composite
  • github/codeql-action/autobuild v1 composite
  • github/codeql-action/init v1 composite
.github/workflows/release.yml actions
  • actions/checkout v2.3.4 composite
  • actions/setup-python v2.2.2 composite
.github/workflows/tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite