Skip to main content

A blazing fast library to work with the conda ecosystem

Project description

banner

Rattler: Rust crates for fast handling of conda packages

License Build Status Project Chat Pixi Badge docs main python docs main

Rattler is a library that provides common functionality used within the conda ecosystem (what is conda & conda-forge?). The goal of the library is to enable programs and other libraries to easily interact with the conda ecosystem without being dependent on Python. Its primary use case is as a library that you can use to provide conda related workflows in your own tools.

Rattler is written in Rust and tries to provide a clean API to its functionalities (see: Components). With the primary goal in mind we aim to provide bindings to different languages to make it easy to integrate Rattler in non-rust projects.

Rattler is actively used by pixi, rattler-build, and the https://prefix.dev backend.

Showcase

This repository also contains a binary (use cargo run to try) that shows some of the capabilities of the library. This is an example of installing an environment containing cowpy and all its dependencies from scratch (including Python!):

Installing an environment

Python and Javascript bindings

You can invoke rattler from Python or Javascript via our powerful bindings to solve, install and run commands in conda environments. Rattler offers you the fastest and cleanest Python bindings to the conda ecosystem.

Python

To install the Python bindings, you can use pip or conda:

pip install py-rattler
# or
conda install -c conda-forge py-rattler

You can find the extensive documentation for the Python bindings here.

Example usage of rattler from Python The Python bindings to rattler are designed to be used with `asyncio`. You can access the raw power of the rattler library to solve environments, install packages, and run commands in the installed environments.
import asyncio
import tempfile

from rattler import solve, install, VirtualPackage

async def main() -> None:
    # Start by solving the environment.
    #
    # Solving is the process of going from specifications of package and their
    # version requirements to a list of concrete packages.
    print("started solving the environment")
    solved_records = await solve(
        # Channels to use for solving
        channels=["conda-forge"],
        # The specs to solve for
        specs=["python ~=3.12.0", "pip", "requests 2.31.0"],
        # Virtual packages define the specifications of the environment
        virtual_packages=VirtualPackage.detect(),
    )
    print("solved required dependencies")

    # Install the packages into a new environment (or updates it if it already
    # existed).
    env_path = tempfile.mkdtemp()
    await install(
        records=solved_records,
        target_prefix=env_path,
    )

    print(f"created environment: {env_path}")


if __name__ == "__main__":
    asyncio.run(main())

Javascript

To use the Javascript bindings, you can install the @conda-org/rattler package via npm. rattler is compiled to WebAssembly and can be used in the browser or in Node.js.

npm install @conda-org/rattler

Using rattler from Javascript is useful to get access to the same version comparison functions as used throughout the conda ecosystem. It is also used as part of mambajs which uses the rattler library to solve and install packages from the emscripten-forge channel in the browser.

Give it a try!

Before you begin, make sure you have the following prerequisites:

  • A recent version of git
  • A recent version of pixi

Follow these steps to clone, compile, and run the rattler project:

# Clone the rattler repository along with its submodules:
git clone --recursive https://github.com/conda/rattler.git
cd rattler

# Compile and execute rattler to create a JupyterLab instance:
pixi run rattler create jupyterlab

The above command will execute the rattler executable in release mode. It will download and install an environment into the .prefix folder that contains jupyterlab and all the dependencies required to run it (like python)

Run the following command to start jupyterlab:

# on windows
.\.prefix\Scripts\jupyter-lab.exe

# on linux or macOS
 ./.prefix/bin/jupyter-lab

Voila! You have a working installation of jupyterlab installed on your system! You can of course install any package you want this way. Try it!

Contributing 😍

We would love to have you contribute! See the CONTRIBUTION.md for more info. For questions, requests or a casual chat, we are very active on our discord server. You can join our discord server via this link.

Components

