biolmai 0.2.3__py2.py3-none-any.whl → 0.2.4__py2.py3-none-any.whl

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.

Potentially problematic release.


This version of biolmai might be problematic. Click here for more details.

biolmai/__init__.py CHANGED
@@ -1,10 +1,24 @@
1
1
  """Top-level package for BioLM AI."""
2
2
  __author__ = """Nikhil Haas"""
3
3
  __email__ = "nikhil@biolm.ai"
4
- __version__ = '0.2.3'
4
+ __version__ = '0.2.4'
5
5
 
6
- from biolmai.cls import *
7
6
  from biolmai.client import BioLMApi, BioLMApiClient
8
7
  from biolmai.biolmai import BioLM
8
+ from typing import Optional, Union, List, Any
9
9
 
10
- __all__ = []
10
+ __all__ = ['biolm']
11
+
12
+
13
+ def biolm(
14
+ *,
15
+ entity: str,
16
+ action: str,
17
+ type: Optional[str] = None,
18
+ items: Union[Any, List[Any]],
19
+ params: Optional[dict] = None,
20
+ api_key: Optional[str] = None,
21
+ **kwargs
22
+ ) -> Any:
23
+ """Top-level convenience function that wraps the BioLM class and returns the result."""
24
+ return BioLM(entity=entity, action=action, type=type, items=items, params=params, api_key=api_key, **kwargs)
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: biolmai
3
+ Version: 0.2.4
4
+ Summary: BioLM Python client
5
+ Home-page: https://github.com/BioLM/py-biolm
6
+ Author: BioLM
7
+ Author-email: BioLM <support@biolm.ai>
8
+ License: Apache Software License 2.0
9
+ Keywords: biolmai
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Requires-Python: >=3.7
22
+ Description-Content-Type: text/x-rst
23
+ License-File: LICENSE
24
+ License-File: AUTHORS.rst
25
+ Requires-Dist: httpx>=0.23.0
26
+ Requires-Dist: httpcore
27
+ Requires-Dist: Click>=6.0
28
+ Requires-Dist: requests
29
+ Requires-Dist: aiodns
30
+ Requires-Dist: synchronicity>=0.5.0
31
+ Requires-Dist: aiohttp<=3.8.6; python_version < "3.12"
32
+ Requires-Dist: aiohttp>=3.9.0; python_version >= "3.12"
33
+ Requires-Dist: async-lru
34
+ Requires-Dist: aiofiles
35
+ Dynamic: author
36
+ Dynamic: home-page
37
+ Dynamic: license-file
38
+ Dynamic: requires-python
39
+
40
+ ========
41
+ BioLM AI
42
+ ========
43
+
44
+
45
+ .. image:: https://img.shields.io/pypi/v/biolmai.svg
46
+ :target: https://pypi.python.org/pypi/biolmai
47
+
48
+ .. image:: https://api.travis-ci.com/BioLM/py-biolm.svg?branch=production
49
+ :target: https://travis-ci.org/github/BioLM/py-biolm
50
+
51
+ .. image:: https://readthedocs.org/projects/biolm-ai/badge/?version=latest
52
+ :target: https://biolm-ai.readthedocs.io/en/latest/?version=latest
53
+ :alt: Documentation Status
54
+
55
+
56
+
57
+
58
+ Python client and SDK for `BioLM <https://biolm.ai>`_
59
+
60
+ Install the package:
61
+
62
+ .. code-block:: bash
63
+
64
+ pip install biolmai
65
+
66
+ Basic usage:
67
+
68
+ .. code-block:: python
69
+
70
+ from biolmai import biolm
71
+
72
+ # Encode a single sequence
73
+ result = biolm(entity="esm2-8m", action="encode", type="sequence", items="MSILVTRPSPAGEEL")
74
+
75
+ # Predict a batch of sequences
76
+ result = biolm(entity="esmfold", action="predict", type="sequence", items=["SEQ1", "SEQ2"])
77
+
78
+ # Write results to disk
79
+ biolm(entity="esmfold", action="predict", type="sequence", items=["SEQ1", "SEQ2"], output='disk', file_path="results.jsonl")
80
+
81
+ Asynchronous usage:
82
+
83
+ .. code-block:: python
84
+
85
+ from biolmai.client import BioLMApiClient
86
+ import asyncio
87
+
88
+ async def main():
89
+ model = BioLMApiClient("esmfold")
90
+ result = await model.predict(items=[{"sequence": "MDNELE"}])
91
+ print(result)
92
+
93
+ asyncio.run(main())
94
+
95
+ Overview
96
+ ========
97
+
98
+ The BioLM Python client provides a high-level, user-friendly interface for interacting with the BioLM API. It supports both synchronous and asynchronous usage, automatic batching, flexible error handling, and efficient processing of biological data.
99
+
100
+ Main features:
101
+
102
+ - High-level BioLM constructor for quick requests
103
+ - Sync and async interfaces
104
+ - Automatic or custom rate limiting/throttling
105
+ - Schema-based batch size detection
106
+ - Flexible input formats (single key + list, or list of dicts)
107
+ - Low memory usage via generators
108
+ - Flexible error handling (raise, continue, or stop on error)
109
+ - Universal HTTP client for both sync and async
110
+
111
+ Features
112
+ ========
113
+
114
+ - **High-level constructor**: Instantly run an API call with a single line.
115
+ - **Sync and async**: Use `BioLM` for sync, or `BioLMApiClient` for async.
116
+ - **Flexible rate limiting**: Use API throttle, disable, or set your own (e.g., '1000/second').
117
+ - **Schema-based batching**: Automatically queries API for max batch size.
118
+ - **Flexible input**: Accepts a single key and list, or list of dicts, or list of lists for advanced batching.
119
+ - **Low memory**: Uses generators for validation and batching.
120
+ - **Error handling**: Raise HTTPX errors, continue on error, or stop on first error.
121
+ - **Disk output**: Write results as JSONL to disk.
122
+ - **Universal HTTP client**: Efficient for both sync and async.
123
+ - **Direct access to schema and batching**: Use `BioLMApi` for advanced workflows, including `.schema()`, `.call()`, and `._batch_call_autoschema_or_manual()`.
124
+
125
+ **Example endpoints and actions:**
126
+
127
+ - `esm2-8m/encode`: Embedding for protein sequences.
128
+ - `esmfold/predict`: Structure prediction for protein sequences.
129
+ - `progen2-oas/generate`: Sequence generation from a context string.
130
+ - `dnabert2/predict`: Masked prediction for protein sequences.
131
+ - `ablang2/encode`: Embeddings for paired-chain antibodies.
132
+
133
+ * Free software: Apache Software License 2.0
134
+ * Documentation: https://docs.biolm.ai
@@ -1,4 +1,4 @@
1
- biolmai/__init__.py,sha256=MqA7uO9BWtrFdyTJRkQv1RMTvigpsl-xUI7gBTm2RTo,248
1
+ biolmai/__init__.py,sha256=Rt-5K0TkHdQdPjK_h_plsb8YHSfO6xSkTApCIhY081U,693
2
2
  biolmai/api.py,sha256=tqxQ-FoZosE88YmLJPQKskjNQdcb5jzZccywGP73lDc,13002
