:py:mod:`channel` ================= .. py:module:: conda.models.channel .. autoapi-nested-parse:: Defines Channel and MultiChannel objects and other channel-related functions. Object inheritance: .. autoapi-inheritance-diagram:: Channel MultiChannel :top-classes: conda.models.channel.Channel :parts: 1 Classes ------- .. autoapisummary:: conda.models.channel.ChannelType conda.models.channel.Channel conda.models.channel.MultiChannel Functions --------- .. autoapisummary:: conda.models.channel.tokenized_startswith conda.models.channel.tokenized_conda_url_startswith conda.models.channel._get_channel_for_name conda.models.channel._read_channel_configuration conda.models.channel.parse_conda_channel_url conda.models.channel.get_conda_build_local_url conda.models.channel.prioritize_channels conda.models.channel.all_channel_urls conda.models.channel.offline_keep conda.models.channel.get_channel_objs .. py:class:: ChannelType Bases: :py:obj:`type` This metaclass does basic caching and enables static constructor method usage with a single arg. .. py:method:: __call__(*args, **kwargs) Call self as a function. .. py:class:: Channel(scheme: str | None = None, auth: str | None = None, location: str | None = None, token: str | None = None, name: str | None = None, platform: str | None = None, package_filename: str | None = None) Channel: scheme <> auth <> location <> token <> channel <> subchannel <> platform <> package_filename Package Spec: channel <> subchannel <> namespace <> package_name .. py:property:: channel_location :type: str | None .. py:property:: channel_name :type: str .. py:property:: subdir :type: str | None .. py:property:: canonical_name :type: str .. py:property:: base_url :type: str | None .. py:property:: base_urls :type: tuple[str | None] .. py:property:: subdir_url :type: str .. py:property:: url_channel_wtf :type: tuple[str | None, str] .. py:attribute:: _cache_ .. py:method:: _reset_state() -> None :staticmethod: .. py:method:: from_url(url: str) -> Channel :staticmethod: .. py:method:: from_channel_name(channel_name: str) -> Channel :staticmethod: .. py:method:: from_value(value: str | None) -> Channel :staticmethod: Construct a new :class:`Channel` from a single value. :param value: Anyone of the following forms: `None`, or one of the special strings "", "None:///", or "None": represents the unknown channel, used for packages with unknown origin. A URL including a scheme like ``file://`` or ``https://``: represents a channel URL. A local directory path: represents a local channel; relative paths must start with ``./``. A package file (i.e. the path to a file ending in ``.conda`` or ``.tar.bz2``): represents a channel for a single package A known channel name: represents a known channel, e.g. from the users ``.condarc`` file or the global configuration. :returns: A channel object. .. py:method:: make_simple_channel(channel_alias: Channel, channel_url: str, name: str | None = None) -> Channel :staticmethod: .. py:method:: urls(with_credentials: bool = False, subdirs: collections.abc.Iterable[str] | None = None) -> list[str] .. py:method:: url(with_credentials: bool = False) -> str | None .. py:method:: __str__() -> str Return str(self). .. py:method:: __repr__() -> str Return repr(self). .. py:method:: __eq__(other: Any) -> bool Return self==value. .. py:method:: __hash__() -> int Return hash(self). .. py:method:: __nonzero__() -> bool .. py:method:: __bool__() -> bool .. py:method:: __json__() -> dict[str, Any] .. py:method:: dump() -> dict[str, str | None] .. py:class:: MultiChannel(name: str, channels: collections.abc.Iterable[Channel], platform: str | None = None) Bases: :py:obj:`Channel` Channel: scheme <> auth <> location <> token <> channel <> subchannel <> platform <> package_filename Package Spec: channel <> subchannel <> namespace <> package_name .. py:property:: channel_location :type: None .. py:property:: canonical_name :type: str .. py:property:: base_url :type: None .. py:property:: base_urls :type: tuple[str | None, Ellipsis] .. py:method:: urls(with_credentials: bool = False, subdirs: collections.abc.Iterable[str] | None = None) -> list[str] .. py:method:: url(with_credentials: bool = False) -> None .. py:method:: dump() -> dict[str, str | tuple[dict[str, Any], Ellipsis]] .. py:function:: tokenized_startswith(test_iterable: collections.abc.Iterable[Any], startswith_iterable: collections.abc.Iterable[Any]) -> bool .. py:function:: tokenized_conda_url_startswith(test_url: collections.abc.Iterable[str], startswith_url: collections.abc.Iterable[str]) -> bool .. py:function:: _get_channel_for_name(channel_name: str) -> Channel .. py:function:: _read_channel_configuration(scheme: str | None, host: str | None, port: str | None, path: str | None) -> tuple[str | None, str | None, str | None, str | None, str | None] .. py:function:: parse_conda_channel_url(url: str) -> Channel .. py:function:: get_conda_build_local_url() -> tuple[conda.common.path.PathType] .. py:function:: prioritize_channels(channels: collections.abc.Iterable[Channel | str], with_credentials: bool = True, subdirs: collections.abc.Iterable[str] | None = None) -> dict[str, tuple[str, int]] .. py:function:: all_channel_urls(channels: collections.abc.Iterable[str | Channel], subdirs: collections.abc.Iterable[str] | None = None, with_credentials: bool = True) -> boltons.setutils.IndexedSet .. py:function:: offline_keep(url: Any) -> bool .. py:function:: get_channel_objs(ctx: conda.base.context.Context) -> tuple[Channel, Ellipsis] Return current channels as Channel objects