Rattler consists of several crates that provide different functionalities.

  • rattler_conda_types: foundational types for all datastructures used within the conda eco-system.
  • rattler_package_streaming: provides functionality to download, extract and create conda package archives.
  • rattler_repodata_gateway: downloads, reads and processes information about existing conda packages from an index.
  • rattler_shell: code to activate an existing environment and run programs in it.
  • rattler_solve: a backend agnostic library to solve the package satisfiability problem.
  • rattler_virtual_packages: a crate to detect system capabilities.
  • rattler_index: create local conda channels from local packages.
  • rattler: functionality to create complete environments from scratch using the crates above.
  • rattler-lock: a library to create and parse lockfiles for conda environments.
  • rattler-networking: common functionality for networking, like authentication, mirroring and more.
  • rattler-bin: an example of a package manager using all the crates above (see: showcase)

You can find these crates in the crates folder.

Additionally, we provide Python bindings for most of the functionalities provided by the above crates. A python package py-rattler is available on conda-forge and PyPI. Documentation for the python bindings can be found here.

What is conda & conda-forge?

The conda ecosystem provides cross-platform, binary packages that you can use with any programming language. conda is an open-source package management system and environment management system that can install and manage multiple versions of software packages and their dependencies. conda is written in Python. The aim of Rattler is to provide all functionality required to work with the conda ecosystem from Rust. Rattler is not a reimplementation of conda. conda is a package management tool. Rattler is a library to work with the conda ecosystem from different languages and applications. For example, it powers the backend of https://prefix.dev.

conda-forge is a community-driven effort to bring new and existing software into the conda ecosystem. It provides tens-of-thousands of up-to-date packages that are maintained by a community of contributors. For an overview of available packages see https://prefix.dev.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_rattler-0.23.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

py_rattler-0.23.0-cp38-abi3-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.8+Windows x86-64

py_rattler-0.23.0-cp38-abi3-win32.whl (13.4 MB view details)

Uploaded CPython 3.8+Windows x86

