semvec/pypi-packages huggingface dataset:
Better-PyUnit-Format 0.2.3
A more readable text output for Python's built in unittest framework
Requires Python: >=3.5

# Better PyUnit Format
#### A more readable text output for Python's built in unittest framework


### Overview

This package provides an implementation of a test runner and a test result for the Python unittest package.

This package simply creates an override of the built-in TextTestRunner that removes all the formatting that
it does by default and only runs the test suite. This means that this test runner passes all formatting
responsibility on to the test result. 

The test result that this package provides formats the output of the test in a much more readable way to make
interpreting unit test results a bit easier for introductory students.

This package is targeted towards students and education and was built with that limited use case in mind. 
With that said, please, feel free to use this in your applications and tell me what you think!

### Using Better PyUnit Format

1. Install the package via pip with `pip install Better-PyUnit-Format`
2. Import the `BetterPyUnitTestRunner`
3. Run your testsuite!


### Example code

```python
# run.py

import unittest
import test
from BetterPyUnitFormat import BetterPyUnitTestRunner

if __name__ == "__main__":
    testSuite = unittest.loader.makeSuite(test.Test)
    runner = BetterPyUnitTestRunner()
    runner.run(testSuite)

```

### Example Execution

```python
# test.py

import unittest


class Test(unittest.TestCase):
    def test_failure(self):
        """This test should fail"""
        self.assertEquals(1, 2)

    def test_success(self):
        """This test should pass"""
        self.assertEquals(1, 1)

    def test_error(self):
        """This test will error"""
        0/0

    @unittest.skip("Skipping this test :)")
    def test_skip(self):
        """This test will be skipped"""
        self.assertEquals(1, 2)
```
```text

====================
--------------------
[ RUN      ] This test will error (test.Test.test_error)
[    ERROR ] This test will error
A(n) ZeroDivisionError occurred:
[ZeroDivisionError] division by zero

-------------------- 

--------------------
[ RUN      ] This test should fail (test.Test.test_failure)
[     FAIL ] This test should fail
Failure reason:
1 != 2

-------------------- 

--------------------
[ RUN      ] This test will be skipped (test.Test.test_skip)
[     SKIP ] This test will be skipped
Skip Reason: Skipping this test :)
-------------------- 

--------------------
[ RUN      ] This test should pass (test.Test.test_success)
[       OK ] This test should pass
-------------------- 

====================
[  FAILED  ] 
1 tests passed.
1 tests failed.
1 tests errored.
1 tests skipped.
1 / 4
====================

```

### License
This package is licensed under the Unlicense. Feel free to use it for any purpose commercial or non-commercial.
python-timeout-request-himanshu007-creator 0.0.1
A simple package to add timeout to requests
Requires Python: >=3.7

# Timeout Decorator

A versatile timeout decorator for both synchronous and asynchronous functions in Python.

## Features

- Works with both synchronous and asynchronous functions
- Customizable timeout duration
- Optional callback function on timeout
- Support for custom exception on timeout
- Colored logging

## Installation

```bash
pip install timeout-decorator
```
## Parameters
`timeout`: The maximum execution time in seconds.
`callback (optional)`: A function to be called if the timeout occurs.
`custom_error (optional)`: A custom exception class to be raised on timeout.

## Usage
#### Basic Usage
```python
from timeout_decorator import timeout_decorator

@timeout_decorator(5)  # 5 seconds timeout
def my_function():
    # Your code here
    pass

@timeout_decorator(10)  # 10 seconds timeout
async def my_async_function():
    # Your async code here
    pass
```
### Advanced Usage
```python 
from timeout_decorator import timeout_decorator

def on_timeout(func_name, *args, **kwargs):
    print(f"Function {func_name} timed out!")

class MyTimeoutError(Exception):
    pass

@timeout_decorator(5, callback=on_timeout, custom_error=MyTimeoutError)
def my_function():
    # Your code here
    pass

# Usage with synchronous function
try:
    result = my_function()
except MyTimeoutError:
    print("Caught custom timeout error")

# Usage with asynchronous function
@timeout_decorator(5, callback=on_timeout, custom_error=MyTimeoutError)
async def my_async_function():
    # Your async code here
    pass

import asyncio

async def main():
    try:
        result = await my_async_function()
    except MyTimeoutError:
        print("Caught custom timeout error")

asyncio.run(main())
``` 
## Tests
 run 
 ```python 
    pytest tests/test_timeout_decorator.py -v
```


