Skip to main content

ruru

ruru

PyPI Version uv Ruff usethis

A collection of Python utilities ported from the R ecosystem.

Features

base module

The ruru.base module provides core utilities:

  • match_arg: A Python equivalent of R's match.arg function for verifying function arguments against a set of valid options. Recommended usage:
from ruru.base import match_arg

user_choice = "apple"
available_choices = ["Apple", "Banana", "Cherry"]

# Normalize user input before passing it to match_arg.
# Which transformation to use depends on the style of available_choices:
#   - .title() if choices look like "Apple"
#   - .upper() if choices look like "APPLE"
#   - .lower() if choices look like "apple"

user_choice = match_arg(user_choice.title(), available_choices)
  • pmatch: A Python equivalent of R's pmatch function for finding partial substring matches against a set of reference strings.

Inspired by the R base package.

config module

The ruru.config module gives an easy way to manage of configuration settings in Python applications via YAML files.

Recommended usage:

from importlib.resources import files
from ruru import config

config_path = files("<mypkg>.cli").joinpath("config.yml") 
config_dict = config.get(file = config_path)

Inspired by the R config package.

cli module

The ruru.cli module provides utilities for enhanced command-line interface output, including colored text, formatted headings, alert messages, and bullet-point lists.

Recommended usage:

from ruru import cli
cli.h1("Heading")
cli.alert("This is an alert message")

Inspired by the R cli package.

Metadata

Release files for ruru 0.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ruru 0.3.7
File Size Uploaded
ruru-0.3.7.tar.gz 196.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ruru 0.3.7
File Interpreter ABI Platform
ruru-0.3.7-py3-none-any.whl Python 3 none any Details

Total release size: 210.0 kB

Release files / ruru-0.3.7.tar.gz

Download URL ruru-0.3.7.tar.gz
Size 196.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dfed7031ce028b7bb64e18d63e163b119bd5f28e81668e9378e64e1b355e77f6
BLAKE2b-256 checksum
How to use checksums
bf4b71dfc7eeb7516a965e6fc6011f6a58a48ad8e6805c87418c2c162a5e4612
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.3

Release files / ruru-0.3.7-py3-none-any.whl

Download URL ruru-0.3.7-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67cee430814a52902d95e4d88b721d1ae2112edc5bfb0c9c11fe6ecb99d644da
BLAKE2b-256 checksum
How to use checksums
2988668ffa40b6c781c084ceb716c0daf499ba39ad34d93d9d924cce67db37c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.3

Release history Release notifications | RSS feed

This release

0.3.7 This release

2 release files

0.3.6

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page