Universal OpenAPI-driven API connector
Project description
Universal API Connector
A universal, OpenAPI-driven Python connector for interacting with any API that provides an OpenAPI (Swagger) specification. Supports dynamic authentication (API Key, Bearer, Basic, OAuth1, OAuth2) and secure credential management.
Features
- Upload and parse any OpenAPI (Swagger) specification (JSON or YAML)
- Dynamic operation listing and parameter input
- Built-in authentication support: API Key, Bearer, Basic, OAuth2
- Secure credential storage (never logged or exposed)
- Universal, spec-driven (no hardcoded API logic)
- Extensible and production-ready architecture
Installation
pip install universal-api-connector
Usage Example
from universal_api_connector import UniversalAPIConnector
# Load your OpenAPI spec
yaml_path = 'your_api_spec.yaml'
connector = UniversalAPIConnector.from_spec_file(yaml_path)
# Authenticate (if required)
# connector.authenticate('api_name', credentials_dict)
# List available operations
ops = connector.list_operations('api_name')
# Execute an operation
response = connector.execute('api_name', 'GET /me', params={})
print(response.status_code)
print(response.json())
Authentication Support
- API Key (header or query)
- Bearer Token
- Basic Auth
- OAuth2 (Authorization Code, Client Credentials, etc.)
Credentials are never shown in the UI or logs, and are stored securely.
Troubleshooting
- Token refresh errors: Ensure your credentials and redirect URIs are correct and registered with your API provider.
- 403 errors: Check user registration and permissions in your API provider dashboard.
- Spec parsing issues: Only valid OpenAPI 3.x or Swagger 2.0 specs are supported (JSON or YAML).
For more details, see your API provider's documentation or open an issue.
License
MIT License
Security
- Credentials are stored locally and never displayed or logged
- Authorization headers and sensitive data are always redacted in debug output
Requirements
- Python 3.7+
- streamlit
- requests
- requests_oauthlib
- pyyaml
Tips & Troubleshooting
- API Name: Operations will only show after you enter an API name.
- Credentials: You’ll only be prompted for credentials if not already saved for that API name.
- Token refresh: For OAuth2 APIs (like Spotify), the app will auto-refresh tokens and let you re-authenticate if needed.
- Debug info: The debug panel shows request details, but never exposes your secrets or tokens.
- Path parameters: Always fill in required path parameters (e.g.
{user_id}) with real values. - Error messages: If you get a 400/401/403, check your credentials, scopes, or required parameters.
Example APIs
- Spotify, Twitter, HTTPBin, Mailgun, and any OpenAPI-compatible REST API.
Security
- Credentials are stored locally in
credentials.jsonand never shown in debug output. - Authorization headers and sensitive data are always redacted in the UI.
For questions or improvements, open an issue or contact the maintainer.
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 universal-api-connector-0.1.1.tar.gz.
File metadata
- Download URL: universal-api-connector-0.1.1.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5542f7b57f0ff952854cf1426651616521611b4987c893b2cf212c10b8fe655
|
|
| MD5 |
08119fb791f050d15b19e8dbc91e3c23
|
|
| BLAKE2b-256 |
0297f849403bdcd58005bd2eb5da778c58f8711ad21edd84a024fcea63a397f7
|
File details
Details for the file universal_api_connector-0.1.1-py3-none-any.whl.
File metadata
- Download URL: universal_api_connector-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c519f851e723f0e318659081c945c7c1222f85f2652ed342d209a46de3b59cde
|
|
| MD5 |
b6aa71b6fd662ebc697b63c1764cb946
|
|
| BLAKE2b-256 |
6b2fee93af102cfb0061da562ae4d988a70d484d2cf23c68ebc3c86d4379e319
|