semvec/pypi-packages huggingface dataset:
stingle-photos-toolkit 0.2.1
A Python toolkit to interact with Stingle Photos database and data files
Requires Python: >=3.10

# stingle-photos-toolkit

A Python library to interact with [Stingle Photos](https://stingle.org/) database and data files. It supports connecting to the MySQL database, either live or a dump restore, and to the file system or a copy of it, either local or S3.

Please note that this library does not interact with the Stingle API, but directly with files and database, so it's suitable only for self-hosted setups.

## Project status

This is a work in progress: documentation is still missing. However, it works. You can refer to the example below, it should be pretty clear how to use it.

## Installing

The package is [published on PyPi](https://pypi.org/project/stingle-photos-toolkit/) so you can install it with your preferred package manager, for example:

```
pip install stingle-photos-toolkit
```

## Using

This is a fairly complete example of everything the library currently supports:

```python
from StinglePhotosToolkit import Client, DataFolderType

# Initialize the client
client = Client(
    mysql_host="localhost",
    mysql_database="stingle_api",
    mysql_username="user",
    mysql_password="mypassword",
    data_folder_type=DataFolderType.S3,  # If DataFolderType.Local you need to pass the data_folder_path argument instead of the next 4 ones
    data_folder_bucket="my-bucket",
    data_folder_region="eu-central-1",
    data_folder_access_key="MYACCESSKEY",
    data_folder_secret_key="mySecr3tKey",
    stingle_username="mymail@example.org",
    stingle_key_mnemonic="my key recovery mnemonic words",  # Instead, you can pass the stingle_password argument if you backed up the key to the server: the key will be retrieved and decrypted from the database
)

# Opens the MySQL connection and gets some data about the user (id, key if needed)
client.open()

# Get a list of albums available for the users (id and name are returned)
albums = client.get_albums()

# Get a list of files from the first album, get 3 of them
files = client.list_files(album_id=albums[0].id, limit=3)

# Get a list of files that are not in an album, skip the first 6 and get 3 of them
files = client.list_files(skip=6, limit=3)

for f in files:
    # Decrypt the file and save it with its original filename
    with open(f.header.file_name, "wb") as out:
        client.write_file(f, out)
    # Save the thumbnail to another file (thumbnails are all JPEG)
    with open(f"{f.header.file_name}_thumb.jpg", "wb") as out:
        client.write_thumbnail(f, out)
    # You can also get the file content as bytes
    file_data = client.get_file(f)
    thumbnail_data = client.get_thumbnail(f)

# Close the connection to MySQL
client.close()
```

## Building from source

You need to have `uv` installed to build the wheel:

```
uv build
```

Then, you can install the wheel in the virtualenv you prefer (no uv required) with something like:

```
pip install dist/*.whl
```

## License

This is released as GNU AFFERO GENERAL PUBLIC LICENSE, the same license of the Stingle API code.
geotifflib 0.0.8
A Python GeoTiff kit based on GDAL
Requires Python: >=3.9
Keywords: python, tiff, geotiff, windows, mac, linux

# geotifflib

基于GDAL，对GeoTiff文件进行读写等操作。
GeoTiffLib primarily offers a set of utility functions for reading, saving, and processing GeoTIFF image files.

## 安装

由于使用pip安装GDAL报错，因此安装此包之前需要**使用conda安装GDAL**：

```sh
conda install GDAL
```

安装GDAL完成之后再安装本包：

```sh
pip install geotifflib
```

## 使用

主要包含了读、写两类函数。

### read()

根据文件路径读取GeoTiff数据、地理变换和投影。

输入：

1. 文件路径（Path or str）

返回：

1. tiff的数据矩阵（np.array）：shape = [波段，宽，长]

### read_geo()

根据文件路径读取GeoTiff数据形状、地理变换和投影。

输入：

1. 文件路径（Path or str）

返回：

1. tiff的数据矩阵（np.array）：shape = [波段，宽，长]
2. geotransform: tuple
3. projection: str

### save()

保存GeoTiff数据、地理变换和投影。

输入：

1. 保存路径（Path or str）
2. tiff的数据矩阵（np.array）：shape = [波段，宽，长]
3. geotransform: tuple, tif file geotransform
4. projection: str, tif file projection
5. output dtype: gdal.GDT_Float32, tif file data type

### save_array()

保存GeoTiff数据。

输入：

1. 保存路径（Path or str）
2. tiff的数据矩阵（np.array）：shape = [波段，宽，长]
3. output dtype: gdal.GDT_Float32, tif file data type

### hsi_to_rgb()

将光谱数据转化到RGB（做了$\gamma$矫正和归一化）

输入：

1. 光谱数据（np.ndarray）:The hyperspectral image data, default shape is **[bands, width, height]**.
2. 红光波段索引（int）:The index of the red band.
3. 绿光波段索引（int）:The index of the green band.
4. 蓝光波段索引（int）:The index of the blue band.

返回：

1. The RGB image data, shape is **[width, height, 3(r, g, b)]**.

### merge()

合并多个GeoTiff

输入：

1. 输入的tif图像路径列表（list[Path, Path...]）
2. 输出的tif图像路径（Path）
setRegionGerbs 0.1.0
A module to download region flags (gerbs) based on ISO codes
Requires Python: >=3.6

# setRegionGerbs

A Python module for downloading region-specific flags (gerbs) from the Flag CDN and saving them to a local directory.

## Installation

To install this module, you can use `pip`:

### Using `pip`:

If you're not using Poetry, you can install the module from PyPI using `pip`:

```bash
pip install setRegionGerbs

Install from source:

If you want to install directly from source, clone the repository and run:

git clone https://github.com/Tato1999/setRegionGerbs.git
cd setRegionGerbs
python3 setup.py install


from setRegionGerbs import setRegionGerbs

# Create an instance of the setRegionGerbs class
gerbs = setRegionGerbs()

# Call the makeDir method to create the necessary directory and start the download process
gerbs.makeDir()

# The flags for the specified regions will be downloaded and saved in the 'gerb_folder' directory.


gerbs.regIso = ['us', 'de', 'fr']  # ISO country codes
gerbs.formatType = 'png'           # Format type for the flags (e.g., 'png', 'jpg')
gerbs.makeDir()                    # Start the process