semvec/pypi-packages huggingface dataset:
cooleans 0.2.0
Better than booleans
Requires Python: >=3.6
Keywords: type bool booleans perhaps

# Cooleans

Cooleans is a Python package that aims to enhance the bool type in Python by adding a new possible value: "perhaps". This is a value that is neither True nor False, but rather may be one of those values. With cooleans, you can more accurately represent situations where the truth value of a statement is uncertain or unknown.

## Getting Started

### Installation

You can install cooleans using pip:  
`pip install cooleans`

### Usage

Here's an example of how to use cooleans in Python:

```python
from cooleans import DefinitelyTrue, DefinitelyFalse, Perhaps

my_bool = DefinitelyTrue
if my_bool:
    print("This is definitely true")

my_bool = Perhaps
if my_bool >= Perhaps:
    print("This might be true")
```

In this example, we create a `DefinitelyTrue` coolean value and use it in an if statement to print "This is definitely true". We then create a Perhaps coolean value and use it in an if statement to print "This might be true". Note that Perhaps will always have a truth value of False when treated as a bool.  

### Supported Operators

Cooleans support the same logical operators as normal bools in Python, including:

- `and`
- `or`
- `not`
- `==`
- `!=`
- `<`
- `>`
- `<=`
- `>=`

### Using Values Directly

Cooleans can be used directly as values since they are implemented as a Python class, like so:

```python
from cooleans import DefinitelyTrue, DefinitelyFalse, Perhaps

print(DefinitelyTrue and DefinitelyFalse)
```

This code snippet will output DefinitelyFalse.  

## Contributing

We don't welcome contributions to cooleans yet.  

## License

This project is licensed under the MIT License - see the LICENSE file for details.
arris-tg2492lg 2.2.0
Python client for the Arris TG2492LG
Requires Python: >=3.7

# Arris TG2492LG Python client

A unofficial Python client for retrieving information from the Arris TG2492LG router. The Arris TG2492LG is one of two routers that Ziggo, a cable operator in the Netherlands, provides to their customers as the Ziggo Connectbox.

The current functionality is limited to retrieving a list of devices that are connected to the router.

> **_WARNING:_** The router prevents the admin user from logging in twice. This can cause problems with accessing the router's configuration pages while using this library. 

## Usage

List all connected devices:

```python
import asyncio
import aiohttp

from arris_tg2492lg import ConnectBox


async def main():
    async with aiohttp.ClientSession() as session:
        connect_box = ConnectBox(session, "http://192.168.178.1", "password")

        devices = await connect_box.async_get_connected_devices()

        print(devices)

        await connect_box.async_logout()


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
```

Please note that the list of connected devices include devices that are offline (e.g. just went out of range of the wifi). The `Device` class contains a property `online` that can be checked.

An example for retrieving a list of the MAC addresses of all online device is included in the `examples` folder:

```bash
python3 list_online_devices.py --host http://192.168.178.1 --password <password>
```

## Development

Setup `arris_tg2492lg` for local development by running:

```bash
python3 -m venv venv
```

```bash
source venv/bin/activate
```

```bash
scripts/setup
```

This will create a virtual environment, download the required libraries and configure a git commit hook.
maz 0.0.12
Functional programming tools.
Requires Python: >=3.9,<4.0

# MAZ
*A functional programming package.*

### Install
```
pip install maz
```

### Main usage
##### Function composition
You can use `maz` to compose function calls such that they call one another in a series. 
**NOTE:** functions are called from right to left.
```python
>>> import maz
>>> succ = lambda x: x+1
>>> add_three = maz.compose(succ,succ,succ)
>>> add_three(4)
>>> 7
```

##### Partial function
When you want to fix a parameter in a function, you could just use the `functools.partial`. However, that doesn't support fixing a positional argument on a specific index, which are quite common later on when you want to build complex compositions. Here you can use the `maz.partialpos` instead
```python
>>> import maz
>>> def add(x,y): return x+y
>>> add_two = maz.partialpos(add, {1:2}) # fixing argument for index 1 to 2 (y=2)
>>> add_two(3)
>>> 5
```

### Complex compositions
To support more complex compositions we've added some special functions such as
```python
import maz
import operator
import itertools

# "invoke" function - a function calling other functions
def add(x,y): 
    return x+y

maz.invoke(add, [1,2]) # >>> 3
maz.invoke_star(add, 1, 2) # >>> 3

# "fnmap" function will compute all input functions in a 
# series with same given arguments 
fn = maz.fnmap(add, add, add)
fn(1,2) # >>> [3, 3, 3]

# "ifttt" returns a new function that checks the input somehow
# then does something depending on the result from the check
fn = maz.ifttt(
    # if x is greater than 3,
    lambda x: x > 3,
    # then subtract 1 from x
    lambda x: x - 1,
    # else add 1 to x
    lambda x: x + 1
)
fn(3) # >>> 4
fn(4) # >>> 3

# "starfilter" just as itertools.starmap but a filter instead
# Example, filter tuples who's sum is greater than 4 
next(
    maz.starfilter(
        maz.compose(
            lambda i: i > 4,
            add
        ), 
        itertools.product(range(3), range(3,6))
    )
) # >>> (0,5)

# "constant" returns a function which, no matter the argument, returns a constant value.
cnst_fn = maz.constant(True)
cnst_fn() # >>> True
cnst_fn(cnst_fn()) # >>> True

```

## Other functions
We've added a `tools` module to provide functions that are in the middle of being simple enough to just write it yourself but tideous enough to not do it.
```python

from maz.tools import reverse_otm_dict

# Reversing a one-to-many relationship map
d = reverse_otm_dict({
    "a": [1,2,3],
    "b": [1,2,4],
    "c": [4,5]
})

# >>> d
# {
#     1: frozenset({"a", "b"}),
#     2: frozenset({"a", "b"}),
#     3: frozenset({"a"}),
#     4: frozenset({"b", "c"}),
#     5: frozenset({"c"}),
# }