semvec/pypi-packages huggingface dataset:
list-lookup 1.0.7
Wrapper for a list of objects that allows to create indexes for faster lookups
License: MIT
Keywords: lookup indexing list

# ListLookup
Wrapper for faster lookups in a list of objects/dictionaries.
**ATTENTION** Do not modify list once indexes are created!

```
from listlookup import ListLookup
cities = ListLookup([
  {"id": 1, "country": "us", name: "Atlanta"},
  {"id": 2, "country": "us", name: "Miami"},
  {"id": 3, "country": "uk", name: "Britain"},
  {"id": 4, "country": "ca", "name": "Barrie"},
])

cities.index("id", lambda d: d['id'], True)
cities.index("country", lambda d: d['country'])

list(cities.lookup(id=1))
>>> [{"id": 1, "country": "us", name: "Atlanta"}]

list(cities.lookup(country="us", preserve_order=True))
>>> [{"id": 1, "country": "us", name: "Atlanta"}, {"id": 2, "country": "us", name: "Miami"}]

list(cities.lookup(id=2, country="uk"))
>>> []

cities.index('name', lambda d: d['name'])
list(cities.lookup(name=lambda val: val.startswith('B'))
>>> [{"id": 3, "country": "uk", name: "Britain"}, {"id": 4, "country": "ca", "name": "Barrie"}]
```

## Case insensitive index
This is not supported out of the box. You need to use same case for index and lookup values. E.g. use `.lower()`
```
from listlookup import ListLookup
cities = ListLookup([
  {"id": 1, "country": "us", name: "Atlanta"},
  {"id": 2, "country": "us", name: "Miami"},
  {"id": 3, "country": "uk", name: "Britain"},
  {"id": 4, "country": "ca", "name": "Barrie"},
])

cities.index("country_ci", lambda d: d['country'].lower())

list(cities.lookup(country_ci="UK".lower()))
>>> [{"id": 3, "country": "uk", name: "Britain"}]
```

## Multiple pointers per item
You can have same record be referenced by multiple values. In the following example "uk" and
"uk2" correspond to the same record because they are returned as alternatives during indexing: 
```
from listlookup import ListLookup
cities = ListLookup([
  {"id": 1, "country": "us", name: "Atlanta"},
  {"id": 2, "country": "us", name: "Miami"},
  {"id": 3, "country": "uk", name: "Britain"},
  {"id": 4, "country": "ca", "name": "Barrie"},
])

cities.index("country_alt", lambda d: [d['country'], "%s2" % d['country']], multiple=True)

list(cities.lookup(country_alt="uk"))
>>> [{"id": 3, "country": "uk", name: "Britain"}]

list(cities.lookup(country_alt="uk2"))
>>> [{"id": 3, "country": "uk", name: "Britain"}]

```
dominion-grpc-proto-grpc-proto 0.2.0
gRPC protobuf definitions + generated Python code
License: MIT
Requires Python: >=3.8