py_rattler-0.23.0-cp38-abi3-musllinux_1_2_x86_64.whl (20.6 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

py_rattler-0.23.0-cp38-abi3-musllinux_1_2_i686.whl (22.6 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ i686

py_rattler-0.23.0-cp38-abi3-musllinux_1_2_armv7l.whl (19.2 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARMv7l

py_rattler-0.23.0-cp38-abi3-musllinux_1_2_aarch64.whl (20.1 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

py_rattler-0.23.0-cp38-abi3-manylinux_2_28_armv7l.whl (19.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARMv7l

py_rattler-0.23.0-cp38-abi3-manylinux_2_28_aarch64.whl (19.9 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

py_rattler-0.23.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.9 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

py_rattler-0.23.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (26.8 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64le

py_rattler-0.23.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (27.8 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64

py_rattler-0.23.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (21.2 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

py_rattler-0.23.0-cp38-abi3-macosx_10_12_x86_64.whl (17.7 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

py_rattler-0.23.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (34.0 MB view details)

Uploaded CPython 3.8+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file py_rattler-0.23.0.tar.gz.

File metadata

  • Download URL: py_rattler-0.23.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for py_rattler-0.23.0.tar.gz
Algorithm Hash digest
SHA256 5f64fe587ba3ae19cd6bcd73ba00f9c45ec58e7e0783d93db5d35f10c6ed872d
MD5 f5144caebfe81483ee272da6d61f70b3
BLAKE2b-256 6f5f9292ac7c299273cc3f8ed54506d98d73b243e0d8a60619025cebecb822d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0.tar.gz:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: py_rattler-0.23.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ac071dec3f14f59520d027238caedc383c3d125929a42f17bcdfee6e286961a0
MD5 b7bbe0c120e146333190889bdc2bde10
BLAKE2b-256 5cdf59be53d016b4e00b31ff88f554da2c887afbe8cf48bc66c3bf3313eb93e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-win_amd64.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-win32.whl.

File metadata

  • Download URL: py_rattler-0.23.0-cp38-abi3-win32.whl
  • Upload date:
  • Size: 13.4 MB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 949e5f3ae80a920bfc35d73e2d325a5e21f8d8833080eb3b7c601a96083c4925
MD5 23534dbbff8403ad56bb5f730457fc79
BLAKE2b-256 248aba6fd95bb24316bfae170eb292daa08eca36ed1013fd5ab669c83fa1f304

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-win32.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 88d689c0ff7b8aeacdb6e80cac96251b0de068a7c6595bd3432f04127770bc0d
MD5 a683093f0343f3ab1a56419d460d265e
BLAKE2b-256 5f84333dd03e083853a330b6f12da0354e29d78151cfa9c9baf4df89c3717645

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-musllinux_1_2_x86_64.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 607a30233493522a0ed67a0830bd2982486cb3e01170c30bf219db0206be0447
MD5 3d0e5da9e9358d9940ed59d94faf0c15
BLAKE2b-256 836aa2b6e14acb09e6a62a422cda4c1ad61a9c0c9ef950540d0a0fee2002d3ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-musllinux_1_2_i686.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 8215eea92c550d33d0c1bdb634f2ffbb71ab3a55837da99e7a1cb5afe4c61337
MD5 2e1aa4980d832f4bf604c117908a2b3c
BLAKE2b-256 6ac06f4128666e123fed967f13e941caa15262bc7c1f74f55b12df0ac1e939d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-musllinux_1_2_armv7l.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1a9e7532ed0ba9c45cbedb36cd05c48b69f7fda6d496a00af2c39edf9a9a3321
MD5 df535daad85ec7dca9c5f95f65d375c2
BLAKE2b-256 97fb31fc7a3911141581443467f6aafd1b5d2e260860ee04e1dbac5ea09a12e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-musllinux_1_2_aarch64.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 1c21550e7f76613a55dc75d3060fdd6150d8ff1b712fafe38c43155bf8b242ea
MD5 41d71ea6a3713123775ee97f6489c690
BLAKE2b-256 3f6c41d71ec79b64af8f5c915e80b544f600dbdc1da9fa27dcbce513a1e66a29

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-manylinux_2_28_armv7l.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b743e2966fa1ae113d64f5e2edbee26fdfcf832cf08b8782556b7f371791430c
MD5 ea1ebf05f8c4fbf56f77a21ed9b7d560
BLAKE2b-256 f99af6a8f93482cdeea120137d3a7eb68f9802b511f3119e5a29a12232d057a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-manylinux_2_28_aarch64.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 250caa6e505f9133db3fc11265e6f4723e2e9bbdd0a8d0901886e7395199acea
MD5 1b45a9f84a61a5b815b31ca5f4bed985
BLAKE2b-256 6e665e77bbbdf680b9b6daaa9e3f130b9592a994a846dc90dc1751a788b4543d

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 6b79d34d03fddca75a0a6fbe0b20552fa01c78519475d2cbe7a30a1073ad33a6
MD5 761396f286df981915697452e341e002
BLAKE2b-256 7a1cb6c67d62d2176949b9fb487b981c34e6a03a06da401cb24a11e5bcfca3dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 41f325e8cae238f894a99dd70305214ad26b1e1ca015fb0cd7a49d183277a976
MD5 150d4d8701fa3578699feb5a2fe474bd
BLAKE2b-256 d9786b0f80d95a8cfe3a714c5ccd53035c70b1e9e975b6ff9684b3e35aeb0041

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 147b4cb344e07f97b249315f347b008d44591c349b3a1baee6d5ad9b378e81cc
MD5 ab8ed4eef16839ee5906c17c28d94ed4
BLAKE2b-256 917ad7b68089da798a7c2beb340e9dee46c815721b9447a6d0e49a9cfaf6d670

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1f28d3bf17812cc720dae86e3ce4820a964f07e35696814a1ccbdf7b357bc892
MD5 05d6c97c844c804158f6dfd9d73ac096
BLAKE2b-256 28908e0678edcadccda084d40548862279b808ceade344dec0652705f841afa0

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_rattler-0.23.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for py_rattler-0.23.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 79ec90048c41241b22fa6e836010863d76bd1e76bc2ce176f0e53ef77e36a749
MD5 1c33d53b750928a8dbabea35208346fe
BLAKE2b-256 c8bb8654f9db3213976847cecd6a9acc27fb683b063382a927a53d3a3235cbe1

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release-python.yml on conda/rattler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page