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 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

Development: getting started

To get started developing with Rattler, let's install an environment with cowpy and its dependencies.

Clone the Rattler repository, and in your terminal, navigate to the root folder of the repository, and execute the following commands (in order):

git submodule update --init
cargo run --bin rattler --release create cowpy
cargo run --bin rattler --release run -p .prefix/ cowpy --random

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. See the rattler_index README for channel options documentation.
  • 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.24.0.tar.gz (1.4 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.24.0-cp38-abi3-win_amd64.whl (16.6 MB view details)

Uploaded CPython 3.8+Windows x86-64

py_rattler-0.24.0-cp38-abi3-win32.whl (14.7 MB view details)

Uploaded CPython 3.8+Windows x86

py_rattler-0.24.0-cp38-abi3-musllinux_1_2_x86_64.whl (20.8 MB view details)

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

py_rattler-0.24.0-cp38-abi3-musllinux_1_2_i686.whl (23.1 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ i686

py_rattler-0.24.0-cp38-abi3-musllinux_1_2_armv7l.whl (19.6 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARMv7l

py_rattler-0.24.0-cp38-abi3-musllinux_1_2_aarch64.whl (20.5 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

py_rattler-0.24.0-cp38-abi3-manylinux_2_28_armv7l.whl (19.4 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARMv7l

py_rattler-0.24.0-cp38-abi3-manylinux_2_28_aarch64.whl (20.2 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

py_rattler-0.24.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.2 MB view details)

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

py_rattler-0.24.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (27.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64le

py_rattler-0.24.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (28.2 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64

py_rattler-0.24.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (21.7 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

py_rattler-0.24.0-cp38-abi3-macosx_10_12_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

py_rattler-0.24.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (36.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.24.0.tar.gz.

File metadata

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

File hashes

Hashes for py_rattler-0.24.0.tar.gz
Algorithm Hash digest
SHA256 f2d18d457377dd3b3fa7a3c1508957e0933d9e007d54d1701d99977d088eb752
MD5 fcf238b8dff654a6e45f8a0a19c83df7
BLAKE2b-256 3deb8adfd9507446891210d54f2ddc7337411a191d461d0ed2dc194c852d9bc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-win_amd64.whl.

File metadata

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

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f5e51733e5ac149a039356ca8d87d0a622ee5bf6777795e8e242de6595d83bf9
MD5 0ef0b07fd110a3538ed7d30bc2164005
BLAKE2b-256 3771de620d806a27c5256a245a676a792a0af7c424fc0fac4929bbdfc9382358

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-win32.whl.

File metadata

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

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 cc72ab8a6495bb8eddda281bb66952d7f35bf486c3e0d50aab8f65c96c12b7e7
MD5 17906e8ab42d12938ea468c97baeda8e
BLAKE2b-256 e092cc3396bb75adbd9745abea2140ac3327ce6c455121cbb67c72a8e612860e

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 736e579ae6088d92f3e9a587aea1b4d3e4eb2f14319b80d56f65b69eabd3e5a4
MD5 4f38fedee1d5dba849cc001c39f7fe37
BLAKE2b-256 678a0b35cd0956fb3ec5b0b0aff52abfd3143a843197b74ddd102a38a1b2749b

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 c18b38e6c640a69ca2ac0a3c8c0f3a87bc12cd7f00579f4164816aaa64d7f344
MD5 9f98551490291e3e11fa01ffa37f3044
BLAKE2b-256 07fd599f91791cd7418b329b0c141c8313174f7d81b0ac394f3a9615eeff47b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 bfbbfb62b0650964805d545b6fbd987e4407d0cdd6b09b5678ef98de6c1c4ccb
MD5 3202ad19b57837a01cb085b3f7695fe1
BLAKE2b-256 16f8c4634b8817cf0e13be7bc4b6c3bef16f4510d56636b3b3227e8d048a03d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 654f0e07dd4a5382ae0e39bf33a88ba2a7db0b2f73575c44c09c1689a36b0518
MD5 1a9e26ac9feed9b4783dbe897b52f4bd
BLAKE2b-256 05abeb96a35816983e5343fda73af51647253aacb960cb9517302ac8ece98580

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 33d944d0e49b1a856becdd20a1ee4fa6e12b0efa02da856d7fa20d4a62a065b5
MD5 eafb72e0e042215c872b54da3448e06b
BLAKE2b-256 fa7047d08b6f73874eb1b899a1a32cfa52d9bbb7c2f6dc9785cffd86f925dbbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a42725a9d84eab93617893d9cd111479dbe0d481b612ffa787a91e8b052991be
MD5 32eaad6bbe61816568ee858c4908d575
BLAKE2b-256 46a9cfa3f43930da59b04f29947d18708c8f20245613510ba273ffcb1b9f4100

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c7400407c53a2d688d902cc663d86ed180e359a84f7abbe1a5e48ebca957d4b9
MD5 853ce34d55941c239d1e692c1932fb42
BLAKE2b-256 6c8280cb5c336aa8560bbe5db71b623c26a05759c905712e19b5165641356e42

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 088d1e9b89c1632f8b5f2a0fff73d0bafe78027af5c29fa3ab5b752bbec71654
MD5 d22807df6540c3f4c467f9cdf76e9ff0
BLAKE2b-256 199c46ff518c8f56574f0d7f70f7940250c80761b38673fca263c530c7837335

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 ddd2b701c6ce33dd6deda7789c2a370f03f00d074212e124cafb33fef075745d
MD5 48149952c3d2802c4ac682bd04f57cd4
BLAKE2b-256 4b0801dfb1c732b96fa697d72bb59d12bd01bf90588ebf155024fa4d3378d3b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6da50fa7a8809b7e37135179904f7256b9dece0530c424c709ae520d575f45e4
MD5 cf3b9a4087b8839df35f4604d786877f
BLAKE2b-256 86617194469d7d97aa835b324ae31b714b11439e30acc0b0949bd789fde00302

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for py_rattler-0.24.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 35308092d0d94dbd57b7d8fe649839ec3895b4cbe1cb010e23afebc8999b4649
MD5 b4b2d77463d37419f974622e84d25468
BLAKE2b-256 4ce30fa56c3918f6d158e54e66bee778a857b30fde878ebdf81bef97f30867b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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.24.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.24.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 2e894cd507330db69d834f00ba9f8c940c97bd40bf4c1eb133127e4fa7da715c
MD5 27cb254af49552d0310d95768ea9afcf
BLAKE2b-256 c4a28bdc9a9e196bf5110acfd6852499f9ad7580995b29de8fb0f600ca092eca

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.24.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