semvec/pypi-packages huggingface dataset:
papersize 1.7.0
Paper size related tools
Requires Python: <4,>=3.12
Keywords: paper, size, standard

# papersize 📏 Paper size related tools

This module provides tools to manipulate paper sizes, that is:

- a dictionary of several named standard names (e.g. A4, letter) , with their respective sizes (width and height);
- functions to convert sizes from one unit (e.g. inches) to another (e.g. centimeters);
- functions to manipulate paper orientation (portrait or landscape);
- tools to parse paper sizes, so that you do not have to worry about the format of paper sizes provided by your user, it being `"a4"` or `"21cm x 29.7cm"`.

## What's new?

See [changelog](https://git.framasoft.org/spalax/papersize/blob/main/CHANGELOG.md>).

## Install

See the end of list for a (quick and dirty) Debian package.

* From sources:

  * Download: https://pypi.python.org/pypi/papersize
  * Install (in a `virtualenv`, if you do not want to mess with your distribution installation system):

        python3 -m pip install .

* From pip:

      pip install papersize

## Test

* Current python version:

      python3 -m unittest

* All supported python versions (using [tox](http://tox.testrun.org)):

      tox

## Documentation

The documentation is available on [readthedocs](http://papersize.readthedocs.io).  You can build it using:

    cd doc && make html
mindtrace-storage 0.8.0
Storage functionality for Mindtrace

[![PyPI version](https://img.shields.io/pypi/v/mindtrace-storage)](https://pypi.org/project/mindtrace-storage/)
[![License](https://img.shields.io/pypi/l/mindtrace-storage)](https://github.com/mindtrace/mindtrace/blob/main/mindtrace/storage/LICENSE)
[![Downloads](https://static.pepy.tech/badge/mindtrace-storage)](https://pepy.tech/projects/mindtrace-storage)

# Storage Module

This directory contains the storage-related components for the Mindtrace project. It provides abstractions and implementations for interacting with various storage backends, such as Google Cloud Storage (GCS).

## Structure

- `mindtrace/storage` — Contains the core storage handler implementations and interfaces.
- `pyproject.toml` — Build and dependency configuration for the storage package.

## Main Components

- **base.py**: Defines the abstract `StorageHandler` interface for storage operations.
- **gcs.py**: Implements `GCSStorageHandler`, a wrapper around Google Cloud Storage APIs for uploading, downloading, listing, and managing objects in GCS buckets.

## Google Cloud Storage (GCS) Usage

### Usage Example

To use the GCS storage handler:

```python
from mindtrace.storage.gcs import GCSStorageHandler

handler = GCSStorageHandler(
    bucket_name="your-bucket-name",
    project_id="your-gcp-project-id",
    credentials_path="/path/to/service-account.json",  # Optional if using ADC
    create_if_missing=True,
)

# Upload a file
gcs_uri = handler.upload("local_file.txt", "remote/path/in/bucket.txt")

# List objects
print(handler.list_objects(prefix="remote/path/"))
```

### Available GCS APIs
The following methods are available via the `GCSStorageHandler` for explicit use:

- `upload(local_path, remote_path, metadata=None)`: Upload a local file to a GCS bucket.
- `download(remote_path, local_path)`: Download a file from GCS to a local path.
- `delete(remote_path)`: Delete an object from the GCS bucket.
- `list_objects(prefix="", max_results=None)`: List objects in the bucket, optionally filtered by prefix.
- `exists(remote_path)`: Check if an object exists in the bucket.
- `get_presigned_url(remote_path, expiration_minutes=60, method="GET")`: Generate a presigned URL for accessing an object.
- `get_object_metadata(remote_path)`: Retrieve metadata for a specific object.

### Notes
- Ensure you have the required Google Cloud credentials and permissions to access the target bucket.
- For local development, you can use `gcloud auth application-default login` to set up default credentials.
snap-http 1.11.0
A library for interacting with snapd via its REST API.
Requires Python: >=3.8

# snap-http

![check](https://github.com/perfect5th/snap-http/actions/workflows/test.yml/badge.svg)

snap-http is a Python library used to interact with snapd's REST API, allowing you to
programmatically install and manage snaps in your Python applications. It has no dependencies
other than Python 3.8 or higher.

## Installation

```bash
pip install snap-http
```

## Usage

Take a look at the [api](https://github.com/Perfect5th/snap-http/blob/main/snap_http/api.py) module
to see what methods are available. Here's a couple examples:

### List installed snaps

```python3
>>> import snap_http
>>> response = snap_http.list()
>>> for snap in response.result:
...     print(snap["name"])
juju
snapd
core20
snapcraft
snap-store
<etc>
```

### Install a snap

Most actual changes to snaps happen asynchronously, so you need to check back on the change using
the change ID if you want to know the final result.

*N.B.: installation may require root permissions.*

```python3
>>> import snap_http
>>> response = snap_http.install("hello")
>>> response
SnapdResponse(type='async', status_code=202, status='Accepted', result=None, sources=None, change='1395')
>>> response = snap_http.check_change(response.change)
>>> response.result["status"]
'Done'
```