## Notes
For synchronous functions, the decorator uses a `ThreadPoolExecutor` to implement the timeout.

For asynchronous functions, it uses `asyncio.wait_for()`.

The decorator automatically detects whether the decorated function is synchronous or asynchronous.

## Licence
This project is licensed under the MIT License
python-timeout-request 0.1.0
A simple package to add timeout to requests
Requires Python: >=3.7

# Timeout Decorator

A versatile timeout decorator for both synchronous and asynchronous functions in Python.

## Features

- Works with both synchronous and asynchronous functions
- Customizable timeout duration
- Optional callback function on timeout
- Support for custom exception on timeout
- Colored logging

## Installation

```bash
pip install timeout-decorator
```
## Parameters
`timeout`: The maximum execution time in seconds.
`callback (optional)`: A function to be called if the timeout occurs.
`custom_error (optional)`: A custom exception class to be raised on timeout.

## Usage
#### Basic Usage
```python
from timeout_decorator import timeout_decorator

@timeout_decorator(5)  # 5 seconds timeout
def my_function():
    # Your code here
    pass

@timeout_decorator(10)  # 10 seconds timeout
async def my_async_function():
    # Your async code here
    pass
```
### Advanced Usage
```python 
from timeout_decorator import timeout_decorator

def on_timeout(func_name, *args, **kwargs):
    print(f"Function {func_name} timed out!")

class MyTimeoutError(Exception):
    pass

@timeout_decorator(5, callback=on_timeout, custom_error=MyTimeoutError)
def my_function():
    # Your code here
    pass

# Usage with synchronous function
try:
    result = my_function()
except MyTimeoutError:
    print("Caught custom timeout error")

# Usage with asynchronous function
@timeout_decorator(5, callback=on_timeout, custom_error=MyTimeoutError)
async def my_async_function():
    # Your async code here
    pass

import asyncio

async def main():
    try:
        result = await my_async_function()
    except MyTimeoutError:
        print("Caught custom timeout error")

asyncio.run(main())
``` 
## Tests
 run 
 ```python 
    pytest tests/test_timeout_decorator.py -v
```


## Notes
For synchronous functions, the decorator uses a `ThreadPoolExecutor` to implement the timeout.

For asynchronous functions, it uses `asyncio.wait_for()`.

The decorator automatically detects whether the decorated function is synchronous or asynchronous.

## Licence
This project is licensed under the MIT License
schoolware-api 1.13.5
A api for schoolware written in python
Requires Python: >=3.7


# Schoolware-api
An api for schoolware written in python

## Capabilities
* get agenda points
* get scores
* get todo items
* send telegram message for new scores
* support for microsoft and schoolware login

## Config
| Key | Description |
| --- | --- |
| domain | domain name of schoolware
| user | school microsoft email
| password | school microsoft password
| schoolware_login | set true if using schoolware login
| telegram_enabled | required to enable telegram
| telegram_bot_token | telegram bot token to enable telegram bot
| telegram_chat_id | id to send messages to
| verbose | show a some more info, when what function is run
| debug | show a lot more info, all networking info

## Install
* `pip3 install schoolware_api --upgrade `
* `playwright install &&  playwright install-deps` only for microsoft login 

## optional
* `pip3 install python-telegram-bot` needed for telegram

## Simple example

```python
from schoolware_api import schoolware

config = {"domain":"", "user":"", "password":""} #example domain: kov.schoolware.be user: name.lastname@leerling.kov.be password: password 

Schoolware = schoolware(config)

print(Schoolware.todo())  # Returns all todo items
print(Schoolware.punten()) # Returns all scores this schoolyear
print(Schoolware.agenda()) # Returns agenda points today
print(Schoolware.agenda(datum="2023-03-06 00:00:00")) # Returns agenda points for 2023-03-06
print(Schoolware.agenda_week()) # Returns whole week agenda points
```
pwebarc-dumb-dump-server 1.6.1
pwebarc-dumb-dump-server is now hoardy-web-sas

# pwebarc-dumb-dump-server is now hoardy-web-sas

This package has been renamed. Use `pip install hoardy-web-sas` instead.

New package: https://pypi.org/project/hoardy-web-sas/
nakdimon-ort 0.1.5
Hebrew diacritics in onnxruntime

# nakdimon-ort

