
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
pyloops
Advanced tools
Unofficial Python SDK for Loops.so.
pip install pyloops
Or with uv:
uv add pyloops
PyLoops offers two ways to interact with the Loops API:
import pyloops
# Configure once (or set LOOPS_API_KEY environment variable)
pyloops.configure(api_key="your_api_key_here")
# Get the client
client = pyloops.get_client()
# Upsert a contact
await client.upsert_contact(
email="user@example.com",
first_name="John",
last_name="Doe",
subscribed=True,
)
# Find a contact
contacts = await client.find_contact(email="user@example.com")
# Send an event
await client.send_event(
event_name="user_signup",
email="user@example.com",
event_properties={"plan": "premium"},
)
# List mailing lists
mailing_lists = await client.list_mailing_lists()
For more control, use the auto-generated low-level API directly:
from pyloops import AuthenticatedClient
from pyloops.api.contacts import put_contacts_update
from pyloops.models import ContactUpdateRequest
client = AuthenticatedClient(
base_url="https://app.loops.so/api/v1",
token="your_api_key_here",
)
response = await put_contacts_update.asyncio(
client=client,
body=ContactUpdateRequest(
email="user@example.com",
first_name="John",
last_name="Doe"
)
)
All API calls require a Loops API key. Get your API key from your Loops account settings.
There are three ways to configure authentication:
export LOOPS_API_KEY="your_api_key_here"
import pyloops
pyloops.configure(api_key="your_api_key_here")
import pyloops
client = pyloops.LoopsClient(api_key="your_api_key_here")
This SDK provides access to all Loops.so API endpoints:
For detailed API documentation, visit the Loops.so API docs.
This SDK is automatically updated to match the latest Loops.so API specification. The package version corresponds to the Loops API version (current: 1.7.0).
A GitHub Action checks for API updates daily and creates a pull request when changes are detected. After review and merge, a new version is automatically published to PyPI.
# Clone the repository
git clone https://github.com/doctorgpt-corp/pyloops.git
cd pyloops
# Install dependencies with uv
uv sync --all-groups
Using just:
just check # Run linting + type checking
just lint # Run linting only
just typecheck # Run type checking only
just fmt # Format code
Or directly with uv:
uv run ruff check src/
uv run pyright src/
src/pyloops/
├── __init__.py # Main exports
├── client.py # High-level LoopsClient wrapper
├── config.py # Configuration
├── exceptions.py # Exceptions
├── api/ # Re-exports from _generated.api
├── models/ # Re-exports from _generated.models
└── _generated/ # ALL auto-generated code
├── client.py
├── api/
├── models/
└── types.py
To manually regenerate the SDK from the latest OpenAPI spec:
just generate
Or manually:
rm -rf src/pyloops/_generated
uv tool run openapi-python-client generate --url https://app.loops.so/openapi.yaml --meta uv
mv loops-open-api-spec-client/loops_open_api_spec_client src/pyloops/_generated
rm -rf loops-open-api-spec-client openapi.yaml
Custom code is never touched during regeneration.
MIT
This is an unofficial SDK and is not affiliated with or endorsed by Loops.so.
FAQs
Unofficial Python SDK for Loops.so email platform
We found that pyloops demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.