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.2.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.2-cp38-abi3-win_amd64.whl (15.2 MB view details)

Uploaded CPython 3.8+Windows x86-64

py_rattler-0.23.2-cp38-abi3-win32.whl (13.6 MB view details)

Uploaded CPython 3.8+Windows x86

py_rattler-0.23.2-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.23.2-cp38-abi3-musllinux_1_2_i686.whl (22.7 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ i686

py_rattler-0.23.2-cp38-abi3-musllinux_1_2_armv7l.whl (19.4 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARMv7l

py_rattler-0.23.2-cp38-abi3-musllinux_1_2_aarch64.whl (20.3 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

py_rattler-0.23.2-cp38-abi3-manylinux_2_28_armv7l.whl (19.3 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

py_rattler-0.23.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.1 MB view details)

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

py_rattler-0.23.2-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.23.2-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.23.2-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (21.4 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

py_rattler-0.23.2-cp38-abi3-macosx_10_12_x86_64.whl (17.9 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

py_rattler-0.23.2-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (34.4 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.2.tar.gz.

File metadata

  • Download URL: py_rattler-0.23.2.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.2.tar.gz
Algorithm Hash digest
SHA256 0b6eaf428054ad6c5357c27d8b017843019bca27a4dbd308c541c467d6525523
MD5 d5b05c64b82311e6f335a58a20753a73
BLAKE2b-256 9c74ef51ab3c63b33747436192da9d1f312a6d38cc981e01a8f9c76bb412ffeb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_rattler-0.23.2-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 15.2 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.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 dcf730a9af43aba38bad0c047e39e669fd120d41faa247e455aafa4e3ef6623c
MD5 a7ac4c26cc57f5602dd1356cacb74075
BLAKE2b-256 4ce1011b49f954b3bcc773f81d73f4ee873d21d8e394366df316e66e857fedfe

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_rattler-0.23.2-cp38-abi3-win32.whl
  • Upload date:
  • Size: 13.6 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.2-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 349ff4313739bb988bb88e080b67e6ca84104f2cf988343de87604c70f69bbc9
MD5 657061ef1b70245b7e05986e8769d638
BLAKE2b-256 7ee4204e9206c6ba9cbc2f656e040c685bcd7a8eeb9dfd3dadf6ad484c0f2e39

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7cb9979c1c5dd05793ea672858fe989c309bcb405b6e4d358b4a5a8a8d8de4ec
MD5 e6f96c45a06e178316e407649f74dc32
BLAKE2b-256 a38c5fb4d20dcd55fd5d6eb7d16d800030d10bb12446eb285b6c6cf0071a975e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 61b3929eb15a5a7fe5d3a785be1a890fd92570619507cf54e8d536d4a262a943
MD5 0763f781b5c1a5930f085f4d6fe2c629
BLAKE2b-256 8568a3fe744827d03d0a8e29c02ffc7ccfd1c5d00b0e55b20dd97020f59e1760

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 f8dc384841df27f20a345f8ab529f6d861bd7d87ee481e0538d70f34c26943e3
MD5 b134c980aed36a7c917145ea43ad4c6c
BLAKE2b-256 a9fc59177162308ea9df743fe12370404bfec085db9c863a97739842fb511bc5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 f9c2a9fb0e08d888916c0f66a17c8a8727352235061f8b852252530c993c818f
MD5 45eb14358a90ebf2549e6fd20073c3ef
BLAKE2b-256 58a2b7e28547e6f8e693d87a8b7aa3877e196f0fa6e52812851a2e3542c51384

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 b4709d39f2b1bacb0742f3a8c314ebc15f1399ae2fc4408d0eaff895895f7f14
MD5 04f6010c001337294bdfda28004dc875
BLAKE2b-256 d8f1ecf034c9c9ee2f449849a69cd6f73f8f88a160fff4ca263c0634a2768bcf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 77e72d2f9168cf493d1420dbd51dc3b8cce0a8ea690e6e5cbb809e67657059a4
MD5 72f86e5f5beb64c9bb69eed5f3e0f001
BLAKE2b-256 4a84a39988634d76f1530dca79d96bf6e81e783444af19791ac29c2c47ba51b1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a502192d3f3c13a6c332e1d790e85c49bd8cbdf814c6d312841586b5b5988acb
MD5 dababcabb18e56604887f7f4c07e1a19
BLAKE2b-256 5a866e0202ddd5ffc1c9cb1be80c9981a67061413e05ab6073939fa9c9dc0821

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 a722545ce466e6c68288ebd28567c7d7736756a7e9eb18c55bf17eea433fed9f
MD5 f27bd4f1f9d3ec3d8d057e2aa6e37a1e
BLAKE2b-256 aab3e38fc548f9fc0f9857ec20a31152d05cc23e07a82487f0e0f955321560d9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 0363c602d36dcef5315742e8798ff13a962a4b40ee605f16e6ca70f3bca9b06d
MD5 acf151272e0ece8b9318017282d5419c
BLAKE2b-256 dcd7d842dd0374a4bf9aa71fdf061f00eb6cce01ab29a683e8a0d53032cbf09b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 267419b30ec460bde0ed760a9a8b237b694736379cf508974d47c4976a83ae05
MD5 c2592f4edb462f6420f55a7dee1399c5
BLAKE2b-256 63a6e05b7e98dbb61552d9a7b9520896900b0d1a80af1fd463e04bbaa63992d6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.23.2-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4cd015c5122e29111ece5a402e9b38f12dfa78ede3c00e979e3f1b05816dbe5a
MD5 cc2eab2b3c506ca14a7716d86bb7fee7
BLAKE2b-256 57a94fbf9856840f0bb4d0ebaccbb8b217ff63265f219a68a38f7bb8bf987e0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.23.2-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.2-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.2-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 87be072cae015d9323dbb2eee3adcb0fef85db6a96b3a0dfd4e2e71603544636
MD5 fc2dfdfc9e5526315454c3e4bf0c0bac
BLAKE2b-256 3a39e6e984b7ca34a2e30f1a984bd40cb1ef561a705bc1b36b9e960c975234f3

See more details on using hashes here.

Provenance

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