Install the Socifyr Python SDK
Run pip install socifyr, set two environment variables, and call list_connections to confirm the key works.
How do I install the package?
bash
pip install socifyrThe package is version 0.1.0, requires Python 3.9 or newer, and depends on requests 2.28 or newer. It is licensed AGPL-3.0-or-later. Check that license against your use before you ship it in a closed-source product.
How do I set credentials?
bash
export SOCIFYR_API_KEY="sk_..."
export SOCIFYR_WORKSPACE_ID="your-workspace-id"Create the key in the dashboard (see API keys). Windows PowerShell uses $env:SOCIFYR_API_KEY = "sk_...".
How do I make a first call?
list_connections takes the workspace ID as an argument, so read it from the environment:
python
import os
from socifyr import Socifyr
client = Socifyr()
for c in client.workspaces.list_connections(os.environ["SOCIFYR_WORKSPACE_ID"]):
print(c["slug"], c["platform"], c.get("status"))What if the first call fails?
| Exception | Meaning | Fix |
|---|---|---|
ValueError from the constructor | No API key found | Set SOCIFYR_API_KEY or pass api_key |
AuthenticationError | 401 or 403 | Check the key and workspace |
SocifyrError with status of None | Network failure | Check connectivity and base_url |
See Errors.