suprsonic 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ node_modules/
2
+ .streamlit/secrets.toml
3
+ __pycache__/
4
+ *.pyc
5
+
6
+ logs/
7
+ *.log
8
+ test_results/
9
+
10
+ .DS_Store
11
+ .env
12
+ .env.backup*
13
+ data_exports/
14
+
15
+ .turbo/
16
+ .omega_dev_loop/
17
+ meta_logs/
18
+
19
+ backend/app/lib/oauth_automation/screenshots/
20
+ backend/tmp/
21
+ backend/tmp/**
22
+ backend/tmp/omega/
23
+ backend/tmp/omega/session_artifacts/
24
+ backend/tmp/omega/session_artifacts/**
25
+ tmp/
26
+ tmp/browser_use_sessions/
27
+ tmp/browser_use_sessions/**
28
+ .specstory/
29
+
30
+ # Prevent frontend symlink from being committed (causes Vercel build failures)
31
+ # See commit db5d1d359 for context - symlink causes infinite path resolution on Vercel
32
+ frontend
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.4
2
+ Name: suprsonic
3
+ Version: 0.1.0
4
+ Summary: Suprsonic Python SDK. One API key, 17+ capabilities for your AI agent.
5
+ Project-URL: Homepage, https://suprsonic.ai
6
+ Project-URL: Documentation, https://suprsonic.ai/apis
7
+ Project-URL: Repository, https://github.com/o-mega-ai/suprsonic-python
8
+ License: MIT
9
+ Keywords: ai-agent,mcp,suprsonic,unified-api
10
+ Requires-Python: >=3.10
11
+ Requires-Dist: httpx>=0.27
12
+ Description-Content-Type: text/markdown
13
+
14
+ # suprsonic
15
+
16
+ Python SDK for [Suprsonic](https://suprsonic.ai). One API key, 17+ capabilities for your AI agent.
17
+
18
+ ## Install
19
+
20
+ ```bash
21
+ pip install suprsonic
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ from suprsonic import Suprsonic
28
+
29
+ client = Suprsonic("omk_your_key")
30
+
31
+ # Search the web
32
+ result = client.search("latest AI funding rounds")
33
+ print(result.data)
34
+
35
+ # Find a professional email
36
+ result = client.emails.find(first_name="Yuma", last_name="Heymans", domain="o-mega.ai")
37
+ print(result.data["email"]) # yuma@o-mega.ai
38
+
39
+ # Scrape a webpage
40
+ result = client.scrape("https://example.com")
41
+ print(result.data["content"])
42
+
43
+ # Any capability via .run()
44
+ result = client.run("screenshot", url="https://example.com")
45
+ ```
46
+
47
+ ## All Capabilities
48
+
49
+ search, scrape, profiles, emails, images, tts, stt, sms, documents, companies, email-verify, transcribe, invoice-parse, subtitle, file-convert, bg-remove, screenshot
50
+
51
+ Get your API key at [suprsonic.ai](https://suprsonic.ai).
@@ -0,0 +1,38 @@
1
+ # suprsonic
2
+
3
+ Python SDK for [Suprsonic](https://suprsonic.ai). One API key, 17+ capabilities for your AI agent.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install suprsonic
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```python
14
+ from suprsonic import Suprsonic
15
+
16
+ client = Suprsonic("omk_your_key")
17
+
18
+ # Search the web
19
+ result = client.search("latest AI funding rounds")
20
+ print(result.data)
21
+
22
+ # Find a professional email
23
+ result = client.emails.find(first_name="Yuma", last_name="Heymans", domain="o-mega.ai")
24
+ print(result.data["email"]) # yuma@o-mega.ai
25
+
26
+ # Scrape a webpage
27
+ result = client.scrape("https://example.com")
28
+ print(result.data["content"])
29
+
30
+ # Any capability via .run()
31
+ result = client.run("screenshot", url="https://example.com")
32
+ ```
33
+
34
+ ## All Capabilities
35
+
36
+ search, scrape, profiles, emails, images, tts, stt, sms, documents, companies, email-verify, transcribe, invoice-parse, subtitle, file-convert, bg-remove, screenshot
37
+
38
+ Get your API key at [suprsonic.ai](https://suprsonic.ai).
@@ -0,0 +1,18 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "suprsonic"
7
+ version = "0.1.0"
8
+ description = "Suprsonic Python SDK. One API key, 17+ capabilities for your AI agent."
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.10"
12
+ dependencies = ["httpx>=0.27"]
13
+ keywords = ["suprsonic", "ai-agent", "unified-api", "mcp"]
14
+
15
+ [project.urls]
16
+ Homepage = "https://suprsonic.ai"
17
+ Documentation = "https://suprsonic.ai/apis"
18
+ Repository = "https://github.com/o-mega-ai/suprsonic-python"
@@ -0,0 +1,22 @@
1
+ """
2
+ Suprsonic Python SDK.
3
+
4
+ Usage:
5
+ from suprsonic import Suprsonic
6
+
7
+ client = Suprsonic("omk_your_key_here")
8
+
9
+ # Individual capabilities
10
+ result = client.search("latest AI funding rounds")
11
+ result = client.scrape("https://example.com")
12
+ result = client.emails.find(first_name="Yuma", last_name="Heymans", domain="o-mega.ai")
13
+ result = client.profiles.find(first_name="John", last_name="Doe", company="Stripe")
14
+
15
+ # Or use the meta API for any capability
16
+ result = client.run("search", query="latest AI news", mode="ai")
17
+ """
18
+
19
+ from suprsonic.client import Suprsonic, SuprsonicResult
20
+
21
+ __all__ = ["Suprsonic", "SuprsonicResult"]
22
+ __version__ = "0.1.0"
@@ -0,0 +1,150 @@
1
+ """Suprsonic Python SDK client."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass, field
6
+ from typing import Any, Optional
7
+
8
+ import httpx
9
+
10
+
11
+ @dataclass
12
+ class SuprsonicResult:
13
+ """Result from a Suprsonic API call."""
14
+
15
+ success: bool
16
+ data: dict[str, Any] | None = None
17
+ error: dict[str, Any] | None = None
18
+ metadata: dict[str, Any] | None = None
19
+ credits_used: int = 0
20
+
21
+ @property
22
+ def provider(self) -> str | None:
23
+ return (self.metadata or {}).get("provider_used")
24
+
25
+ @property
26
+ def latency_ms(self) -> int:
27
+ return (self.metadata or {}).get("response_time_ms", 0)
28
+
29
+ @property
30
+ def request_id(self) -> str | None:
31
+ return (self.metadata or {}).get("request_id")
32
+
33
+
34
+ class _CapabilityNamespace:
35
+ """Namespace for capability-specific methods (e.g. client.emails.find())."""
36
+
37
+ def __init__(self, client: Suprsonic, capability: str):
38
+ self._client = client
39
+ self._capability = capability
40
+
41
+ def find(self, **params: Any) -> SuprsonicResult:
42
+ return self._client.run(self._capability, **params)
43
+
44
+ def __call__(self, **params: Any) -> SuprsonicResult:
45
+ return self._client.run(self._capability, **params)
46
+
47
+
48
+ class Suprsonic:
49
+ """
50
+ Suprsonic Python client.
51
+
52
+ Usage:
53
+ client = Suprsonic("omk_your_key_here")
54
+ result = client.search("latest AI news")
55
+ result = client.emails.find(first_name="Yuma", last_name="Heymans", domain="o-mega.ai")
56
+ result = client.run("scrape", url="https://example.com", mode="thorough")
57
+ """
58
+
59
+ def __init__(
60
+ self,
61
+ api_key: str,
62
+ base_url: str = "https://o-mega.onrender.com",
63
+ timeout: float = 120.0,
64
+ ):
65
+ self._api_key = api_key
66
+ self._base_url = base_url.rstrip("/")
67
+ self._http = httpx.Client(
68
+ base_url=self._base_url,
69
+ headers={
70
+ "Authorization": f"Bearer {api_key}",
71
+ "Content-Type": "application/json",
72
+ },
73
+ timeout=timeout,
74
+ )
75
+
76
+ # Capability namespaces
77
+ self.emails = _CapabilityNamespace(self, "emails")
78
+ self.profiles = _CapabilityNamespace(self, "profiles")
79
+ self.companies = _CapabilityNamespace(self, "companies")
80
+ self.documents = _CapabilityNamespace(self, "documents")
81
+
82
+ def run(self, capability: str, **params: Any) -> SuprsonicResult:
83
+ """
84
+ Call any Suprsonic capability via the Meta API.
85
+
86
+ Args:
87
+ capability: Capability name (search, scrape, emails, profiles, etc.)
88
+ **params: Parameters for the capability.
89
+
90
+ Returns:
91
+ SuprsonicResult with .success, .data, .error, .metadata, .credits_used
92
+ """
93
+ resp = self._http.post("/v1/agent", json={"capability": capability, "params": params})
94
+ body = resp.json()
95
+ return SuprsonicResult(
96
+ success=body.get("success", False),
97
+ data=body.get("data"),
98
+ error=body.get("error"),
99
+ metadata=body.get("metadata"),
100
+ credits_used=body.get("credits_used", 0),
101
+ )
102
+
103
+ # Convenience methods for common capabilities
104
+ def search(self, query: str, mode: str = "ai", **kwargs: Any) -> SuprsonicResult:
105
+ return self.run("search", query=query, mode=mode, **kwargs)
106
+
107
+ def scrape(self, url: str, mode: str = "standard", **kwargs: Any) -> SuprsonicResult:
108
+ return self.run("scrape", url=url, mode=mode, **kwargs)
109
+
110
+ def generate_image(self, prompt: str, **kwargs: Any) -> SuprsonicResult:
111
+ return self.run("images", prompt=prompt, **kwargs)
112
+
113
+ def tts(self, text: str, **kwargs: Any) -> SuprsonicResult:
114
+ return self.run("tts", text=text, **kwargs)
115
+
116
+ def stt(self, audio_url: str, **kwargs: Any) -> SuprsonicResult:
117
+ return self.run("stt", audio_url=audio_url, **kwargs)
118
+
119
+ def send_message(self, to: str, message: str, **kwargs: Any) -> SuprsonicResult:
120
+ return self.run("sms", to=to, message=message, **kwargs)
121
+
122
+ def verify_email(self, email: str) -> SuprsonicResult:
123
+ return self.run("email-verify", email=email)
124
+
125
+ def transcribe(self, audio_url: str, **kwargs: Any) -> SuprsonicResult:
126
+ return self.run("transcribe", audio_url=audio_url, **kwargs)
127
+
128
+ def parse_invoice(self, document_url: str) -> SuprsonicResult:
129
+ return self.run("invoice-parse", document_url=document_url)
130
+
131
+ def generate_subtitles(self, audio_url: str, **kwargs: Any) -> SuprsonicResult:
132
+ return self.run("subtitle", audio_url=audio_url, **kwargs)
133
+
134
+ def convert_file(self, file_url: str, source_format: str, target_format: str = "pdf") -> SuprsonicResult:
135
+ return self.run("file-convert", file_url=file_url, source_format=source_format, target_format=target_format)
136
+
137
+ def remove_background(self, image_url: str) -> SuprsonicResult:
138
+ return self.run("bg-remove", image_url=image_url)
139
+
140
+ def screenshot(self, url: str, **kwargs: Any) -> SuprsonicResult:
141
+ return self.run("screenshot", url=url, **kwargs)
142
+
143
+ def close(self) -> None:
144
+ self._http.close()
145
+
146
+ def __enter__(self) -> Suprsonic:
147
+ return self
148
+
149
+ def __exit__(self, *args: Any) -> None:
150
+ self.close()