Console script for pyproject2conda (cli) — pyproject2conda v0.8.0 documentation

Skip to main content
`Ctrl`+`K`

# Console script for pyproject2conda (cli)

# Console script for pyproject2conda (`cli`)

Classes:

`AliasedGroup`(*[, name, commands, ...]) | Provide aliasing for commands
`Overwrite`(value) | Options for --overwrite

Functions:

`version_callback`(value) | Versioning call back.
`main`([version]) | Extract conda environment.yaml and pip requirement.txt files from pyproject.toml
`add_verbose_logger`(logger[, verbose_arg]) | Decorator factory to add logger and set logger level based on verbosity argument value.
`create_list`([filename, verbose]) | List available extras.
`yaml`([filename, extras, channels, output, ...]) | Create yaml file from dependencies and optional-dependencies.
`requirements`([filename, extras, output, ...]) | Create requirements.txt for pip dependencies.
`project`([filename, envs, template, ...]) | Create multiple environment files from pyproject.toml specification.
`conda_requirements`([path_conda, path_pip, ...]) | Create requirement files for conda and pip.
`to_json`([extras, python_include, ...]) | Create json representation.

class pyproject2conda.cli.AliasedGroup(*, name=None, commands=None, rich_markup_mode=None, rich_help_panel=None, **attrs)

  Bases: `TyperGroup`

  Provide aliasing for commands

  Methods:

  `get_command`(ctx, cmd_name) | Given a context and a command name, this returns a `Command` object if it exists or returns None.
  `list_commands`(ctx) | Returns a list of subcommand names in the order they should appear.

  get_command(ctx, cmd_name)

    Given a context and a command name, this returns a `Command` object if it exists or returns None.

  list_commands(ctx)

    Returns a list of subcommand names in the order they should appear.

pyproject2conda.cli.version_callback(value)

  Versioning call back.

pyproject2conda.cli.main(version=<typer.models.OptionInfo object>)

  Extract conda environment.yaml and pip requirement.txt files from pyproject.toml

  Note that all subcommands can be called with shortest possible match. Also, you can call with any of pyproject2conda, p2c, python -m pyproject2conda. For example,

      # these are equivalent
      $ pyproject2conda yaml ...
      $ p2c y ...
      $ python -m pyproject2conda ...

class pyproject2conda.cli.Overwrite(value)

  Bases: `str`, `Enum`

  Options for –overwrite

pyproject2conda.cli.add_verbose_logger(logger, verbose_arg='verbose')

  Decorator factory to add logger and set logger level based on verbosity argument value.

pyproject2conda.cli.create_list(filename=PosixPath('pyproject.toml'), verbose=None)

  List available extras.

pyproject2conda.cli.yaml(filename=PosixPath('pyproject.toml'), extras=None, channels=None, output=None, name=None, python_include=None, python_version=None, python=None, base=True, sort=True, header=None, overwrite=Overwrite.check, verbose=None, deps=None, reqs=None, allow_empty=False)

  Create yaml file from dependencies and optional-dependencies.

pyproject2conda.cli.requirements(filename=PosixPath('pyproject.toml'), extras=None, output=None, base=True, sort=True, header=None, overwrite=Overwrite.check, verbose=None, reqs=None, allow_empty=False)

  Create requirements.txt for pip dependencies.

pyproject2conda.cli.project(filename=PosixPath('pyproject.toml'), envs=None, template=None, template_python=None, sort=True, header=None, overwrite=Overwrite.check, verbose=None, dry=False, user_config='infer', allow_empty=None)

  Create multiple environment files from pyproject.toml specification.

pyproject2conda.cli.conda_requirements(path_conda=None, path_pip=None, extras=None, python_include=None, python_version=None, python=None, channels=None, filename=PosixPath('pyproject.toml'), base=True, prefix=None, prepend_channel=False, sort=True, header=None, deps=None, reqs=None, verbose=None)

  Create requirement files for conda and pip.

  These can be install with, for example,

  conda install –file {path_conda} pip install -r {path_pip}

pyproject2conda.cli.to_json(extras=None, python_include=None, python_version=None, python=None, channels=None, filename=PosixPath('pyproject.toml'), sort=True, output=None, base=True, deps=None, reqs=None, verbose=None)

  Create json representation.

  Keys are: “dependencies”: conda dependencies. “pip”: pip dependencies. “channels”: conda channels.