Wetlands is a lightweight Python library for managing Conda environments.
Wetlands can create Conda environments on demand, install dependencies, and execute arbitrary code within them. This makes it easy to build plugin systems or integrate external modules into an application without dependency conflicts, as each environment remains isolated.
The name Wetlands comes from the tropical environments where anacondas thrive.
Documentation: https://arthursw.github.io/wetlands/latest/
Source Code: https://github.com/arthursw/wetlands/
✨ Features
- Automatic Environment Management: Create and configure environments on demand.
- Dependency Isolation: Install dependencies without conflicts.
- Embedded Execution: Run Python functions inside isolated environments.
- Pixi & Micromamba: Wetlands uses either a self-contained pixi or micromamba for fast and lightweight Conda environment handling.
📦 Installation
To install Wetlands, simply run:
🚀 Usage
Minimal example
Here is a minimal example usage:
With minimal_module.py:
General usage
Wetlands allows you to interact with isolated Conda environments in two main ways:
- Simplified Execution (env.importModule / env.execute): Wetlands manages the communication details, providing a proxy object to call functions within the environment seamlessly. See Getting started.
- Manual Control (env.executeCommands): You run specific commands (like starting a Python script that listens for connections) and manage the inter-process communication yourself. See Advanced example.
You can run those examples form the examples/ folder in the repository.
Explore the inner workings on the How it Works page.
📜 License
This project was made at Inria in Rennes (Centre Inria de l'Université de Rennes) and is licensed under the MIT License.
The logo Wetland was made by Dan Hetteix from Noun Project (CC BY 3.0).