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.1.tar.gz (2.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.23.1-cp38-abi3-win_amd64.whl (15.1 MB view details)

Uploaded CPython 3.8+Windows x86-64

py_rattler-0.23.1-cp38-abi3-win32.whl (13.5 MB view details)

Uploaded CPython 3.8+Windows x86

py_rattler-0.23.1-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.1-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.1-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.1-cp38-abi3-musllinux_1_2_aarch64.whl (20.2 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

py_rattler-0.23.1-cp38-abi3-manylinux_2_28_armv7l.whl (19.1 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARMv7l

py_rattler-0.23.1-cp38-abi3-manylinux_2_28_aarch64.whl (20.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

py_rattler-0.23.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.0 MB view details)

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

py_rattler-0.23.1-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.1-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (27.9 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64

py_rattler-0.23.1-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (21.3 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

py_rattler-0.23.1-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.1-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (34.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.23.1.tar.gz.

File metadata

  • Download URL: py_rattler-0.23.1.tar.gz
  • Upload date:
  • Size: 2.4 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.1.tar.gz
Algorithm Hash digest
SHA256 d3ec4c01bd12cf80b38ba98f9631d904bdcfbfa152c3c8ce1eb6198239f94ce9
MD5 7490408ac6406983ead3d4a90cfb10aa
BLAKE2b-256 9e1aaf3937575b8a8d1deed07c7725e98b49cf815d07aadf66ba4729bd255685

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_rattler-0.23.1-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 15.1 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.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d34d7533702a885939177c3caa631b03f69e687a331947eba3cc4b4fd73c727e
MD5 cf100fdb059732243da3dd344f87fe93
BLAKE2b-256 a1ea7bd678385ab0d9a92dc3d4e339e30bd66a74d7dc2a59e4f4cbe39f15ed7f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_rattler-0.23.1-cp38-abi3-win32.whl
  • Upload date:
  • Size: 13.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.23.1-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 f0336fc2afa6de7d14a20d5dba38fd23210c25c49635c1b99c1e5bb404bf7fc3
MD5 214c861b5c625d999769457876f0b57b
BLAKE2b-256 0a608abc075308073b6059dab56ab27194c86b8044064ff7f552a1eab7e7b588

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 912eef4c8f195dbb7f1e06e9e7096aea2bacaaf79c33e0971b049b3ca6f76263
MD5 0dc55667fc2ecec4286685a0b04ea622
BLAKE2b-256 84ffc30b8e006b8ed5551434230a482c78d6d60163159a8efe41e7c4ec8cb064

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 7ec8690dfdbb782f1aaff04e340ebe0cf4c212d2c57d76c26e5be3d8537302da
MD5 215155e8d672f3673228910fb4bff475
BLAKE2b-256 b2bde906466e6fa76963957344b09b1487ddd7a9734abca033256ad8d3af71be

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 a9b67e051c7dd4d3a9688bb2ed57c992b33758ba341ee40737291467182aa0ea
MD5 5b31efc4b76fdadfb4b4b3b1af2c0aa0
BLAKE2b-256 32a0cf40f2e2e68faa8dd127fb6bb665f190ac1f6e4fe08c8be67d19b514f87e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c54a83ae48468713cbf42151e725423517c75186e5a454f2c23f31c89444a5bb
MD5 799ba6f265142fe905e844c8e9a1e516
BLAKE2b-256 21a76e0dadf4183716f37ce1a80006e010643526624b81108deb077878400d58

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 fbb778867ac116086a7f306fe75efe1925226b7a618439e5d0241b0c5f1d01b0
MD5 630e9a1dee3b3633c1adc461fcf44d5a
BLAKE2b-256 c7973231c24cf69dcabe96e4c39e8843c3b6dc879a52b239e3a2a674ef9841dc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c793dab3487529e376f485839c301ecc33dbc6e4eff875da95c5927700078e39
MD5 860bf574344eddcdc9aa204bec3955f2
BLAKE2b-256 984b1d575f9e7ace3cb4a8344b74d4d348c07bd87c3683b7a786703fc198c8f8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0f981014920c56c984c7b0f80201b0f35c9040b71f2d133ec304694b1bd06194
MD5 aa0282c71d6e45aa87c4993c9b03a909
BLAKE2b-256 3472303d7f45efa341fadb396d1e59b790c15b5d378ad2ec2eeca260c7f6d2bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 f0289065b39e7e7d25b33f6befedc9ee5386865adf6658114e47ae6c3e04fcde
MD5 7d5d522a3fb55d739e83c1b8714f4f3e
BLAKE2b-256 527e28fb25c43a24ab480b77492e92c1575774093ef79b1981383e93d672da59

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 ba56a1b3d58c7c388612d36b27009ff45da95669e029a48d641aab00230fbbbc
MD5 a3546ec92acf61c42fa1de1d7cace97f
BLAKE2b-256 0013a2196e91f4a0b08641036a72807f1703775116e8ae8328974fd8ddccca7f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 fe0a8849663272681c1f8ceabdc64daa13b6884de43f7eefab8ee6c8dc615361
MD5 1682118bb88e62e6de1ca876537ccea1
BLAKE2b-256 4d12d8df652da67b8430a5c25d88fbbd739195698d3d13ba916983a91c04ea72

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.1-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b44d0f3e923da150425a68357ec43edf55728990e13866d53b9ac98778da89a7
MD5 5b3a659730b953f7a6f2769090ce380e
BLAKE2b-256 65b209ed13f1332672322637fdddbf712f7fa3b06f8c154be61d5917132ded57

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.1-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.1-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.1-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 b8357f9876b197d6edcc023d2685feb795ea055e053a4f8ee3b9b810c1b9143a
MD5 185147e5296084b2d1c935cfb0443798
BLAKE2b-256 714fdc1872947c27eed97475a009b87b491fd952b2d6997aee9a737dc7d2da8b

See more details on using hashes here.

Provenance

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