conda_index.index

This module provides the main entry point to create indexes from collections of conda packages.

conda_index.index.update_index(dir_path, output_dir=None, check_md5=False, channel_name=None, patch_generator=None, threads: int | None = 4, verbose=False, progress=False, subdirs=None, warn=True, current_index_versions=None, debug=False, write_bz2=True, write_zst=False, write_run_exports=False)

High-level interface to ChannelIndex. Index all subdirs under dir_path. Output to output_dir, or under the input directory if output_dir is not given. Writes updated channeldata.json.

The input dir_path should at least contain a directory named noarch. The path tree therein is treated as a full channel, with a level of subdirs, each subdir having an update to repodata.json. The full channel will also have a channeldata.json file.

class conda_index.index.ChannelIndex(channel_root: ~pathlib.Path | str, channel_name: str | None, subdirs: ~typing.Iterable[str] | None = None, threads: int | None = 4, deep_integrity_check=False, debug=False, output_root=None, cache_class=<class 'conda_index.index.sqlitecache.CondaIndexCache'>, write_bz2=False, write_zst=False, write_run_exports=False, compact_json=True, *, channel_url: str | None = None, fs: ~conda_index.index.fs.MinimalFS | None = None, base_url: str | None = None)

Class implementing update_index. Allows for more fine-grained control of output.

See the implementation of conda_index.cli for usage.

Parameters:
  • channel_root – Path to channel, or just the channel cache if channel_url is provided.

  • channel_name – Name of channel; defaults to last path segment of channel_root.

  • subdirs – subdirs to index.

  • output_root – Path to write repodata.json etc; defaults to channel_root.

  • channel_url – fsspec URL where package files live. If provided, channel_root will only be used for cache and index output.

  • fsMinimalFS instance to be used with channel_url. Wrap fsspec AbstractFileSystem with conda_index.index.fs.FsspecFS(fs).

  • base_url – Add base_url/<subdir> to repodata.json to be able to host packages separate from repodata.json

index(patch_generator, verbose=False, progress=False, current_index_versions=None)

Examine all changed packages under self.channel_root, updating index.html for each subdir.

update_channeldata(rss=False)

Update channeldata based on re-reading output repodata.json and existing channeldata.json. Call after index() if channeldata is needed.