semvec/pypi-packages huggingface dataset:
threadedreturn 1.0.1
Use threads with return values
Keywords: threads,threading,concurrency


    # threadedreturn

    `threadedreturn` is a Python package that provides a simple extension to the built-in `Thread` class in the `threading` module. The `ThreadWithReturnValue` class in this package allows you to create threads with return values.

    ## Installation

    You can install `threadedreturn` using `pip`:

    ```bash
    pip install threadedreturn
    ```

    ## Usage

    ### ThreadWithReturnValue

    `ThreadWithReturnValue` is a subclass of `Thread` that enables you to retrieve the return value of a function or method running in a separate thread.

    #### Example

    ```python
    from threadedreturn import ThreadWithReturnValue

    # Define a function to be executed in a separate thread
    def my_function(arg1, arg2):
        # Some time-consuming task
        result = arg1 + arg2
        return result

    # Create a ThreadWithReturnValue instance
    thread = ThreadWithReturnValue(target=my_function, args=(3, 5))

    # Start the thread
    thread.start()

    # Wait for the thread to finish and retrieve the return value
    result = thread.join()

    print("Result:", result)
    ```

    ## Contributing

    If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the [GitHub repository](https://github.com/DWAA1660/threadedreturn).
pyfbsdspi-tspspi 0.0.1
spigen device ioctl wrapper for FreeBSD
Requires Python: >=3.6

# FreeBSD SPI wrapper for Python

The ```pyfbsdspi-tspspi``` project contains a very thin wrapper
around the ```ioctl``` requests for the ```spigen``` device
on FreeBSD to test various hardware devices from Python. It allows
direct access to the SPI bus on devices like the RaspberryPi when running
under FreeBSD.

## Installation

```
pip install pyfbsdspi-tspspi
```

## Usage

The bus can be instantiated either using context management or by it's
constructor. One can select the bus via it's first constructor
argument (```spiDevname```):

```
from fbsdspi import FbsdSPI
from labdevs.spibus import SPIClockPolarity, SPIClockPhase
```

To instantiate via context management one can use:

```
with FbsdSPI() as spi:
    # Use spi. ....
```

To instantiate without context mangement:

```
spi = FbsdSPI()

# Use spi ...
```

In case one wants to open a different bus device - for example ```spigen0.1```
which would be the second SPI bus on a RaspberryPi one can simply specify the
name as first argument (```spiDevname```)

```
with FbsdSPI('/dev/spigen0.1') as spi1:
    # spi1. ...
```

Or without context management:

```
spi0 = FbsdSPI('/dev/spigen0.0')
spi1 = FbsdSPI('/dev/spigen0.1')
```

### Setting and querying bus clock speed

To query the bus speed one can use the ```getClockSpeed()``` method. This yields
the SPI clock frequency in Hz:

```
print(f"Current clock speed is {spi.getClockSpeed()} Hz")
```

To set the clock the counterpart ```setClockSpeed``` can be used. Again note that
this requires an integer argument in Hz:

```
spi.setClockSpeed(100000)
```

### Setting and getting the bus mode

As for any SPI abstraction library one can also set the four possible bus modes:

* Clock polarity can be either ```IDLE_HIGH``` or ```IDLE_LOW```
* Clock phase can be either ```TRAILING_EDGE``` or ```LEADING_EDGE```

```
spi.setMode(
    clockPolarity = SPIClockPolarity.IDLE_HIGH,
    clockPhase = SPIClockPhase.TRAILING_EDGE
)
```

To query the current mode one can use the `` getMode``  API:

```
print(f"Current mode: {spi.getMode()}")
# Return the tuple (SPIClockPhase, SPIClockPolarity)
```
mime-common 0.2.8
Some reusable libraries for properties, logging, console
Requires Python: >=3.8

# Mime Common

An package containing misc helper libraries for projects

* console - contains Console class for terminal output including som coler support
* logg - A logging wrapper that do some standardisation
* properties - A wrapper for properties that support reading different value types like logglevel, integer, string and boolean

## Installation

Run the following to install:

```python
pip install mime-common
```

## Usage

```python
from console import Console

cons = Console(use_colors=True)

cons.green("Hello World")
```

# Developing Mime Common

To install Mime Common, along with the tools you need to develop and run tests, run the following in your virtualenv:

```bash
$ pip install -e .[dev]
```