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.15.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distributions

py_rattler-0.15.0-cp38-abi3-win_amd64.whl (11.6 MB view details)

Uploaded CPython 3.8+Windows x86-64

py_rattler-0.15.0-cp38-abi3-win32.whl (10.5 MB view details)

Uploaded CPython 3.8+Windows x86

py_rattler-0.15.0-cp38-abi3-musllinux_1_2_x86_64.whl (16.2 MB view details)

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

py_rattler-0.15.0-cp38-abi3-musllinux_1_2_i686.whl (18.3 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ i686

py_rattler-0.15.0-cp38-abi3-musllinux_1_2_armv7l.whl (15.9 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARMv7l

py_rattler-0.15.0-cp38-abi3-musllinux_1_2_aarch64.whl (15.8 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

py_rattler-0.15.0-cp38-abi3-manylinux_2_28_armv7l.whl (15.6 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARMv7l

py_rattler-0.15.0-cp38-abi3-manylinux_2_28_aarch64.whl (15.8 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

py_rattler-0.15.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.0 MB view details)

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

py_rattler-0.15.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (19.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64le

py_rattler-0.15.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (19.9 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64

py_rattler-0.15.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (16.8 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

py_rattler-0.15.0-cp38-abi3-macosx_10_12_x86_64.whl (13.4 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

py_rattler-0.15.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (26.3 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.15.0.tar.gz.

File metadata

  • Download URL: py_rattler-0.15.0.tar.gz
  • Upload date:
  • Size: 2.0 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.15.0.tar.gz
Algorithm Hash digest
SHA256 c6240fee02344e12631dd581fd68f50929e89948f362732ae105a53103d37f4a
MD5 2e40adf23796fee03c3067c03cb8041a
BLAKE2b-256 5aea4bd68b63bb4610d4dd419dee48905c4b8969005d082d59caf5802d57928d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_rattler-0.15.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 11.6 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.15.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d8a060e9821c764282ab245cac871c53478f9eea33242710090c07fd7369d5a3
MD5 0f4c747922a0196c7c861bf28a09950a
BLAKE2b-256 2ee73732ea0d57c658f17b16ac38d5ad6ea3e6778587f7343adefcba2b448667

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_rattler-0.15.0-cp38-abi3-win32.whl
  • Upload date:
  • Size: 10.5 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.15.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 95c487254231256ce731402604f9aad13938c4e8a692010c943cae48094283cc
MD5 56fbd01df094da0a6b10ba5fddb154f3
BLAKE2b-256 630d07a95a978ffa68b75c3f6843b0a3d72fdaf4de9a49199f30c0ffd9bde9ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 862fe20b5634649ab7dc2d0ef68dcbeddcb544c35ebce66683260bf038636275
MD5 6ae792062540dd6462e5ec50c76a10a4
BLAKE2b-256 9ffcb6c13ff18f9a8be4e02f80ad21eb4d61770fee0dbe9dfe1b9dd31cdc81de

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 52cb204e35ef4f8b7ba88455e84083ca8dee5b2a8bfc4e832843d698c66c456b
MD5 04fd26e96d4e7b3d984bc5e57bb6bcbb
BLAKE2b-256 884a6a3bd728115b3933eb3226540754abba7bd22e192c224b4ede8d94ab7d6b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 3efaf1569e95e7ccc52b2e501f68f4abcf6f275c87207350aa1a578a653783c0
MD5 3f27c32ab2c3ea209ab0e4fe0638cb27
BLAKE2b-256 5c15ff44c374f6e826167b972d42b724be7f20186d2017db8c715794e6fc7ef1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5f07ad1ee7e9676566eeaf6c1b5f9ea70f1ca5b3bcd95510309e5c81a6ca862e
MD5 1cf587c51a5586ce87aa5da53a8475a5
BLAKE2b-256 f21c34109c33453618bfd1c15592bc5c9d4ba3c1bf7d734c342cea167baec9b8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 9b099e177dbe88dabcf93ea6ff70f4970a3da5e9b58066dae6350ef355fe709f
MD5 d41118f18fe166e71794ec42e642aeb5
BLAKE2b-256 a13ab09d773af7685e261066c0cba52787b4e1d6e346b08e4648bae59db490d8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cc983607c3bf8d34bad4a2c5445763df9e19129a12747bdd456e072d5326505f
MD5 190dd5fd6c628099be8be68e9dbecd2d
BLAKE2b-256 1617c248bb8899efb051a85a4894a8f6fb143714be913c35588aa9cd5cdde404

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 19ccd381bfcaa8eddcdc0edef684c78797719ca36489b0c109285e1975571aa7
MD5 663907960501504a48e88f202b2a6908
BLAKE2b-256 63af658ab85515ffd470f6fe845cbdf2a4099a718b8304ebaa15c7826dcb8ea7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 9f68300c79115e2390d83e9c8ee1647a141209d4197176a65753ab62c40e7644
MD5 7c96a418403b8018f00e8c8123dd7482
BLAKE2b-256 87c82391644414839c744ea8f9be41235b3840048fe95a0efdd1925993c193f9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 f5fc2601d1dee9a56b78263568fd9eda95fa62c9f0c1ca2d4558a7b1e13f6b7a
MD5 42904c95a0aa35a1939d5cf5c0082855
BLAKE2b-256 73571658fe763c4a59457b0e99a5d23948481287166789755271f6bd6cd7db32

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 297436bd42d6d6c8a48f4e41dd85988c3579314e4b20946753a0925756b8ac38
MD5 924745801165ad01d47781f63c29c66b
BLAKE2b-256 23cd3babe2bb3238e441b6dfec406435abe34d20a85e337a77205daadaa17892

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.15.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ea9b529903b4c663440ebe1836db8cedcdafe0b5d1777cbc946bb9bc7c351f55
MD5 9adb6f476441e4ae50b44f7bac1cd3a3
BLAKE2b-256 86ec26c0635f83b6f9d0973e04f19b8e2dad05533400e8c77bfd46f458719283

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.15.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.15.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.15.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 7dcd3413ab85a89b35dc9e8597ebe6765e1eb982b5cf497198330fb989ea1e57
MD5 09d8db7b0325cc0fdcdf13858518c3dc
BLAKE2b-256 5240cf00e0612bb52142876726a92f7bdeaad27ec108c8979384de8f4803d306

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.15.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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page