semvec/pypi-packages huggingface dataset:
utilitybox 0.0.0.2a0
Utility Box - A collection of useful Python utilities.
License: MIT
Keywords: utilities,tools,python,utilitybox

# UtilityBox

UtilityBox is a collection of useful tools and utilities for Python.

![Version](https://img.shields.io/badge/version-0.0.0.2--alpha-blue)
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)

## Features

- Generation of random number lists.
- Sorting algorithms like Bubble Sort and Selection Sort.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install utilitybox.

```bash
pip install utilitybox
```
## Basic Usage
```python
from utilitybox import generals
from utilitybox import ordering

# Example of generating a random number list
numbers = generals.random_number_list(10)

# Example of sorting using Bubble Sort
sorted_numbers = ordering.bubble_sort(numbers)
```

## Development
Developed by **Jose Angel Colin Najera**.


## License
This project is licensed under the MIT License
better-fastapi-discord 0.2.5
Discord OAuth FastAPI extension for APIs
License: MIT
Requires Python: >=3.5

[![PyPI version](https://badge.fury.io/py/fastapi-discord.svg)](https://badge.fury.io/py/fastapi-discord)
[![PyPI Downloads](https://img.shields.io/pypi/dm/fastapi-discord.svg)](https://pypi.org/project/fastapi-discord)

# FastAPI Discord (OAuth)
Support for "Login with Discord"/ Discord OAuth for FastAPI.
# Install
PIP Package `fastapi-discord`
# Example
You can find the Example in `expamples/`
```py
from typing import List

from fastapi import Depends, FastAPI
from fastapi.responses import JSONResponse
from fastapi_discord import DiscordOAuthClient, RateLimited, Unauthorized, User
from fastapi_discord.exceptions import ClientSessionNotInitialized
from fastapi_discord.models import GuildPreview

app = FastAPI()

discord = DiscordOAuthClient(
    "<client-id>", "<client-secret>", "<redirect-url>", ("identify", "guilds", "email")
)  # scopes


@app.on_event("startup")
async def on_startup():
    await discord.init()


@app.get("/login")
async def login():
    return {"url": discord.oauth_login_url}


@app.get("/callback")
async def callback(code: str):
    token, refresh_token = await discord.get_access_token(code)
    return {"access_token": token, "refresh_token": refresh_token}


@app.get(
    "/authenticated",
    dependencies=[Depends(discord.requires_authorization)],
    response_model=bool,
)
async def isAuthenticated(token: str = Depends(discord.get_token)):
    try:
        auth = await discord.isAuthenticated(token)
        return auth
    except Unauthorized:
        return False


@app.exception_handler(Unauthorized)
async def unauthorized_error_handler(_, __):
    return JSONResponse({"error": "Unauthorized"}, status_code=401)


@app.exception_handler(RateLimited)
async def rate_limit_error_handler(_, e: RateLimited):
    return JSONResponse(
        {"error": "RateLimited", "retry": e.retry_after, "message": e.message},
        status_code=429,
    )


@app.exception_handler(ClientSessionNotInitialized)
async def client_session_error_handler(_, e: ClientSessionNotInitialized):
    print(e)
    return JSONResponse({"error": "Internal Error"}, status_code=500)


@app.get("/user", dependencies=[Depends(discord.requires_authorization)], response_model=User)
async def get_user(user: User = Depends(discord.user)):
    return user


@app.get(
    "/guilds",
    dependencies=[Depends(discord.requires_authorization)],
    response_model=List[GuildPreview],
)
async def get_guilds(guilds: List = Depends(discord.guilds)):
    return guilds

```

# Inspired by
[Starlette-Discord](https://github.com/nwunderly/starlette-discord)

[Quart-Discord-OAuth](https://github.com/Tert0/Quart-Discord-OAuth/)

[Quart-Discord](https://github.com/jnawk/quart-discord)

Thanks to @jnawk and @nwunderly
geotran 0.1.5
Python Geospatial Library
License: MIT
Requires Python: >=3.6

The Python Geospatial Library, Geotran, is a comprehensive toolkit for geospatial data preprocessing, analysis, and modeling. It provides a variety of functions for transforming and manipulating geospatial data, including data normalization, resampling, filtering, and feature selection. It also offers a range of analytical techniques, such as spatial clustering, classification, and regression, as well as machine learning algorithms for predictive modeling.    

Geotran is designed to work with a variety of geospatial data formats, including shapefiles, GeoJSON, and raster data. It also supports integration with popular geospatial tools and platforms, such as QGIS, GDAL, and ArcGIS.     

Geotran is widely used in the geospatial industry, research, and open-source communities for developing geospatial applications, performing spatial analysis, and modeling complex geospatial phenomena.        

Example:     

```
from geotran import raster
from matplotlib import pyplot


fig, (axr, axg, axb) = pyplot.subplots(1,3, figsize=(21,7))

raster.plot('T60GVV.tif',bands=[3],ax=axr, title="Red", cmap='Reds')
raster.plot('T60GVV.tif',bands=[2],ax=axg, title="Green", cmap="Greens")
raster.plot('T60GVV.tif',bands=[1],ax=axb, title="Blue", cmap="Blues")
![Alt text](image.png)

input_raster_files = ['blue.tif', 'green.tif',
                      'red.tif', 'red-edge.tif', 'nir.tif']
output_raster_file = datetime.now().strftime("%d%m%Y%H%M%S") + "_stacked.tif"

stacked_file = stack_rasters(input_raster_files, output_raster_file, band_names=[
                             'blue', 'green', 'red', 'rededge', 'nir'])

clip_raster_by_shp(raster_file, shapefile, output_file, epsg_code=2193)

(more)
CheeseType 0.0.3
存放了一些常用自定义类型的库。
License: MIT
Requires Python: >=3.11
Keywords: type

# **CheeseType**

一个仅是为了方便调用，而自定义了许多常用类型的库。

## **介绍**

该库的类型分为2类：

1. 你可以使用`type()`或`isinstance(value, type)`获取它们确切的类，而不会获取到类似于`int`、`float`这样的基类。它们和`int(value)`、`float(value)`，无法转换时会抛出`ValueError`。

2. 继承于`Enum`的类型。

## **安装**

```bash
pip install CheeseType
```

## **使用**

```python
from CheeseType import Bool, PositiveInt, System

Bool('False') # False
PositiveInt('123') # 123
System('WINDOWS') # System.WINDOWS
```

## **函数**

由于目前内容较少，暂时先存放在本处。

### **`from CheeseType import *`**

- **`class Bool`**

    该方法返回的类型永远是`bool`而不是`Bool`。

    该方法会将`True`、`'True'`、`'TRUE'`和`'true'`视作`True`，将`False`、`'False'`、`'FALSE'`和`'false'`视作`False`。

- **`class PositiveInt(int)`**

    大于0的整数。

- **`class NonNegativeInt(int)`**

    大于等于0的整数。

- **`class NegativeInt(int)`**

    小于0的整数。

- **`class NonPositiveInt(int)`**

    小于等于0的整数。

- **`class PositiveFloat(float)`**

    大于0的浮点数。

- **`class NonNegativeFloat(float)`**

    大于等于0的浮点数。

- **`class NegativeFloat(float)`**

    小于0的浮点数。

- **`class NonPositiveFloat(float)`**

    小于等于0的浮点数。

- **`class System(Enum)`**

    - **`WINDOWS = 'WINDOWS'`**

    - **`MACOS = 'MACOS'`**

    - **`LINUX = 'LINUX`**

    - **`OTHER = 'OTHER'`**

### **`from CheeseType.network import *`**

- **`class Port(NonNegativeInt)`**

    端口号。

- **`class IPv4(str)`**

- **`class IPv6(str)`**

- **`class IP(str)`**
jestspectation 1.2.1
Pattern matching tools to test complex data structures
License: MIT
Requires Python: >=3.9,<4.0
Keywords: jest,pattern,matching,pytest,equality

# Jestspectation

Pattern matching tools to test complex data structures.

The design is inspired by the `expect` system from JavaScript's Jest testing
framework.

```py
import jestspectation as expect

assert {
    "a": 1,
    "b": 2,
    "c": 3.0,
} == {
    "a": 1,
    "b": expect.Any(int),
    "c": expect.FloatApprox(2.5, magnitude=0.5)
}
```

## Installation

```sh
pip install jestspectation
```

## Usage with Pytest

The library can be used as a pytest plugin, which can give access to much more
detailed error messages when assertions fail.

This should result in output similar to the following

```txt
    def test_goodbye():
>       assert 1 == expect.Any(float)
E       assert Type mismatch
E         Expected any object of type float
E         Received 1 (int)
```

These advanced completions can also be used for most standard Python objects
by wrapping the expected values in an `Equals`. For example:

```txt
    def test_lists():
>       assert expect.Equals([1, 2, 3, 4]) == [1, 2, 3, 5, 6]
E       assert [1, 2, 3, 4] == [1, 2, 3, 5, 6]
E         !! [3] 4 == 5
E            Value mismatch
E            Expected 4
E            Received 5
E         ++ [4] 6
```

To automatically use Jestspectation's diff parsing, you can configure
Jestspectation.

```py
import jestspectation

jestspectation.configure().pytest_all_diffs = True
```