# Dominon gRPC proto
[
![PyPI](https://img.shields.io/pypi/v/dominion-grpc-proto.svg)
![PyPI](https://img.shields.io/github/license/the-gigi/dominion-grpc-proto.svg)
](https://pypi.org/project/dominion-grpc-proto/)



The [gRPC](https://grpc.io/) protobuf definitions for the [Dominion](https://github.com/the-gigi/dominion) project

The dominion.proto specifies Dominion service. The Makefile creates two Python modules that can be used by the Dominion server and clients.

# Build and publish

This section is for the Dominion developers. 
If you just want to implement a player or a client library you can stop reading.


## Pre-requisites

- Install [pyenv](https://github.com/pyenv/pyenv) or [pyenv-win](https://github.com/pyenv-win/pyenv-win)
- Install [poetry](https://python-poetry.org/docs/#installation)

Create a Python 3.8.2 environment

```
$ pyenv install 3.8.2
$ pyenv local
$ poetry init
$ poetry env use 3.8.2
$ poetry install
```


## Building the package

Here is the command to build the package:

```
(🐙)/dominion-grpc-proto
$ poetry run python setup.py bdist_wheel
``` 

The result is tar-gzipped file in the dist subdirectory:

```
(🐙)/dominion-grpc-proto
$ ls dist
dominion_grpc_proto-0.2.0-py3-none-any.whl
```

Save the following to ~/.pypirc

```
[distutils]
index-servers=
    pypi
    pypitest

[pypitest]
repository = https://test.pypi.org/legacy/
username = <your user name>

[pypi]
repository = https://pypi.org/legacy/
username = <your user name>
```

Next, we can upload the package using twine to PyPI.

```
(🐙)/dominion-grpc-proto
$ poetry run twine upload -p <redacted> dist/*.whl

Uploading distributions to https://upload.pypi.org/legacy/
Uploading dominion_grpc_proto-0.2.0-py3-none-any.whl
100%|███████████████████████████████████| 10.3k/10.3k [00:02<00:00, 3.54kB/s]

View at:
https://pypi.org/project/dominion-grpc-proto/0.2.0/
```
RPi.Sensor 0.5.3
Python base class to create infinite loop to work with sensors.
License: MIT

RPi.Sensor
##########

.. image:: https://github.com/ricco386/RPi.Sensor/workflows/Test%20RPi.Sensor%20codebase/badge.svg
.. image:: https://github.com/ricco386/RPi.Sensor/workflows/Release%20RPi.Sensor%20to%20PyPI/badge.svg

Generic Python base class to create infinite loop to work with different sensors connected to Raspberry Pi. Project
contains also extended Python base class with MQTT support.

RPi.Sensor library is stable in terms of running as a base class. Sensor logic and additional functionality before and
after sensor measurement should be implemented in child objects anyway... But there are new features developed (and
bug fixed as they are found) so it is recommended always use the latest version.

If you want to see example of implemented sensors, have a look at my other `RPi repo <https://github.com/ricco386/RPi>`_.

Installation
------------

- Install the latest released version using pip::

    pip install https://github.com/ricco386/RPi.Sensor/zipball/master

- Alternatively install latest released version from pypi::

    pip install --upgrade RPi.Sensor

- Make sure all dependencies (listed below) are installed (done automatically when installing via pip)

**Dependencies:**

- `RPi.GPIO <https://pypi.python.org/pypi/RPi.GPIO/>`_
- `wheel <https://pypi.org/project/wheel/>`_
- `paho-mqtt <https://pypi.org/project/paho-mqtt/>`_

Usage
-----

Inherit Sensor object or MqttSensor.

Main purpose of the sensor object is to run infinite loop for reading from the sensors. Object has build in basic
functionality to terminate the infinite loop correctly (uppon CTRL+C or kill signal), basic logging etc.

Intention is to have ability to easily run some code before (or after) reading the sensor, this is is skeleton that
doesnt do any logic and should be used only as a base for building the interactions with the sensors.

If you want to see example of implemented sensors, have a look at my other `RPi repo <https://github.com/ricco386/RPi>`_.

If you find a security vulnerability please read through
`SECURITY.rst <https://github.com/ricco386/RPi.Sensor/blob/master/SECURITY.rst>`_ file and report it responsibly. All
other issues and feature requests report via `Github issue tracker <https://github.com/ricco386/RPi.Sensor/issues>`_.

License
-------

For more information see the `LICENSE <https://github.com/ricco386/RPi.Sensor/blob/master/LICENSE>`_ file.
pyaig 1.0.13
A simple Python AIG package
License: MIT

# PyAIG: A simpe Python AIG and Truth Table package

## AIG

And-Inverter Graph ([AIG](https://en.wikipedia.org/wiki/And-inverter_graph)) is a data structure for logic synthesis and verification. The code follows the [AIGER](http://fmv.jku.at/aiger/) conventions.

## Installation

Install using `pip`:

```shell
pip install .
```

## Truth Tables example

### Import the package

```python
from pyaig import *
```

### Create the truth table manger - the max number of variables is required

``` pyhton
m = truth_tables(6, "ABCDEF")
```

If the second parameter to `truth_tables` is provided, it automatically inserts the sequence of names into the global namespace

### Build truth tables with operator overloading

```python
f = A.ite(B, C ^ D) & E | F
```

The truth table support `|`, `&`, `^`, and `~` for OR, AND, XOR, INVERT, respectively. It also supports `ite` (if-then-else), `iff` (if-and-only-if, or EXOR) and `implies` (logical implication). 

### Output the truth table

```python
print(f)
```

Will print the truth as a prime-irredudant cover, in this case:

```python
A&B&E + ~A&C&~D&E + ~A&~C&D&E + F
```

Or,

```python
print(f.SOP())
```

Resulting in 

```
-----1 1
0-011- 1
0-101- 1
11--1- 1
```

Or 

```python
print(f.isop())
```

Resulting in 

```
[{1, 2, 5}, {3, -4, 5, -1}, {-3, 4, 5, -1}, {6}]
```

All three are the same cover. The first is a human-readable expression. The second is similar to Espresso and BLIF formats, and the third is the list of cubes where negative means negation and the nubmer is the variable number starting from 0.

### Manipulate truth tables

In addition to the above, it supports permuting and negating inputs and the output, generating the list of all NPN-equivalent functions and a few other operations.