semvec/pypi-packages huggingface dataset:
pytmi 1.0.0
TMI (Twitch Messaging Interface) library for Python.
Requires Python: >= 3.7

# pytmi

[![package_version](https://img.shields.io/pypi/v/pytmi)](https://pypi.org/project/pytmi/)
[![license](https://img.shields.io/pypi/l/pytmi)](https://choosealicense.com/licenses/mit/#)
[![python_version](https://img.shields.io/pypi/pyversions/pytmi)](https://www.python.org/)
[![wheel](https://img.shields.io/pypi/wheel/pytmi)](https://pypi.org/project/pytmi/)

TMI (Twitch Messaging Interface) library for Python.

You can get your OAuth token with the site `https://twitchapps.com/tmi/`.

## Example

Here's a little application that logs in the user using OAuth, joins the Twitch channel requested by the user, sends the message `Hello, Twitch!` to the chat and then leaves the channel.

```python
import asyncio
import pytmi

async def main() -> None:
    nick = input("Insert your Twitch nickname: ").strip()
    token = input("Insert your Twitch OAuth token: ").strip()
    channel = input("Insert the channel to join: ").strip()

    async with pytmi.Client() as client:
        await client.login_oauth(token, nick, channel)

        await client.join(channel)
        await client.send_message("Hello, Twitch!")

        await client.part(channel)
        await client.logout()

if __name__ == "__main__":
    try:
        loop = asyncio.new_event_loop()
        loop.run_until_complete(main())
    except:
        print("Something went wrong.")
```

You can find others usage example inside the [`test`](/test) directory.

## Known bugs

* Spurious errors when using SSL.

* Possible problems with pending tasks (if you don't cleanup them properly).

## Todos

* Handle connection and login error in a better way.

* Handle messages that are not correctly encoded in UTF8.

## Changelog

### v1.0.0

* Major version bump.

* Add a background task that collects messages in a buffer and sends pong as needed.

* Rewrite Client code.

* Change methods name (`part` -> `leave`, `privmsg` -> `send_message`).

* Add async context manager (`async with`) support for Client.

### v0.3.0

* Major library simplification and rewriting.

* Removed buggy background task.

* Add library logging.

### v0.2.3

* Add background task to collect messages (removed in `v0.3.0`).

* Refactor code.

### v0.2.2

* Add message buffer abstraction.

* Major code refactoring.

### v0.2.1

* Minor code refactoring.

### v0.2.0

* Rewrite library to be asynchronous.

* Add SSL support (enabled by default).

* Reorganize project structure.

### v0.1.1

* Minor code refactoring.

* Improve message handling and parsing.

### v0.1.0

* Initial version.
bitorch-engine 0.1.0
A package for building and training quantized and binary neural networks with Pytorch
Requires Python: >=3.7

# Bitorch Engine

Readme will be extended soon.
This package contains layer to provide fast(er) layer implementations for [BITorch](https://github.com/hpi-xnor/bitorch).

## Installation

Currently, the supported installation method is using pip:

- Without any special cuda requirements (to hide the build output remove `-v`):
```bash
pip install -e . -v
```
- With higher CUDA versions you may need to install a torch pre-release and/or add an extra index URL:
```bash
pip install --upgrade --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu113
```

For example, for Cuda 11.6.124 `torch==1.12.0.dev20220324+cu113` should work.

## Cuda Device Selection

To select a certain CUDA device, set the environment variable `BIE_DEVICE`, e.g.:
```bash
export BIE_DEVICE=1  # use 2nd cuda device
```

## Development

If building fails, adapt the options in
[cpp_extension.py](bitorch_engine/utils/cpp_extension.py)/
[cuda_extension.py](bitorch_engine/utils/cuda_extension.py).

While developing, a specific cpp/cuda extension can be (re-)build, by using the environment variable `BIE_BUILD_ONLY`,
like so:
```bash
BIE_BUILD_ONLY="bitorch_engine/layers/qconv/binary/cpp" pip install -e . -v
```
It needs to a relative path to one extension directory.

To build for a different CUDA Arch, use the environment variable `BIE_CUDA_ARCH` (e.g. use 'sm_75', 'sm_80', 'sm_86'):
```bash
BIE_CUDA_ARCH="sm_86" pip install -e . -v
```

### MacOS

You should install OpenMP (`brew install libomp`) with homebrew and make sure to add the corresponding environment variables:

```bash
export LIBRARY_PATH=$LIBRARY_PATH:"$(brew --prefix)/lib"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$(brew --prefix)/lib"
export CPATH=$CPATH:"$(brew --prefix)/include"
# during libomp installation it should something like this:
export LDFLAGS="-L$(brew --prefix)/opt/libomp/lib"
export CPPFLAGS="-I$(brew --prefix)/opt/libomp/include"
```