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.25.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.25.0-cp38-abi3-win_amd64.whl (16.6 MB view details)

Uploaded CPython 3.8+Windows x86-64

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

Uploaded CPython 3.8+Windows x86

py_rattler-0.25.0-cp38-abi3-musllinux_1_2_x86_64.whl (20.9 MB view details)

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

py_rattler-0.25.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.25.0-cp38-abi3-musllinux_1_2_armv7l.whl (19.7 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARMv7l

py_rattler-0.25.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.25.0-cp38-abi3-manylinux_2_28_armv7l.whl (19.5 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARMv7l

py_rattler-0.25.0-cp38-abi3-manylinux_2_28_aarch64.whl (20.3 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

py_rattler-0.25.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.25.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (27.1 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64le

py_rattler-0.25.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.25.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.25.0-cp38-abi3-macosx_10_12_x86_64.whl (18.7 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

py_rattler-0.25.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (36.1 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.25.0.tar.gz.

File metadata

  • Download URL: py_rattler-0.25.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.25.0.tar.gz
Algorithm Hash digest
SHA256 62d282870d08404898cec16da39f6085964117d19ee2f6d4a15f3ae19bd07860
MD5 949c6213ea3d293a47098831cb482cf6
BLAKE2b-256 5f1064e7f7e44381b102d48c5ed32771304b31d7549f56f604ba7e108a580293

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_rattler-0.25.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.25.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 81a05608c0efe44652af7395fed9cf398506bd1a67fc5636fa5aaa94cf4f78ac
MD5 7b9274c3efb6340740407f36935b695c
BLAKE2b-256 4c9fd38f9dcd3b2b38de65e17d3cfba6e6c8a672b90e0a76adde5fa357f1c27a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_rattler-0.25.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.25.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 c5446c503738fc2c8db3532eaeae181b1858c88c1f822696246011b32a67b798
MD5 9bf6163df0df671ac4633d8815a505e3
BLAKE2b-256 294754cb11719e04a1cb67e3a42524a774cadc72cae0ab07cb178f357eb0a2c1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 58dfdfb6d9613979f66f261dc9081afc7e141c90f0f963bf7e2240cfe54727b2
MD5 f32b1d0a85680f43759ed125ce8e9283
BLAKE2b-256 244faca22c9242f039f7a0147b50951a32ee31f8f881aab7a9480ad0220c2bf8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 ff6acae962a21f5f91b44fd31125967b23b152ab06dd9fb30d7c5076d1ed851d
MD5 91c162844c7f2bba6cec67d3486cf0a1
BLAKE2b-256 d5e946709db59f2f3648ab228f33921bd232072cb44c2f2abdb5cf279c6a1aa2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 57ec195533e36f518f9676eee1de75ba474ac6076e92c6a8c0c00bba4708aead
MD5 797c3d1c2054c08391419c2aca03b594
BLAKE2b-256 6e2b29ba4d031c697cd077591fe54ff93c9efb36d41584a6d8d7ce9eb00a775e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a8cf0da4bbfcafcf4c073eea8b9dd19592ff0e9917f34ed88aa8099f213cf31f
MD5 c831b331f5838f59acb51a0f7a830203
BLAKE2b-256 3675089c0e6af21872015f373e7adefc87dca0e4a0e02c0c7cd12c0b6e093a9a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 64aad8d658c3ccd4aa2a018c9f8057432ee4e833f42dbe9f0043b76a6bb850eb
MD5 013d8d13f8d841153a655f53e38abb51
BLAKE2b-256 b44bfa8f8bb0f7094d984e757622559165b663e37b70fdbac9c3e538e136878b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4520a66fa8d27d07e544275f76a3eef04e58ba83c37e505f6c2a5511837480ff
MD5 7205756b50ee64f9083abc8a05f8d73b
BLAKE2b-256 184f73d8db331e699e8f721c52ea0398bfb9794b3bb28d5cf22c5460b58230d4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b642304155f492c7dd3eb772df5e8e97942bff445ab8e343dc7a173e3efbfcf1
MD5 3976b59575a6f8cf8c0f053f1d31376f
BLAKE2b-256 702aa418ff2229f468e3f40cfe2d89c61eeb31ed49d4e83a28e00ea8909ec6fd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 3d704df01d1fb90df54e7416329f90975fda36a5a22558f88fbdb05462e6e0d9
MD5 779939b8e96e61a8f73937d1238ca840
BLAKE2b-256 97c4bc6eac7312078988f528c54b0a576117a9ec57822c8ac817af822e5dff6b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 6c93630393fbc49156e37e66a07c93c3776d1f93d00ba028a446bdc4195c96a2
MD5 01bb4ab03031f5f1fa83979a8f40a597
BLAKE2b-256 21dcb8bb73356694bd10e5f9fae8880e6c7069b891ed5346b74dbdc9bcb1efa0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 85e39effddec7c77c46ecaaec0bc186d871a74e6fbd62369517525c505526c97
MD5 4436c99c0c7094e131f6da6226708aa6
BLAKE2b-256 88f47ff4c047b1972be5470c2b68893ab9390bdc65dbca4868dea64eb8b360f5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.25.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 38c3d3c235c530589fdfbe114a5d00637591cfc42843329a3373976b6f358ccc
MD5 0e5c9d38ff6571a83252cd2abaff3255
BLAKE2b-256 4ac5d58a7923cb13e9d85bf73cd1b1445e2adb20ec653a1ffb058d181d67cf86

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.25.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.25.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.25.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 473cc070b0e66d6940c43859657ce244636671b1980fa8fe15224139d4f6a8b9
MD5 cb257ee74c61bc588b010f7a1aaf31c8
BLAKE2b-256 957785022634184189df3c12443dee81945e95302040fdcf227e959ea76a0127

See more details on using hashes here.

Provenance

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