3
3
  biolmai/asynch.py,sha256=BVypJhhEEK2Bek2AhqNGn7FIRJehAbJflUdeeslbXFE,9073
4
4
  biolmai/auth.py,sha256=flI9KAD90qdXyLDnpJTrc9voKsiK0uWtD2ehsPBn8r4,6329
@@ -10,10 +10,10 @@ biolmai/const.py,sha256=vCSj-itsusZWoLR27DYQSpuq024GQz3-uKJuDUoPF0Y,1153
10
10
  biolmai/ltc.py,sha256=al7HZc5tLyUR5fmpIb95hOz5ctudVsc0xzjd_c2Ew3M,49
11
11
  biolmai/payloads.py,sha256=BOhEKl9kWkKMXy1YiNw2_eC6MJ4Dn6vKNvkhEBsM7Lw,1735
12
12
  biolmai/validate.py,sha256=58XMWrdWoDRmfiNAayWqrYaH3_bjRmEpG_yx6XSjTrM,4168
13
- biolmai-0.2.3.dist-info/licenses/AUTHORS.rst,sha256=TB_ACuFPgVmxn1NspYwksTdT6jdZeShcxfafmi-XWKQ,158
14
- biolmai-0.2.3.dist-info/licenses/LICENSE,sha256=8yt0SdP38I7a3g0zWqZjNe0VSDQhJA4bWLQSqqKtAVg,583
15
- biolmai-0.2.3.dist-info/METADATA,sha256=GOrCDFiAvVP-OalF2VS51Go57T-sI7AObCB6yPMbfPs,2191
16
- biolmai-0.2.3.dist-info/WHEEL,sha256=Td9E1opt19FSuwsk_gcDwtsGPmyXw7uz9xQf-y2gvl8,109
17
- biolmai-0.2.3.dist-info/entry_points.txt,sha256=ylQnDpCYrxF1F9z_T7NRQcYMWYF5ia_KsTUuboxjEAM,44
18
- biolmai-0.2.3.dist-info/top_level.txt,sha256=jyQO45JN3g_jbdI8WqMnb0aEIzf4h1MrmPAZkKgfnwY,8
19
- biolmai-0.2.3.dist-info/RECORD,,
13
+ biolmai-0.2.4.dist-info/licenses/AUTHORS.rst,sha256=TB_ACuFPgVmxn1NspYwksTdT6jdZeShcxfafmi-XWKQ,158
14
+ biolmai-0.2.4.dist-info/licenses/LICENSE,sha256=8yt0SdP38I7a3g0zWqZjNe0VSDQhJA4bWLQSqqKtAVg,583
15
+ biolmai-0.2.4.dist-info/METADATA,sha256=-m6zspmcBxVhCZxoDHYrIR8o5NH-5wobPl-hlHzj0MI,4619
16
+ biolmai-0.2.4.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
17
+ biolmai-0.2.4.dist-info/entry_points.txt,sha256=ylQnDpCYrxF1F9z_T7NRQcYMWYF5ia_KsTUuboxjEAM,44
18
+ biolmai-0.2.4.dist-info/top_level.txt,sha256=jyQO45JN3g_jbdI8WqMnb0aEIzf4h1MrmPAZkKgfnwY,8
19
+ biolmai-0.2.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any
@@ -1,76 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: biolmai
3
- Version: 0.2.3
4
- Summary: BioLM Python client
5
- Home-page: https://github.com/BioLM/py-biolm
6
- Author: BioLM
7
- Author-email: BioLM <support@biolm.ai>
8
- License: Apache Software License 2.0
9
- Keywords: biolmai
10
- Classifier: Development Status :: 2 - Pre-Alpha
11
- Classifier: Intended Audience :: Developers
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Natural Language :: English
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.12
20
- Classifier: Programming Language :: Python :: 3.13
21
- Requires-Python: >=3.7
22
- Description-Content-Type: text/x-rst
23
- License-File: LICENSE
24
- License-File: AUTHORS.rst
25
- Requires-Dist: httpx>=0.23.0
26
- Requires-Dist: httpcore
27
- Requires-Dist: Click>=6.0
28
- Requires-Dist: requests
29
- Requires-Dist: aiodns
30
- Requires-Dist: synchronicity>=0.5.0
31
- Requires-Dist: aiohttp<=3.8.6; python_version < "3.12"
32
- Requires-Dist: aiohttp>=3.9.0; python_version >= "3.12"
33
- Requires-Dist: async-lru
34
- Requires-Dist: aiofiles
35
- Dynamic: author
36
- Dynamic: home-page
37
- Dynamic: license-file
38
- Dynamic: requires-python
39
-
40
- ========
41
- BioLM AI
42
- ========
43
-
44
-
45
- .. image:: https://img.shields.io/pypi/v/biolmai.svg
46
- :target: https://pypi.python.org/pypi/biolmai
47
-
48
- .. image:: https://api.travis-ci.com/BioLM/py-biolm.svg?branch=production
49
- :target: https://travis-ci.org/github/BioLM/py-biolm
50
-
51
- .. image:: https://readthedocs.org/projects/biolm-ai/badge/?version=latest
52
- :target: https://biolm-ai.readthedocs.io/en/latest/?version=latest
53
- :alt: Documentation Status
54
-
55
-
56
-
57
-
58
- Python client and SDK for https://biolm.ai
59
-
60
-
61
- * Free software: Apache Software License 2.0
62
- * Documentation: https://biolm-ai.readthedocs.io.
63
-
64
-
65
- Features
66
- --------
67
-
68
- * TODO
69
-
70
- Credits
71
- -------
72
-
73
- This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
74
-
75
- .. _Cookiecutter: https://github.com/audreyr/cookiecutter
76
- .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage