semvec/pypi-packages huggingface dataset:
pesapal-py 0.1.3
A minimalist python library that integrates with PesaPal's API 3.0 - JSON APIs (https://developer.pesapal.com/how-to-integrate/e-commerce/api-30-json/api-reference)

# pesapal-py
A minimalist python library that integrates with PesaPal's API 3.0 - JSON APIs (https://developer.pesapal.com/how-to-integrate/e-commerce/api-30-json/api-reference).

This library abstracts PesaPals API 3.0 into four main methods, `authenticate`, `register_ipn`, `transact` and `get_transaction_status`

## Getting started

### Register as a merchant
1. Register as a PesaPal merchant at https://www.pesapal.com/
2. On successfull registration, you will receive a consumer key and consumer secret via email - keep these safe as they are your API credentials

### Install pesapal-py
```
pip install pesapal-py
```

### Authenticating
```
from pesapal_py.payments import PesaPal

pesapal = PesaPal("test_consumer_key", "test_consumer_secret")
auth = pesapal.authenticate()
print(auth)
```
This step returns a bearer token that is used with all the other methods below. The token expires after every 5 minutes. To prevent calling this method every time you need to transact, I recommend that you store it in an in-memory data store (e.g. redis) and expire it before 5 minutes.

### Register IPN
```
register_ipn = pesapal.register_ipn("sample_token", "https://www.sample-url.com/ipn")
print(register_ipn)
```

### Transact
```
transact = pesapal.transact(
    token="sample_token",
    description="sample_description",
    transaction_id="sample_transaction_id",
    amount=1000,
    callback_url="https://www.callback-url.com/status",
    ipn_id="sample_ipn_id",
    email_address="sample@email-address.com",
    phone_number="254722001122",
    country_code="KE",
    first_name="first",
    last_name="last",
    currency="KES",
)
print(transact)
```

### Validate Transaction
```
transaction_status = pesapal.get_transaction_status(
    token="sample_token", order_tracking_id="sample_order_tracking_id"
)
print(transaction_status)
```
channel2pdf 0.0.28
Export Telegram Channel to PDF
Requires Python: >=3.0

# channel2pdf

Export Telegram Channel to PDF

## usage

```
import channel2pdf
channel2pdf.gen(CHANNEL_USERNAME)
```

## how to install

`sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin` 
`pip3 install channel2pdf`
image-tiller 0.1.2.1
('image_tiller is a Python library for tiling and retiling images. It can be used for splitting large images into smaller tiles for other applications like Training Deep Learning models, inference on large images, etc.',)

# Image Tiler

Image Tiler is a Python package that allows you to split an image into tiles based on a grid and overlap between tiles. It also provides functionality to combine the tiles back into the original image.

## Installation

You can install Image Tiler using pip:

```shell
pip install image-tiller
```

## Usage
### SplitImage Class
The `SplitImage` class is used to split an image into tiles based on a grid and overlap between tiles. The class takes in an image path, the number of rows and columns in the grid, and the overlap between tiles.

#### CombineTiles Class
The `CombineTiles` class is used to combine tiles back into the original image. The class takes in a list of tiles, the number of rows and columns in the grid, and the overlap between tiles.

#### Example
```python
from ImgTiler import SplitImage, CombineTiles
import cv2

img = cv2.imread('image.jpg')
grid = (3, 4) #3 rows, 4 columns
overlap = 30 #30 pixels
show_rects = True
show_image = True

splitter = SplitImage(img, grid, overlap) # Create SplitImage object
tiles = splitter.split_image(show_rect=show_rect, show_tiles=show_image) # Split image into tiles

combiner = CombineTiles(tiles, grid, overlap) # Create CombineTiles object
img2 = combiner.combine_tiles(show_image=show_image) # Combine tiles into original image
```
#### Original Image
![Orignal Image](images/img.jpg)

#### Split Result
![Split Image without Rectangle](images/split_wo_rect.jpg)
![Split Image with Rectangle](images/split_w_rect.jpg)

#### Combined Image
![Combined Image without rectangle](images/recon_wo_rect.jpg)
![Combined Image with rectangle](images/recon_w_rect.jpg)

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## License
This project is licensed under the [MIT](https://choosealicense.com/licenses/mit/) license.
apoli-python-extension 0.0.1
A python package that can create Datapacks and Resourcepacks using Apoli powers.

Apoli Python Extension is a python package that allows you to create Datapacks and Resourcepacks using Apoli Powers.

# How to generate the classes:
```py
from apoli_python_extension.wiki import update_wiki

update_wiki()
```

# Datapack Example:
```py
"""
Demo of Apoli Python Package

This is a Demo of my Apoli Python Package to see how long it would take to create a relatively large apoli power.

This Power will be a power that applies 3 random status effects whenever you recieve any status effect.
"""

status_effects = [
    "speed", "slowness", "haste", "mining_fatigue",
    "strength", "instant_health", "instant_damage",
    "jump_boost", "nausea", "regeneration",
    "resistance", "fire_resistance", "water_breathing",
    "invisibility", "blindness", "night_vision", "hunger",
    "weakness", "poison", "wither", "health_boost", "absorption",
    "saturation", "glowing", "levitation", "luck", "unluck",
    "slow_falling", "conduit_power", "dolphins_grace",
    "bad_omen", "hero_of_the_village", "darkness",
]

datapack = Datapack(name="Test Demo DataPack", namespace="test_demo")

effect_actions = []

for effect in status_effects:
    effect_actions.append({
        "element": ApplyEffectEntityAction(effect="minecraft:" + effect),
        "weight": 10
    })

effect_action = ChoiceAction(actions=effect_actions)

has_effect = NbtEntityCondition(nbt="{ActiveEffects:[{Ambient:0b}]}")

three_effects = AndAction(actions=[effect_action,effect_action,effect_action])

rising_power = ActionOverTimePower(rising_action=three_effects, condition=has_effect, name="Easily Effected", description="Whenever you gain a potion effect, you gain some random extras")

datapack.add_power(power=rising_power, name="random_effect")

datapack.save()
```
example-package-zhaohany 0.0.2
A small example package
Requires Python: >=3.7

# Python Library Packaging and Distribution Project

This is a sample project that demonstrates how to create a Python library and publish it to the Python Package Index (PyPI). The project is designed to provide a clear example of the steps involved in packaging and distributing a Python library.

## Reference Documentation

For detailed information on packaging and distributing Python projects, you can refer to the [Packaging Python Projects](https://packaging.python.org/en/latest/tutorials/packaging-projects/) tutorial on the official Python packaging website.

## Project Structure

Make sure your project follows this structure:

```
packaging_tutorial/
├── LICENSE
├── pyproject.toml
├── README.md
├── src/
│   └── example_package_YOUR_USERNAME_HERE/
│       ├── __init__.py
│       └── example.py
└── tests/
```

1. The `src` directory contains your project's source code, and you should have an `__init__.py` file inside the `project_name` folder to mark it as a Python package.
2. Include a `LICENSE` file to specify the licensing terms of your project.
3. Write your project's README in Markdown format in the `README.md` file.
4. Place your project's tests in the `tests` directory.
5. The `pyproject.toml` file contains the project metadata and configuration.

## Pyproject.toml Configuration

Here is an example of a `pyproject.toml` configuration for your project:

```toml
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "example_package_zhaohany"
version = "0.0.1"
authors = [
  { name = "Zhaohan Yan", email = "zhaohany@outlook.com" },
]
description = "A small example package"
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
    "Programming Language :: Python :: 3",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
]

[project.urls]
homepage = "https://github.com/zhaohany/example_package_zhaohany"
bug-tracker = "https://github.com/zhaohany/example_package_zhaohany"
```

## Building and Distributing

To build and distribute your package, follow these steps:

1. Install required tools:

```bash
sudo apt install python3-pip
pip3 install build
sudo apt install python3.10-venv
```

2. Build source distribution (sdist) and/or build distribution (wheel):

```bash
python3 -m build --sdist /path/to/your/project
python3 -m build --wheel /path/to/your/project
```

3. Install Twine for uploading:

```bash
sudo apt install twine
```

4. Upload your distribution files to PyPI:

```bash
twine upload dist/example_package_zhaohany-0.0.1.tar.gz dist/example_package_zhaohany-0.0.1-py3-none-any.whl
```

## API Token for PyPI Upload

If you encounter an API token issue during upload, create an API token on PyPI:

1. Username: `__token__`
2. Password: Your generated token

This is a basic outline of the steps required to create, package, and distribute a Python library to PyPI. For more details and troubleshooting, refer to the [Packaging Python Projects](https://packaging.python.org/en/latest/tutorials/packaging-projects/) tutorial on the official Python packaging website.