Conan API Reference

Warning

This feature is experimental and subject to breaking changes. See the Conan stability section for more information.

class ConanAPI(cache_folder=None)

This is the main object to interact with the Conan API. It provides all the subapis to work with recipes, packages, remotes, etc., which are exposed as attributes of this class, and should not be created directly.

Parameters:

cache_folder – Conan cache/home folder. It will have less priority than the "home_folder" defined in a Workspace.

config: ConfigAPI

Used to interact with the local Conan configuration

remotes: RemotesAPI

Used to interact with remotes

list: ListAPI

Used to get latest refs and list refs of recipes and packages

upload: UploadAPI

Used to upload recipes and packages to remotes

download: DownloadAPI

Used to download recipes and packages from remotes

property home_folder

Where the Conan user home is located. Read only. Can be modified by the CONAN_HOME environment variable or by the .conanrc file in the current directory or any parent directory when Conan is called.

reinit()

Reinitialize the Conan API. This is useful when the configuration changes.