nosible 0.2.4__py3-none-any.whl → 0.2.6__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.
- nosible/classes/result.py +122 -11
- nosible/classes/result_set.py +42 -29
- nosible/classes/search.py +82 -22
- nosible/classes/search_set.py +26 -26
- nosible/classes/snippet.py +2 -2
- nosible/classes/snippet_set.py +2 -2
- nosible/classes/web_page.py +11 -56
- nosible/nosible_client.py +360 -84
- {nosible-0.2.4.dist-info → nosible-0.2.6.dist-info}/METADATA +40 -41
- nosible-0.2.6.dist-info/RECORD +16 -0
- nosible-0.2.4.dist-info/RECORD +0 -16
- {nosible-0.2.4.dist-info → nosible-0.2.6.dist-info}/WHEEL +0 -0
- {nosible-0.2.4.dist-info → nosible-0.2.6.dist-info}/licenses/LICENSE +0 -0
- {nosible-0.2.4.dist-info → nosible-0.2.6.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nosible
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Python client for the NOSIBLE Search API
|
|
5
5
|
Home-page: https://github.com/NosibleAI/nosible
|
|
6
6
|
Author: Stuart Reid, Matthew Dicks, Richard Taylor, Gareth Warburton
|
|
@@ -132,11 +132,11 @@ os.environ["LLM_API_KEY"] = "sk-..."
|
|
|
132
132
|
|
|
133
133
|
### 🎯 Core Workflows
|
|
134
134
|
|
|
135
|
-
| I need | Method
|
|
136
|
-
|
|
137
|
-
| Single query, up to 100 results | `search`
|
|
138
|
-
| Multiple queries in parallel | `searches`
|
|
139
|
-
| Thousands of results (100–10k) | `bulk_search`
|
|
135
|
+
| I need | Method | Use case |
|
|
136
|
+
|---------------------------------|-----------------|-------------------------|
|
|
137
|
+
| Single query, up to 100 results | `fast-search` | Interactive lookups |
|
|
138
|
+
| Multiple queries in parallel | `fast-searches` | Dashboards, comparisons |
|
|
139
|
+
| Thousands of results (100–10k) | `bulk_search` | Analytics, offline jobs |
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
### 🚀 Examples
|
|
@@ -172,17 +172,16 @@ with Nosible(
|
|
|
172
172
|
llm_api_key="sk-...",
|
|
173
173
|
openai_base_url="https://api.openrouter.ai/v1"
|
|
174
174
|
) as client:
|
|
175
|
-
results = client.
|
|
175
|
+
results = client.fast_search(
|
|
176
176
|
question="What are the terms of the partnership between Microsoft and OpenAI?",
|
|
177
177
|
n_results=20,
|
|
178
|
+
language="en",
|
|
178
179
|
publish_start="2020-06-01",
|
|
179
180
|
publish_end="2025-06-30",
|
|
180
|
-
include_netlocs=["nytimes.com", "techcrunch.com"],
|
|
181
|
-
exclude_netlocs=["example.com"],
|
|
182
181
|
visited_start="2023-06-01",
|
|
183
182
|
visited_end="2025-06-29",
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
include_netlocs=["nytimes.com", "techcrunch.com"],
|
|
184
|
+
exclude_netlocs=["example.com"],
|
|
186
185
|
include_companies=["/m/04sv4"], # Microsoft's GKID
|
|
187
186
|
exclude_companies=["/m/045c7b"] # Google GKID
|
|
188
187
|
)
|
|
@@ -203,7 +202,7 @@ with Nosible(
|
|
|
203
202
|
```python
|
|
204
203
|
# Example of using your own expansions
|
|
205
204
|
with Nosible() as nos:
|
|
206
|
-
results = nos.
|
|
205
|
+
results = nos.fast_search(
|
|
207
206
|
question="How have the Trump tariffs impacted the US economy?",
|
|
208
207
|
expansions=[
|
|
209
208
|
"What are the consequences of Trump's 2018 steel and aluminum tariffs on American manufacturers?",
|
|
@@ -232,7 +231,7 @@ Allows you to run multiple searches concurrently and `yields` the results as the
|
|
|
232
231
|
from nosible import Nosible
|
|
233
232
|
|
|
234
233
|
with Nosible(nosible_api_key="basic|abcd1234...", llm_api_key="sk-...") as client:
|
|
235
|
-
for batch in client.
|
|
234
|
+
for batch in client.fast_searches(
|
|
236
235
|
questions=[
|
|
237
236
|
"What are the terms of the partnership between Microsoft and OpenAI?",
|
|
238
237
|
"What exclusivity or non-compete clauses are included in their partnership?"
|
|
@@ -249,7 +248,7 @@ Bulk search enables you to retrieve a large number of results in a single reques
|
|
|
249
248
|
|
|
250
249
|
- Use the `bulk_search` method when you need more than 1,000 results for a single query.
|
|
251
250
|
- You can request between **1,000 and 10,000** results per query.
|
|
252
|
-
- All parameters available in the standard `search` method—such as `expansions`, `include_companies`,
|
|
251
|
+
- All parameters available in the standard `search` method—such as `expansions`, `include_companies`, and more—are also supported in `bulk_search`.
|
|
253
252
|
- A bulk search for 10,000 results typically completes in about 30 seconds or less.
|
|
254
253
|
|
|
255
254
|
```python
|
|
@@ -272,11 +271,11 @@ Add two ResultSets together:
|
|
|
272
271
|
from nosible import Nosible
|
|
273
272
|
|
|
274
273
|
with Nosible(nosible_api_key="basic|abcd1234...") as client:
|
|
275
|
-
r1 = client.
|
|
274
|
+
r1 = client.fast_search(
|
|
276
275
|
question="What are the terms of the partnership between Microsoft and OpenAI?",
|
|
277
276
|
n_results=5
|
|
278
277
|
)
|
|
279
|
-
r2 = client.
|
|
278
|
+
r2 = client.fast_search(
|
|
280
279
|
question="How is research governance and decision-making structured between Google and DeepMind?",
|
|
281
280
|
n_results=5
|
|
282
281
|
)
|
|
@@ -300,7 +299,7 @@ with Nosible(nosible_api_key="basic|abcd1234...") as client:
|
|
|
300
299
|
include_netlocs=["arxiv.org", "bbc.com"],
|
|
301
300
|
certain=True
|
|
302
301
|
)
|
|
303
|
-
results = client.
|
|
302
|
+
results = client.fast_search(search=search)
|
|
304
303
|
print([r for r in results])
|
|
305
304
|
```
|
|
306
305
|
|
|
@@ -317,7 +316,7 @@ This fetches a sentiment score for each search result.
|
|
|
317
316
|
from nosible import Nosible
|
|
318
317
|
|
|
319
318
|
with Nosible(nosible_api_key="basic|abcd1234...", llm_api_key="sk-...") as client:
|
|
320
|
-
results = client.
|
|
319
|
+
results = client.fast_search(
|
|
321
320
|
question="What are the terms of the partnership between Microsoft and OpenAI?",
|
|
322
321
|
n_results=1
|
|
323
322
|
)
|
|
@@ -333,29 +332,29 @@ Supported formats for saving and loading:
|
|
|
333
332
|
from nosible import Nosible, ResultSet
|
|
334
333
|
|
|
335
334
|
with Nosible(nosible_api_key="basic|abcd1234...") as client:
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
335
|
+
combined = client.fast_search(
|
|
336
|
+
question="What are the terms of the partnership between Microsoft and OpenAI?",
|
|
337
|
+
n_results=5
|
|
338
|
+
) + client.fast_search(
|
|
339
|
+
question="How is research governance and decision-making structured between Google and DeepMind?",
|
|
340
|
+
n_results=5
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
# Save
|
|
344
|
+
combined.write_csv("all_news.csv")
|
|
345
|
+
combined.write_json("all_news.json")
|
|
346
|
+
combined.write_parquet("all_news.parquet")
|
|
347
|
+
combined.write_ipc("all_news.arrow")
|
|
348
|
+
combined.write_duckdb("all_news.duckdb", table_name="news")
|
|
349
|
+
combined.write_ndjson("all_news.ndjson")
|
|
350
|
+
|
|
351
|
+
# Load
|
|
352
|
+
rs_csv = ResultSet.read_csv("all_news.csv")
|
|
353
|
+
rs_json = ResultSet.read_json("all_news.json")
|
|
354
|
+
rs_parq = ResultSet.read_parquet("all_news.parquet")
|
|
355
|
+
rs_arrow = ResultSet.read_ipc("all_news.arrow")
|
|
356
|
+
rs_duckdb = ResultSet.read_duckdb("all_news.duckdb")
|
|
357
|
+
rs_ndjson = ResultSet.read_ndjson("all_news.ndjson")
|
|
359
358
|
```
|
|
360
359
|
|
|
361
360
|
#### More Examples
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
nosible/__init__.py,sha256=11QmG9Wjprp_zB0VnPxGjqKwHmaoB0hoT8AGO6cGVMM,1426
|
|
2
|
+
nosible/nosible_client.py,sha256=OO8ibqdtnhs49985XMKzAfZHLLUJfYvyLsipw82ABqQ,94565
|
|
3
|
+
nosible/classes/result.py,sha256=htOK8NcCImguiQNIFe9kr3PYCtq46RSuB82-BzAgMbY,22762
|
|
4
|
+
nosible/classes/result_set.py,sha256=uQ9oeD2nqYTE1dGetkhkfqmPmuvxmRyVILfeHxSkT1E,53138
|
|
5
|
+
nosible/classes/search.py,sha256=VrpuAsS4pxcirR6l6WStJN0gPIfahZ_9Cx3YdNKczSw,13860
|
|
6
|
+
nosible/classes/search_set.py,sha256=VvtKXQ1_Ws_W-0p0C-wUvvdskeuXAyr65tpfvexAVw0,9895
|
|
7
|
+
nosible/classes/snippet.py,sha256=m2qxgnMxIxx4ZOIMqUAViGLf7C1Y4NCGaioyEKw2-Zg,4994
|
|
8
|
+
nosible/classes/snippet_set.py,sha256=0jPMDhJNCO02WhvY1QR1HedvADvBxRcN6x3FItEgSiI,5099
|
|
9
|
+
nosible/classes/web_page.py,sha256=cvwQspxS0pU2nFgPLqnDtDWlLONHp1KwxerflHueLJ8,5838
|
|
10
|
+
nosible/utils/json_tools.py,sha256=PcSMjcLEhbA626jAIn0SuD_1-4QDduapZUenTSt3N2E,4569
|
|
11
|
+
nosible/utils/rate_limiter.py,sha256=qr0Tg-3wVcw95FyQv3gbZhbf-_QY9zKdkIE4FSLFSBo,5400
|
|
12
|
+
nosible-0.2.6.dist-info/licenses/LICENSE,sha256=8ifsV4DrsiKi8KVBFy8SBb3KXPXhofE3pYq07q1TSCQ,1117
|
|
13
|
+
nosible-0.2.6.dist-info/METADATA,sha256=e6mQsT0-MVRzBZ2RXnhwyRrI31EQ3zOrJBVnTiDE93I,14796
|
|
14
|
+
nosible-0.2.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
+
nosible-0.2.6.dist-info/top_level.txt,sha256=mOconHuKcNJ1jTAj3DapQP_xB8YOmjTMyHg5txKH3uA,8
|
|
16
|
+
nosible-0.2.6.dist-info/RECORD,,
|
nosible-0.2.4.dist-info/RECORD
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
nosible/__init__.py,sha256=11QmG9Wjprp_zB0VnPxGjqKwHmaoB0hoT8AGO6cGVMM,1426
|
|
2
|
-
nosible/nosible_client.py,sha256=KgkdUofTNeARvHmL3hquPIgPtVHnNhiplBpMkPJYrrY,82214
|
|
3
|
-
nosible/classes/result.py,sha256=JQEmJqy48cvEnT2gchIf3HhyGY1ICDfb4xplWfDoVrY,17652
|
|
4
|
-
nosible/classes/result_set.py,sha256=badc0q8rlvgUQ36ZrNgSY5O40lIvyZsCChtpnoCM5jk,52813
|
|
5
|
-
nosible/classes/search.py,sha256=_RDH8ih75RufztOG7NUJuZ1ncNV3jNThq8ST41VP0fU,11269
|
|
6
|
-
nosible/classes/search_set.py,sha256=4L2qO_IKqlUebvxNJERxjXNiUKtolw7JhgFtt1QqEHk,9790
|
|
7
|
-
nosible/classes/snippet.py,sha256=5Av0cXjOL-8X6H8oFunC36DUyWiFLLsl7FfPJ7cYwVU,4988
|
|
8
|
-
nosible/classes/snippet_set.py,sha256=1SZUEq6zRcBT3N8BKbFPml5pt_WSCybIjMpTw8PTz4E,5093
|
|
9
|
-
nosible/classes/web_page.py,sha256=fe-cfDL-AmQRMdBO37jWh1K6BsH_K_VWBBfBzFRV3KM,7149
|
|
10
|
-
nosible/utils/json_tools.py,sha256=PcSMjcLEhbA626jAIn0SuD_1-4QDduapZUenTSt3N2E,4569
|
|
11
|
-
nosible/utils/rate_limiter.py,sha256=qr0Tg-3wVcw95FyQv3gbZhbf-_QY9zKdkIE4FSLFSBo,5400
|
|
12
|
-
nosible-0.2.4.dist-info/licenses/LICENSE,sha256=8ifsV4DrsiKi8KVBFy8SBb3KXPXhofE3pYq07q1TSCQ,1117
|
|
13
|
-
nosible-0.2.4.dist-info/METADATA,sha256=zQh03i9LjKKddVkV5z-yuJdcq1MB-4AAVpywgMmv00M,14857
|
|
14
|
-
nosible-0.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
-
nosible-0.2.4.dist-info/top_level.txt,sha256=mOconHuKcNJ1jTAj3DapQP_xB8YOmjTMyHg5txKH3uA,8
|
|
16
|
-
nosible-0.2.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|