Command line

Usage

Once installed on your system you can use the tool directly:

dependency_comb

This entrypoint don’t perform any tasks, see its available commands.

Logging level

The entrypoint is where you can set the verbosity level from commands like this:

dependency_comb -v 0 [COMMAND]..

The value is an integer between 0 and 5 where 0 is to mute everything except critical errors and 5 is to output everything.

Note

Don’t try to set the verbosity level after the [COMMAND], the option won’t be recognized.

Help

There is a base tool help for global options:

dependency_comb -h

And if you use -h after a command name you will get its specific help:

dependency_comb analyze -h

Analyze

Analyze given requirements to build a JSON file with all computed informations from releases of every valid requirement.

Note

When no destination are given, the command will output JSON to the standard output and so all logging messages are muted to ensure valid JSON output.

Hint

This command is mostly useful to output an analyze to use in a further way with some other tools or scripts. To quickly get a report see Report command instead.

Usage:

Usage: dependency_comb analyze [OPTIONS] SOURCE

  Analyze package releases from a requirements file and output computed
  statistics as JSON.

  Arguments:

  SOURCE
      Pip requirements file to parse and analyze.
      Instead of a file path you can also give a requirements file content from
      standard input using '-'. For example using the Pip freeze output:

          pip freeze | dependency_comb analyze -

      Or to analyze an unique package:

          echo "django==3.2.1" | dependency_comb analyze -

Options:
  --cachedir DIRPATH  A directory where to look for API request cache. It is
                      looked for cache file per package and if any, avoid any
                      request for a package details. There is not any mechanic
                      to invalidate or update cache except than to remove
                      cache files. The given directory path will be created
                      automatically if it does not exists yet.
  --destination FILE  File path destination where to write serialized JSON
                      manifest. If not given the JSON will be sent to standard
                      output.
  --indent INTEGER    Indentation level for JSON output. Default to 4 spaces.
  --chunk INTEGER     Amount of requirements to process in a chunk. If zero,
                      it means every requirements are processed in a single
                      job without no pause.
  --pause INTEGER     The time in second to pause before each chunk. If zero
                      it means no pause. Prefer to disable chunk if you don't
                      want any pause.
  --timeout INTEGER   Timeout in seconds for API requests. Set it to 0 to
                      disable timeout.
  --env FILEPATH      A JSON file for some environment variables to give to
                      analyzer. This will be used to resolve specifier
                      markers. If analyzer does not receive any environment
                      variable all specifier markers are ignored (so its
                      requirement is always considered valid).
  -h, --help          Show this message and exit.

Format

Format a JSON analyze to a report with tables in RestructuredText format. Default behavior is to only report the correctly analyzed requirement and ignores everything else. There is an option to include also a table with requirement analyze failures (invalid syntax, unsupported syntax, etc..).

Hint

This command is mostly useful to format an archived analyze and so require usage of analyze before. To quickly get a report see Report command instead.

Usage:

Usage: dependency_comb format [OPTIONS] SOURCE

  Format an existing analyze.

  Analyze is expected to be a valid JSON as outputted from 'analyze' command.

  Arguments:

  SOURCE
      Computed analyze in a JSON file path. Instead of a file path you can also give
      a requirements file content from standard input using '-'. For example:

          dependency_comb analyze requirements.txt | dependency_comb report -

Options:
  --format STRING             Format name.  [default: rst]
  --destination FILE          File path destination where to write serialized
                              JSON manifest. If not given the JSON will be
                              sent to standard output.
  --failures / --no-failures  Include requirement analyze failures in a
                              different table, also each tablewill have its
                              own title.
  -h, --help                  Show this message and exit.

Report

This command merge behaviors of analyze and format to directly get a report from given requirements.

Usage:

Usage: dependency_comb report [OPTIONS] SOURCE

  Analyze and report informations about requirements.

  Opposed to the 'analyze' command, the logs are not muted when there is no
  destination file.

  Arguments:

  SOURCE
      Pip requirements file to parse, analyze and report.
      Instead of a file path you can also give a requirements file content from
      standard input using '-'. For example using the Pip freeze output:

          pip freeze | dependency_comb report -

      Or to make a report for an unique package:

          echo "django==3.2.1" | dependency_comb report -

Options:
  --cachedir DIRPATH          A directory where to look for API request cache.
                              It is looked for cache file per package and if
                              any, avoid any request for a package details.
                              There is not any mechanic to invalidate or
                              update cache except than to remove cache files.
                              The given directory path will be created
                              automatically if it does not exists yet.
  --format STRING             Format name.  [default: rst]
  --destination FILE          File path destination where to write serialized
                              JSON manifest. If not given the JSON will be
                              sent to standard output.
  --chunk INTEGER             Amount of requirements to process in a chunk. If
                              zero, it means every requirements are processed
                              in a single job without no pause.
  --pause INTEGER             The time in second to pause before each chunk.
                              If zero it means no pause. Prefer to disable
                              chunk if you don't want any pause.
  --timeout INTEGER           Timeout in seconds for API requests. Set it to 0
                              to disable timeout.
  --env FILEPATH              A JSON file for some environment variables to
                              give to analyzer. This will be used to resolve
                              specifier markers. If analyzer does not receive
                              any environment variable all specifier markers
                              are ignored (so its requirement is always
                              considered valid).
  --failures / --no-failures  Include requirement analyze failures in a
                              different table, also each tablewill have its
                              own title.
  -h, --help                  Show this message and exit.