morphlabs 0.2.1__tar.gz → 0.2.3__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.
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: morphlabs
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Python SDK for Morphlabs biosignal processing API
5
5
  Author-email: Morphlabs <support@morphlabs.tech>
6
6
  Maintainer-email: Morphlabs <support@morphlabs.tech>
7
7
  License-Expression: MIT
8
8
  Project-URL: Homepage, https://morphlabs.tech
9
+ Project-URL: Documentation, https://developers.morphlabs.tech
9
10
  Requires-Python: >=3.8
10
11
  Description-Content-Type: text/markdown
11
12
  License-File: LICENSE
@@ -28,7 +28,7 @@ RETRYABLE_STATUS_CODES = [429, 500, 502, 503, 504]
28
28
 
29
29
  RUNPOD_API_KEY = "rpa_FFBJYB2SODF8Z3MCXWY5W78L8KI0A4BGQ999JLUZcqkk9u"
30
30
 
31
- OPTIMAL_BATCH_SIZE = 32 # Segments per request
31
+ OPTIMAL_BATCH_SIZE = 16 # Segments per request (RunPod 10MiB body limit)
32
32
 
33
33
  DEFAULT_POLL_INTERVAL = 1.0 # seconds between status polls
34
34
  DEFAULT_MAX_POLL_TIME = 300.0 # 5 min timeout per batch
@@ -57,12 +57,12 @@ class Scientia:
57
57
  raise ValueError("API key cannot be empty or whitespace. Please provide a valid API key.")
58
58
  self.api_key = api_key
59
59
 
60
- if base_url is not None:
61
- if not base_url.startswith(("http://", "https://")):
62
- raise ValueError(f"Invalid base_url: '{base_url}'. URL must start with http:// or https://")
63
- self.base_url = base_url.rstrip("/")
64
- else:
65
- self.base_url = "https://api.runpod.ai/v2/bsqrfd0tjfl0u4"
60
+ base_url = base_url if base_url is not None else os.getenv(
61
+ "MORPHLABS_BASE_URL", "https://api.runpod.ai/v2/bsqrfd0tjfl0u4"
62
+ )
63
+ if not base_url.startswith(("http://", "https://")):
64
+ raise ValueError(f"Invalid base_url: '{base_url}'. URL must start with http:// or https://")
65
+ self.base_url = base_url.rstrip("/")
66
66
 
67
67
  self.poll_interval = poll_interval
68
68
  self.max_poll_time = max_poll_time
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: morphlabs
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Python SDK for Morphlabs biosignal processing API
5
5
  Author-email: Morphlabs <support@morphlabs.tech>
6
6
  Maintainer-email: Morphlabs <support@morphlabs.tech>
7
7
  License-Expression: MIT
8
8
  Project-URL: Homepage, https://morphlabs.tech
9
+ Project-URL: Documentation, https://developers.morphlabs.tech
9
10
  Requires-Python: >=3.8
10
11
  Description-Content-Type: text/markdown
11
12
  License-File: LICENSE
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "morphlabs"
7
- version = "0.2.1"
7
+ version = "0.2.3"
8
8
  description = "Python SDK for Morphlabs biosignal processing API"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -28,6 +28,7 @@ dependencies = [
28
28
 
29
29
  [project.urls]
30
30
  Homepage = "https://morphlabs.tech"
31
+ Documentation = "https://developers.morphlabs.tech"
31
32
 
32
33
 
33
34
  [project.optional-dependencies]
@@ -110,6 +110,18 @@ def test_configurable_poll_params():
110
110
  assert scientia.max_poll_time == 600.0
111
111
 
112
112
 
113
+ def test_base_url_from_env(monkeypatch):
114
+ monkeypatch.setenv("MORPHLABS_BASE_URL", "https://dev.runpod.ai/v2/dev-endpoint")
115
+ scientia = Scientia(api_key="test_api_key")
116
+ assert scientia.base_url == "https://dev.runpod.ai/v2/dev-endpoint"
117
+
118
+
119
+ def test_base_url_param_overrides_env(monkeypatch):
120
+ monkeypatch.setenv("MORPHLABS_BASE_URL", "https://dev.runpod.ai/v2/dev-endpoint")
121
+ scientia = Scientia(api_key="test_api_key", base_url="https://custom.api.ai/v1")
122
+ assert scientia.base_url == "https://custom.api.ai/v1"
123
+
124
+
113
125
  # =============================================================================
114
126
  # Validation Tests
115
127
  # =============================================================================
File without changes
File without changes
File without changes