[`nakdimon`](https://github.com/elazarg/nakdimon) diacritizer with onnxruntime

## Setup

```console
pip install nakdimon-ort
```

You also need [`nakdimon.onnx`](https://github.com/thewh1teagle/nakdimon-ort/releases/download/v0.1.0/nakdimon.onnx). Please see [examples](examples).

## Examples

See [examples](examples)

## Credits

Thanks for [elazarg](https://github.com/elazarg) for creating [nakdimon](https://github.com/elazarg/nakdimon) model!
proxytg 0.1.2
Package implements TelegramAccount class, which keeps your telegram session persistent with proxy
Requires Python: >=3.6

## proxytg
This package implements TelegramAccount class, which can be used for automating tasks on telegram
with proxy(uses https://mobileproxy.space api).
## Usage
```python
from proxytg.telegram import TelegramAccount

proxy_data = {
    "key": "proxy_key_from_mobile_proxy",
    "authorization": "mobile_proxy_api_authorization"
}
obj = TelegramAccount("account_name", proxy_data, "path_to_sessions_dir")

```
if object with given account_name already exist in sessions directory, then cookies and local storage would
be loaded(to keep telegram session persistent)
pyfile-runner 0.1.4
Simple Python library to help run multiple Python files and view their output while running
Requires Python: >=3.12

# Pyfile Runner

Simple Python library to help run multiple Python files and view their output while running.

This "library" contains both a runner, and a TUI which uses that runner to display the output nicely in a terminal.

## Example

```python

# Assuming you have some files you want to run in a directory named "tests"
if __name__ == '__main__':
    root = Path("tests")

    runner = PyfileRunner()
    runner.set_number_of_workers(4)  # Or remove this to use the available parallelism on your machine
    runner.add_directory(root)

    # Now you can either call `runner.run()` and use it for example in a CI where there is no interface needed.
    
    # Or you can wrap it in the TUI, to get nice output.
    ui = PyfileRunnerUI(runner=runner)
    ui.set_root(root)
    ui.run()
```

![screenshot](./.readme/screen.png)

#### Building and publishing

```
uvx --from build pyproject-build --installer uv
```

```
uvx twine upload dist/*
```
IdentificationOfClaims 0.1.1
Identifies Claims from Text
Requires Python: >=3.6


---
# Prompt Tuning for Claim Summarization

This Python package provides a tool to generate short summaries for content based on a set of zero-shot examples. The approach leverages prompt tuning to generate summaries of claims from input content using pre-existing models like  Gemini, without needing a fine-tuning phase.

## Approach

We utilize **prompt tuning** as the primary method for this project. Instead of fine-tuning the language model (which requires large datasets), we provide **prompts** by showing the model several examples of "Content" followed by the expected "Summary of Claims". This method is particularly useful when working with small datasets.

1. **Data**: The input data consists of "Content" (such as a conversation between a user and an agent) and "Reasons" (which are comma-separated summaries of the issues or claims).
   
2. **Zero-shot learning**: For each query, we randomly select a subset of examples (e.g., 7) from the dataset to use as reference examples. The prompt generator constructs a natural language prompt from these examples, asking the model to summarize the new content.

3. **Evaluation**: We evaluate the model's performance using:
   - **ROUGE Scores**: Measures the overlap between the generated summary and the actual summary (Reason).
   - **Cosine Similarity**: Measures the similarity between the TF-IDF vectors of the generated summary and the actual reason.

## How to Use

### Installation

1. Clone the repository or download the `.zip` file.
2. Ensure you have the required dependencies installed. You can install them using the following:
   ```bash
   pip3 install setuptools 
   ```

### Usage

This package exposes two main functions to the user:

#### 1. **Performance Evaluation** (`perfomance_on_data`)

This function evaluates the model's performance across the entire dataset by generating summaries and calculating ROUGE and Cosine Similarity metrics.

```python
from your_package_name import perfomance_on_data

# Evaluate the performance on the dataset
perfomance_on_data()
```

**Output**: 
- The function will print out the generated summaries, the actual summaries, ROUGE scores, and Cosine Similarity scores for each example.
- It will also print the average ROUGE and Cosine Similarity scores across all examples.

#### 2. **Generate Summary on Query** (`genrate_on_query`)

This function allows the user to input a query (i.e., new content) and receive a generated summary of claims based on the trained model.

```python
from your_package_name import genrate_on_query

# Generate summary for a user-provided query
genrate_on_query()
```



---

## Dependencies

- `transformers`: For utilizing pre-trained language models.
- `sklearn`: For cosine similarity and vectorization.
- `rouge`: For calculating ROUGE scores.


---

This package offers a lightweight and flexible way to generate summaries using zero-shot learning and can be integrated into any workflow requiring natural language summarization.