Documentation Index
Fetch the complete documentation index at: https://mintlify.com/conda/conda/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
The conda Python API provides high-level programmatic access to conda’s core functionality. This API allows developers to integrate conda’s package management, solving, and environment management capabilities directly into Python applications. The API is designed to be more stable and user-friendly than using conda’s internal modules directly.When to Use the Python API vs CLI
Use the Python API when:- You need to integrate conda functionality into a Python application
- You want programmatic control over environment solving and package management
- You’re building tools or services that automate conda operations
- You need to query package metadata, caches, or repodata programmatically
- You’re performing interactive or one-off operations
- You’re writing shell scripts or batch files
- You need features not yet exposed in the Python API
- You want the most stable interface (the CLI is considered more stable than the API)
Installation and Imports
The Python API is included with conda. Simply import the classes you need:Available APIs
The conda Python API provides the following main classes:- Solver - High-level access to conda’s dependency solving logic
- SubdirData - Management and querying of repodata.json for subdirectories
- PackageCacheData - Management and querying of package caches
- PrefixData - Management and querying of conda environment prefixes