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.22.0.tar.gz (2.3 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.22.0-cp38-abi3-win_amd64.whl (14.1 MB view details)

Uploaded CPython 3.8+Windows x86-64

py_rattler-0.22.0-cp38-abi3-win32.whl (12.8 MB view details)

Uploaded CPython 3.8+Windows x86

py_rattler-0.22.0-cp38-abi3-musllinux_1_2_x86_64.whl (19.3 MB view details)

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

py_rattler-0.22.0-cp38-abi3-musllinux_1_2_i686.whl (21.7 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ i686

py_rattler-0.22.0-cp38-abi3-musllinux_1_2_armv7l.whl (18.5 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARMv7l

py_rattler-0.22.0-cp38-abi3-musllinux_1_2_aarch64.whl (18.8 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

py_rattler-0.22.0-cp38-abi3-manylinux_2_28_armv7l.whl (18.3 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARMv7l

py_rattler-0.22.0-cp38-abi3-manylinux_2_28_aarch64.whl (18.8 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

py_rattler-0.22.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.1 MB view details)

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

py_rattler-0.22.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (25.8 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64le

py_rattler-0.22.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (27.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ppc64

py_rattler-0.22.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (20.3 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

py_rattler-0.22.0-cp38-abi3-macosx_10_12_x86_64.whl (16.3 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

py_rattler-0.22.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (31.5 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.22.0.tar.gz.

File metadata

  • Download URL: py_rattler-0.22.0.tar.gz
  • Upload date:
  • Size: 2.3 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.22.0.tar.gz
Algorithm Hash digest
SHA256 46e047ff23a8fe2f3b599f02ef24ff29a6e65c571202828863361d2e9d33fdd8
MD5 8401fc26ad999600142d7c40faceaf12
BLAKE2b-256 1eda8385df5a3bfb5f8904da27011074247a858d71b0a35e29688a0d4cbfe6b0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_rattler-0.22.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 14.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.22.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b806d57dae960274bd2730b56f603c53423f5af3e78b863e9b75a50b00740a69
MD5 22e49cdb3c7bc3ef85f5c4bb7626b9f5
BLAKE2b-256 504438a450188c78858dc39635867f15e6964dc4d5aa8ad82bc4ae74a15293c4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_rattler-0.22.0-cp38-abi3-win32.whl
  • Upload date:
  • Size: 12.8 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.22.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 65958cebea28b2c10be527289294984b763b6247fd76ef91dabf6cb9ea662a6d
MD5 f4ecd7a45ff2192c91db1b407b9aafce
BLAKE2b-256 0f7976b9f7b79c926b6ae5f768f5bcd68bb17dd794f998f7fbb7fbfd17934b55

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 899a3d41493998038d8841b088d32295b6e4372c5b3b59bb1bd2b731d357d217
MD5 824f999ef752e1b5059ab9654ec9e8ff
BLAKE2b-256 f1265ffdd07e5bfeded84cc561cc9066abe0afc7a40d52665c8423dc861cf967

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 91b08dd879620d47142282b9621ec05cf9b02baa8a6db1e8f1b94c1f77b7abcf
MD5 023dc126ca07e4dcf99560bc5d776372
BLAKE2b-256 3623e0792f2fdd88cf965a4eea56397e8c70191f9ce97cf12e025028b13f9926

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 8e665f1c57d034afe970bc696aeeba666136520f66e781671119d34df9d94b85
MD5 efb1999493e2119a736a54454e38d559
BLAKE2b-256 f8ae9b25a848fb37dd151037475b84233d5a8888e57d39693f725815ccb2c5ae

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 338dcce0042db1e2274fd59974492dffbd63f257375bc8136084a73b84cd0dfb
MD5 6462fd4b62c545421765e4d736ae10ed
BLAKE2b-256 b97471f8ec3711873386c2dd7d39bdb39f9524a0de5442ffc617191425945aca

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 22bd84faedec35314efdd18ad71b1f790fed2ef0a15763ca38d6f77f0579814c
MD5 26b75554d7d433ea034e8241b26ca0de
BLAKE2b-256 bffbedf3723aa679a93893120082e604091c7cf2b8459f8daa5ee45951eeaee8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e5794108c5ee00f31d106842b54564d5b847081e09ad0f143cb215ce20ac1385
MD5 445d86835ab7976a2d28e63eb242c8f2
BLAKE2b-256 e6b54b7e314fcf6b84d9d39963722922a5e67d664058f0bf55d71512c0d632ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ddd8d78081d0f59f5394bd152223f6c0a616b7b800aec86131fa526f4539526
MD5 e5876bada88f7158e64b7e352b54ac42
BLAKE2b-256 637bc9909e847b5c961fd8ce7f75ffc7080653f2e010dfcd0959fccb63bfd55c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 83fe479e28a3565015e8ef7bb797c14eab07d30ceafe4eeee1ecd128e6ed4d2b
MD5 c3337b003b4cba92df08b96f06bc743b
BLAKE2b-256 3dc270c9ee8ba764c7549b8b73d53c6f6e9bb16f9414161fd4e41cfc9b3372af

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 30c5f3373d74d4a9b6d276f1554e193f36158674b751a4d7b1f5aec02c25a538
MD5 1d3c329f9ba37084c353b443c7082c19
BLAKE2b-256 414e45b38fa958fe3e64bce1c1c262f8f9b016117fae39a760603688196bd4c5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 f3aa8b7c4dfe15accc4e42625492f9bbf4c120bf18ede1604af3104d2328f2d1
MD5 09e595a7786ed9f511fce542e3b8bfea
BLAKE2b-256 d05c904613590fffad0d0e0182fe8ed8c9aa9aae0bdfb576cf53c80657c4c0fb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for py_rattler-0.22.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 60c6679744e4271bb76cb8dd5aff72427e18b94ad5ed025dc0ab913c5da75743
MD5 f0550968be7f9282cfb22309a9072be3
BLAKE2b-256 53d4c2368a59e32bdcc5d230111c15a976364b2ff1830c7ba93e868c942033eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_rattler-0.22.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.22.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.22.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 ee147995a22f62869ec241f461db3f29d3dfb92e585669953ebc11c0e0124282
MD5 9d37d02923c5789e8ed51dbc09f4cacb
BLAKE2b-256 78d0cd76386cf9c13c5fa5526c5f26f11f8db9276b413155be9bc94b794fbf0a

See more details on using hashes here.

Provenance

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