A tiny, modular Solidarity.Tech API wrapper with optional Redis-backed rate limiting.
Project description
pysolidarity
Solidarity.Tech API Wrapper for Python.
Creates a clean(er) python interface to a few functions of the Solidarity.tech API.
This is an early version. Not fully tested. Significantly vibe-coded. USE AT YOUR OWN RISK
Currently only supports creating, updating, and fetching users.
Installation
pip install pysolidarity
# with optional rate limiting support
pip install "pysolidarity[rate]"
Quick start
from pysolidarity import make_client_from_env
# export SOLIDARITY_API_KEY=...
client = make_client_from_env()
# Create-or-update by email or phone
user = client.users.create_or_update({"phone_number": "15555555555", "first_name":"Jimmy"})
print(user)
# Update (returns all user details)
client.users.update(user["id"], {"first_name":"Jiiiimmy"})
# Get (returns all user details)
client.users.get(user["id"])
Rate limiting (optional)
import redis
from pysolidarity import make_rate_limited_client
r = redis.Redis(host="127.0.0.1", port=6379)
client = make_rate_limited_client(r, req_per_sec=4)
print(client.users.get(1234))
Environment
SOLIDARITY_API_KEY (required)
Development
pip install -e .[dev]
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 pysolidarity-0.1.1.tar.gz.
File metadata
- Download URL: pysolidarity-0.1.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a614c662e362b8b05a24c1122c045fc3889af614c0bf564f92857792674fd71a
|
|
| MD5 |
488f0e8b27b952cf1236bdb725e00c3c
|
|
| BLAKE2b-256 |
d0a604bdfc67f0b76715a07b1a4d61c240d586efc104b23d8e5f04c82a60c6ad
|
File details
Details for the file pysolidarity-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pysolidarity-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b28006b83fdfe32b64f38df45f6f54f31da074a1bb36ede5f76002fb6332fff7
|
|
| MD5 |
c5e398e70175577d5504650f06a167b4
|
|
| BLAKE2b-256 |
c0663aa239d4a92e0d250f90a72843f3d34414f8ca68867c53ca1b92c59f41d9
|