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

command: CommandAPI

Used to call other commands

list: ListAPI

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

profiles: ProfilesAPI

Used to process and load Conan profiles

install: InstallAPI

Used to install binaries, sources, deploy packages and more

export: ExportAPI

Used to export recipes and pre-compiled package binaries to the Conan cache

upload: UploadAPI

Used to upload recipes and packages to remotes

download: DownloadAPI

Used to download recipes and packages from remotes

cache: CacheAPI

Used to interact wit the packages storage cache

lockfile: LockfileAPI

Used to read and manage lockfile files

local: LocalAPI

Local flow helpers for developer β€œsource”, β€œbuild”, β€œeditable” commands

audit: AuditAPI

Used to check vulnerabilities of dependencies

workspace: WorkspaceAPI

Used to manage workspaces

property home_folder: str

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.