semvec/pypi-packages huggingface dataset:
streamx 0.0.5
The simple solution for sharing async data streams in Python.
Requires Python: >=3.7

# streamx

![PyPI](https://img.shields.io/pypi/v/streamx?style=for-the-badge) ![PyPI - License](https://img.shields.io/pypi/l/streamx?style=for-the-badge)

The simple solution for sharing async data streams in Python.

## Installation

```bash
pip install streamx
```

## Usage

### Creating a stream

```python
from streamx import AsyncStream

stream = AsyncStream[int]()
```

### Putting items in a stream

You can place items in a stream using the put method. This method is a coroutine, so you'll need to await it. All iterators receive each item placed in the stream.

```python
await stream.put(1)
await stream.put(2)
await stream.put(3)
```

### Consuming a stream

To consume a stream, you can use an async for loop. Many tasks can listen to the stream at the same time, and each task will receive each item put in the stream while it is iterating.

```python
async for item in stream:
    print(item)
```

### Closing a Stream

Once you're done placing data into a stream, you should close it to signal to iterators that there will be no more data. This signals to exit the async for loop.

```python
await stream.close()
```

### Example

```python
import asyncio

from streamx import AsyncStream


async def producer(stream: AsyncStream[int]):
    async with stream:
        for i in range(5):
            await stream.put(i)
            await asyncio.sleep(1)


async def consumer(stream: AsyncStream[int]):
    async for item in stream:
        print(item)


async def main():
    stream = AsyncStream[int]()
    await asyncio.gather(consumer(stream), consumer(stream), producer(stream))


asyncio.run(main())
```
google-image-source-search 1.2.2
A package to search image sources using google services
Requires Python: >=3.7

# Google Reverse Image Search
[![PyPI version](https://badge.fury.io/py/google-image-source-search.svg??)](https://badge.fury.io/py/google-image-source-search)

An unofficial simple solution to search web pages using the specified image. Written on pure requests

![Google lens](https://raw.githubusercontent.com/Vorrik/Google-Image-Source-Search/master/examples/google_lens0.png)

## Installation
```sh
> pip install google-image-source-search
```

## Usage
```py
from google_img_source_search import ReverseImageSearcher


if __name__ == '__main__':
    image_url = 'https://i.pinimg.com/originals/c4/50/35/c450352ac6ea8645ead206721673e8fb.png'

    rev_img_searcher = ReverseImageSearcher()
    res = rev_img_searcher.search(image_url)

    for search_item in res:
        print(f'Title: {search_item.page_title}')
        print(f'Site: {search_item.page_url}')
        print(f'Img: {search_item.image_url}\n')
```
#### Searching by file
```py
rev_img_searcher.search_by_file('test.png')
```
#### Switching safe mode
```py
from google_img_source_search import SafeMode
rev_img_searcher.switch_safe_mode(SafeMode.DISABLED)
```
#### Passing custom session
```py
import requests
session = requests.Session()
rev_img_searcher = ReverseImageSearcher(session)
```

### Results
#### Output:
```
Title: WAIFU OR LAIFU? - YouTube
Site: https://www.youtube.com/watch?v=F8l5OgLpuyM
Img: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSKg0oMfWeMyBo0-KRerecMaRXNLI2zTLqmyXc0TgDS7nWJx3aB

Title: Печальный факт о Эмилии из аниме "Re:Zero. Жизнь с нуля в альтернативном мире" | AniGAM | Дзен
Site: https://dzen.ru/a/ZBs3vFvEYSvIxPhv
Img: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTA-RDMY-xUrV5Qqn5fYjJ9qFsZC2Posk16qHkWh4sdnVP5Leh7

Title: Stream chocho music | Listen to songs, albums, playlists for free on SoundCloud
Site: https://soundcloud.com/chocho-329200480
Img: https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQycLi6Ug9JtqKp5t6irb-3Pbj26DtTT48P-R38lOqVI5pXCwYz
```
#### Google lens:
![Google lens](https://raw.githubusercontent.com/Vorrik/Google-Image-Source-Search/master/examples/google_lens.png)