Library providing convenient access to the Pincher REST API from applications written in Python.
Project description
Introduction
Purpose
pincher-sdk-py (or, just known by its Python package name, pincher_sdk) is a library providing convenient access to the Pincher REST API endpoints from applications written in Python.
It is a Python port of its Go counterpart.
[!NOTE] The
pincher_sdkpackage is currently in an alpha pre-release state.
Getting started
The package is available on the Python Package Index (PyPI). You can add it to your own projects to build clients or other Pincher tools with the following command:
uv add pincher_sdk
You can import the package and define a new client instance with the following:
import asyncio
from pincher_sdk import Client, cache
async def main():
client = Client(cache.Cache())
ready = await client.get_server_ready()
if ready:
print("The Pincher API server is live!")
else:
print("Could not reach the Pincher API server.")
if __name__ == "__main__":
asyncio.run(main())
The above setup produces a client instance with default settings. These are:
- An in-memory cache
- Up to 100 budget cache entries, each with internal caches for each budget resource given this same capacity of 100 entries.
- 5-minute TTL for each entry
- Auto-refresh enabled (the
/refreshendpoint is hit once when an active access token is found to be expired, so as to generate a new one using the active refresh token) - A default
base_urlthat is:http://localhost:8080 - A request timeout value of 10 seconds
License: BSD 3-Clause
pincher-sdk-py is licensed under the BSD 3-Clause License. What this means is that:
You are allowed to
- Modify the code, and distribute your own versions.
- Use this library in personal, open-source, or commercial projects.
- Include it in proprietary software, without making your project open-source.
You are not allowed to
- Remove or alter the license and copyright notice.
- Use the names "pincher-sdk-py" or its contributors for endorsements without permission.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pincher_sdk-0.1.1a5.tar.gz.
File metadata
- Download URL: pincher_sdk-0.1.1a5.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b3d06d9963714ea7f238123f3b32b989d054f49e8ccc8f0f674f923ee13287b
|
|
| MD5 |
e5acbdb217fc6c43c530caa019cab9ea
|
|
| BLAKE2b-256 |
8b662623a97bfa18d2730626b373919c6a6ae6f4d7f6fba4b8ca2582693766fb
|
File details
Details for the file pincher_sdk-0.1.1a5-py3-none-any.whl.
File metadata
- Download URL: pincher_sdk-0.1.1a5-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f34ff93b3ed7a0953321e93dd1fa1a0ed597832de56c3fdd99d95d2c24d15b5f
|
|
| MD5 |
2400cc23ac056510d0220369ba9e2a71
|
|
| BLAKE2b-256 |
ec68b8069dc659143f1c4cdb6d2c95d5e1e78aebc12af22ca234a952e2c8d2eb
|