semvec/pypi-packages huggingface dataset:
wxhandler 0.1.1.5.1
A Python package for handling wxHandler operations.
Requires Python: >=3.10

# wxhandler

A Python package for handling wxHandler operations. 
- wxhandler will be use on wechat-3.9.2.23. 
- wxhandler1 will be use on wechat-3.9.8.25.
My github: https://github.com/bifu123/wxhandler

## Installation

```bash
pip install wxhandler
```
## Usage
```python
from wxhandler import wxHandler1

# create wxHandler1 object
handler = wxHandler1(base_url="http://127.0.0.1:19088") 
# send text message
wxid = "cbf_415135222"
message = "hello"
handler.sendTextMsg(wxid, message)
```
hashtag-utils 0.5.6
Simple LLM-powered hashtag utilities.

# Hashtag Utilities 🏷️

An LLM-powered multi-purpose hashtag utilities library written in Python. 

![Hashtag Utilities Hero](https://raw.githubusercontent.com/AdiPat/hashtag_utils/main/images/hero.png)

Hashtags are used on almost every content platform today. This makes it a vital tool for creating & analyzing content. 
This utilities library makes it easy to do things with hashtags. Ideally, this module is intended to be used within a larger system where more specific problems are solved. 

**Feel free to suggest features, ideas and improvements! If you want to contribute, feel free to fork and send a Pull Request. I'm actively working on this project.**

# Features 
- **Hashtag Generator:** Generates hashtags for a content piece.
- **Hashtag Relevance:** Returns the percentage relevance of a hashtag with respect to a content piece.
- **Similar Hashtags:** Generates hash tages similar to the provided ones.
- **Hashtag Distance:** Computes how close two hashtags are.
- **Hashtag Definitions**: Get hashtag definitions. 


# Usage: HashtagUtils API

Make sure you add your `OPENAI_API_KEY` to a .env file from the location where you're running the script. 

```python
from hashtag_utils import HashtagUtils

hg = HashtagUtils()

text = "A new study shows that eating chocolate can help you lose weight."

hashtags = hg.get_hashtags(text)

# check other methods below

```

## Methods

### `get_hashtags(text: str, temperature: float = 1.0, num_tags: int = 5) -> List[str]`

Generates a list of hashtags based on the given text. 

- `text`: The input text to generate hashtags from.
- `temperature`: Controls the randomness of the hashtag generation. Lower values make the output more deterministic. Default is 1.0.
- `num_tags`: The number of hashtags to generate. Default is 5.

### `get_similar_hashtags(hashtags: List[str], temperature: float = 1.0, num_tags: int = 5) -> List[str]`

Generates a list of hashtags that are similar to the given hashtags.

- `hashtags`: The input hashtags to find similar hashtags for.
- `temperature`: Controls the randomness of the hashtag generation. Lower values make the output more deterministic. Default is 1.0.
- `num_tags`: The number of hashtags to generate. Default is 5.

### `get_hashtag_definition(hashtag: str) -> str`

Returns the definition of the given hashtag.

- `hashtag`: The hashtag to get the definition for.

### `get_hashtags_relevance(hashtags: List[str], text: str) -> Dict[str, float]`

Returns a dictionary mapping each hashtag to its relevance to the given text.

- `hashtags`: The hashtags to check the relevance of.
- `text`: The text to check the relevance against.

### `get_hashtag_distance(hashtag1: str, hashtag2: str) -> float`

Returns the semantic distance between two hashtags.

- `hashtag1`: The first hashtag.
- `hashtag2`: The second hashtag.

## Run Examples
- Add `OPENAI_API_KEY` to the `.env` file.
- Run examples: `python example.py` 

# Contributors 
- [Aditya Patange (AdiPat)](https://wwww.github.com/AdiPat)
pasync 0.3.1
An event loop for python async
Requires Python: <4.0,>=3.10

# pasync - A simple event loop for async python

This minimal package is mainly used to explore implementing an async runtime in Python.

## Usage

### Runner

The main construct that you'll often work with is `Runner`.

A runner is actually a wrapper around an event loop.

It comes with two flavors: non-blocking runner and blocking runner.

* A blocking runner will run all the tasks till end, blocking the main thread.
  When given a set of tasks, it will refuse to accept any task in the meaning time.
* A non-blocking runner will run all the tasks in another thread.
  Unlike a blocking runenr, it can accepts additional tasks in the meaning time.

By default, a runner is blocking.

* Blocking runner
  ```py
  async def gen_num(n):
    return n
  
  with Runner() as runner:
    assert runner.run(gen_num(1)) == 1
    assert runner.gather(gen_num(1), gen_num(2)) == [1, 2]
  ```

* Non-blocking runner
  ```py
  async def gen_num(n):
    return n
  
  with Runner(non_blocking = True) as runner:
    assert runner.run(gen_num(1)) == None                  # Not support returning results yet
    assert runner.gather(gen_num(1), gen_num(2)) == None   # Not support returning results yet
  ```

## Pitfalls

1. Currently, non-blocking runner cannot return results of tasks yet.
   This can be worked around by making the top-level task return `None`, while all the subtasks's results are consumed inside the top-level task