semvec/pypi-packages huggingface dataset:
subps 1.0.1
Wrapper script for subprocess usage
Requires Python: >=3.3

# Python3 - SubPS

Wrapper script for subprocess usage.

It only uses builtin modules.

## Install

```bash
python3 -m pip install subps
```

See: [PyPI](https://pypi.org/project/subps/)

## Usage

```python3
from subps import process, process_out_err, process_out, process_err, process_rc

process(cmd='ls -l')
# dict('stdout': 'stdout...', 'stderr': 'stderr...', 'rc': 0)

process_out_err(cmd='ls -l')
# tuple('stdout...', 'stderr...')

process_out(cmd='ls -l')
# 'stdout...'

process_err(cmd='ls -l')
# 'stderr...'

process_rc(cmd='ls -l')
# 0
```
viper-test 0.0.1
Simple, expressive pipeline syntax to transform and manipulate data with ease
Requires Python: >=3.8

# viper

<img src='docs/logo.png' align="right" width="150"/>

> Simple, expressive pipeline syntax to transform and manipulate data with ease 

## Overview

`viper` is a Python package that provides a simple, expressive way to work with data. It allows you to easily manipulate and transform data using a pipeline syntax similar to that of [dplyr](https://dplyr.tidyverse.org/).
 
Pipelining your DataFrame manipulation operations offers several benefits:

- improved code readability (no need to 'comment the what')
- no need to save intermediate dataframes
- ability to chain a long sequence of operations in a single command
- thinking of coding as a series of transformations between the input and the desired output can improve the design and make it less coupled

## Docs
Complete documentation and reference are available on the package's site.

## Quick Start

Installation:
``` shell
pip install viper
```

Here is an example of how to use `viper` to analyze the famed `mtcars` dataset.

We want to find:
- the average consumption, expressed in Miles/(US) gallon
- the average power

Furthermore:
- only consider those cars that weigh more than 2000lbs
- group the results by the number of cylinders and number of gears
- arrange in descending orders by the grouping variables


``` python
from viper.main import *
from viper.data import mtcars

pipeline(
    mtcars,
    rename(
        "hp = power",
        "mpg = consumption",
    ),
    mutate(
        consumption=lambda r: 1 / r["consumption"]
    ),
    filter(
        lambda r: r["wt"] > 2
    ),
    group_by("cyl", "gear"),
    summarize(
        "power = mean()",
        "consumption = mean()"
    ),
    arrange(
        "cyl desc",
        "gear desc"
    ),
)
#                power  consumption
# cyl gear
# 8   5     299.500000     0.064979
#     3     194.166667     0.068824
# 6   5     175.000000     0.050761
#     4     116.500000     0.050875
#     3     107.500000     0.050989
# 4   5      91.000000     0.038462
#     4      85.000000     0.041259
#     3      97.000000     0.046512
```

Here you can find more examples, particularly on joins.

## Roadmap

The future development of the package will probably focus on:

- adding `pivot_longer`and `pivot_wider` functions
- adding more `join_*` functions

## Contributions

You are welcome to contribute to the project or open [issues](https://github.com/aropele/viper/issues) if you have any ideas.
pyChaining 0.0.2
java stream style(high order, map reduce and method chaining) library for simplify the multiple map and filter operations
Requires Python: >=3.7

# Installation

```
pip install xethhung/pyChaining
```

# Usage
```python
from pyChaining import Chains

xx = Chains.of([1, 2, 3, 4, 5, 6, 7]).list()
assert xx == [1, 2, 3, 4, 5, 6, 7]

xx = Chains.of([1, 2, 3, 4, 5, 6, 7]).filter(lambda x: x % 2 == 1).list()
assert xx == [1, 3, 5, 7]

xx = Chains.of([1, 2, 3, 4, 5, 6, 7]).filter(lambda x: x % 2 == 1).map(lambda x: x * 2).list()
assert xx == [2, 6, 10, 14]

xx = Chains.of([1, 2, 3, 4, 5, 6, 7]).filter(lambda x: x % 2 == 1).map(lambda x: x * 2)
    .skip(1).list()
assert xx == [6, 10, 14]

xx = Chains.of([1, 2, 3, 4, 5, 6, 7]).filter(lambda x: x % 2 == 1).map(lambda x: x * 2)
    .skip(2).list()
assert xx == [10, 14]

xx = Chains.of([1, 2, 3, 4, 5, 6, 7]).filter(lambda x: x % 2 == 1).map(lambda x: x * 2)
    .first()
assert xx == 2

xx = Chains.of([1, 2, 3, 4, 5, 6, 7]).filter(lambda x: x % 2 == 1).map(lambda x: x * 2)
    .last()
assert xx == 14

xx = Chains.of([1, 2, 3, 4, 5, 6, 7])
    .skipUntil(lambda x: x == 2).list()
assert xx == [2, 3, 4, 5, 6, 7]

xx = Chains.of([1, 2, 3, 4, 5, 6, 7])
    .stopBefore(lambda x: x == 5).list()
assert xx == [1, 2, 3, 4]

xx = Chains.of([1, 2, 3, 4, 5, 6, 7])
    .stopAt(lambda x: x == 5).list()
assert xx == [1, 2, 3, 4, 5]

xx = Chains.of([1, 2, 3, 4, 5, 6, 7])
    .stopAfter(lambda x: x == 5, 1).list()
assert xx == [1, 2, 3, 4, 5, 6]

xx = Chains.of([1, 2, 3, 4, 5, 6, 7])
    .flatMap(lambda x: [x, x]).list()
assert xx == [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7]

xx = Chains.of([[1, 2, 3], [4, 5], [6, 7]])
    .flatten().list()
assert xx == [1, 2, 3, 4, 5, 6, 7]

```