diffbot-python 0.2.1__py3-none-any.whl → 0.2.3__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.
- diffbot/cli/__init__.py +2 -1
- {diffbot_python-0.2.1.dist-info → diffbot_python-0.2.3.dist-info}/METADATA +35 -4
- {diffbot_python-0.2.1.dist-info → diffbot_python-0.2.3.dist-info}/RECORD +6 -6
- {diffbot_python-0.2.1.dist-info → diffbot_python-0.2.3.dist-info}/WHEEL +1 -1
- {diffbot_python-0.2.1.dist-info → diffbot_python-0.2.3.dist-info}/entry_points.txt +0 -0
- {diffbot_python-0.2.1.dist-info → diffbot_python-0.2.3.dist-info}/licenses/LICENSE +0 -0
diffbot/cli/__init__.py
CHANGED
|
@@ -11,7 +11,7 @@ from rich.markdown import Markdown
|
|
|
11
11
|
from rich.progress import Progress, SpinnerColumn, TextColumn
|
|
12
12
|
from datetime import datetime
|
|
13
13
|
|
|
14
|
-
from diffbot import CrawlEventType, AuthError, ExtractionError, APIError
|
|
14
|
+
from diffbot import __version__, CrawlEventType, AuthError, ExtractionError, APIError
|
|
15
15
|
|
|
16
16
|
from ._common import get_client
|
|
17
17
|
|
|
@@ -28,6 +28,7 @@ def print_markdown(text):
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
@click.group()
|
|
31
|
+
@click.version_option(__version__, "-V", "--version", prog_name="db")
|
|
31
32
|
def main():
|
|
32
33
|
"""
|
|
33
34
|
Diffbot 🤖 Structure the world's knowledge.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: diffbot-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Python client library for Diffbot APIs
|
|
5
5
|
Project-URL: Homepage, https://github.com/diffbot/diffbot-python
|
|
6
6
|
Project-URL: Documentation, https://github.com/diffbot/diffbot-python#readme
|
|
@@ -15,6 +15,7 @@ Classifier: Intended Audience :: Developers
|
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
17
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -25,7 +26,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
|
25
26
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
27
|
Classifier: Topic :: Text Processing :: Markup :: HTML
|
|
27
28
|
Classifier: Typing :: Typed
|
|
28
|
-
Requires-Python: >=3.
|
|
29
|
+
Requires-Python: >=3.9
|
|
29
30
|
Requires-Dist: click>=8.1.0
|
|
30
31
|
Requires-Dist: httpx>=0.27.0
|
|
31
32
|
Requires-Dist: rich>=13.0.0
|
|
@@ -40,11 +41,19 @@ Python client library for [Diffbot](https://www.diffbot.com) APIs.
|
|
|
40
41
|
|
|
41
42
|
## Installation
|
|
42
43
|
|
|
44
|
+
Install the [standalone CLI binary](#standalone-binary) for [agentic use](#how-to-use-with-an-agent):
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
curl -fsSL https://raw.githubusercontent.com/diffbot/diffbot-python/main/install.sh | sh
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If you prefer, the full Python library can also be installed with pip:
|
|
51
|
+
|
|
43
52
|
```bash
|
|
44
53
|
python3 -m pip install diffbot-python
|
|
45
54
|
```
|
|
46
55
|
|
|
47
|
-
|
|
56
|
+
For local development:
|
|
48
57
|
|
|
49
58
|
```bash
|
|
50
59
|
pip install -e ".[dev]"
|
|
@@ -237,6 +246,22 @@ uv tool install .
|
|
|
237
246
|
|
|
238
247
|
This drops a `db` executable into `~/.local/bin` (ensure it is on your `PATH`). Use `--force` to reinstall or upgrade after changes, or `--editable` to have source edits take effect immediately. Alternatively, a plain `pip install .` (or `pip install -e .`) also installs the `db` entry point into the active environment.
|
|
239
248
|
|
|
249
|
+
### Standalone binary
|
|
250
|
+
|
|
251
|
+
Every release also ships a self-contained `db` binary for Linux (x86_64 and aarch64) and macOS (Apple Silicon) as a Python-free option. The installer detects your platform, verifies the SHA256 checksum, and installs (or upgrades) `db` into `~/.local/bin`:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
curl -fsSL https://raw.githubusercontent.com/diffbot/diffbot-python/main/install.sh | sh
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Pin a specific release or install location with flags (or the `DB_VERSION` / `DB_INSTALL_DIR` environment variables); re-running the installer upgrades an existing install in place:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
curl -fsSL https://raw.githubusercontent.com/diffbot/diffbot-python/main/install.sh | sh -s -- --version v0.2.1 --bin-dir ~/bin
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### How to use
|
|
264
|
+
|
|
240
265
|
```bash
|
|
241
266
|
export DIFFBOT_API_TOKEN=your-token-here
|
|
242
267
|
|
|
@@ -251,6 +276,12 @@ db entities "Apple CEO Tim Cook announced record quarterly earnings."
|
|
|
251
276
|
db entities "Apple CEO Tim Cook announced record quarterly earnings." -f dql
|
|
252
277
|
```
|
|
253
278
|
|
|
279
|
+
### How to use with an agent
|
|
280
|
+
Once installed, this library will work alongside [`diffbot-skills`](https://github.com/diffbot/diffbot-skills) to enable your agent full access to structuring web knowledge with Diffbot. Diffbot Agent Skills even unlocks some additional skills like crafting DQL from natural language.
|
|
281
|
+
|
|
282
|
+
`diffbot-skills` will pick up or install this library automatically.
|
|
283
|
+
|
|
284
|
+
|
|
254
285
|
## Tests
|
|
255
286
|
|
|
256
287
|
Run the mock test suite:
|
|
@@ -9,14 +9,14 @@ diffbot/kg.py,sha256=my-5vR4Vbe3LHzBDYVHLHo99KTtyiRXCT5625glsrlQ,3930
|
|
|
9
9
|
diffbot/nlp.py,sha256=lZJW4MkjhVklIEM2OBfhc8LvresXTy7RsuImPteYsOA,1153
|
|
10
10
|
diffbot/ontology.py,sha256=GWD5m2rz7ECWY6RrO1TeN3kk3DYTgmEHz6gFKASMvAU,6283
|
|
11
11
|
diffbot/web_search.py,sha256=RSaEK0pdAdLgtilc500Mf2MNmJ1DmiYYmIlBQBWvOpE,1356
|
|
12
|
-
diffbot/cli/__init__.py,sha256=
|
|
12
|
+
diffbot/cli/__init__.py,sha256=TLUrl6q5DHdzNMnsBFcbcV8yRMzt8Pl-lIrZl1QJQwc,16571
|
|
13
13
|
diffbot/cli/__main__.py,sha256=5BjNuyet8AY-POwoF5rGt722rHQ7tJ0Vf0UFUfzzi-I,58
|
|
14
14
|
diffbot/cli/_common.py,sha256=_s8WRukzSX3krjJW6HJmT7_3hEjNyv1i_y45tm81b2A,654
|
|
15
15
|
diffbot/cli/dql.py,sha256=iIMaGysMWTScnbAHAdWei2iVUJpMV5lA1pk1E9uQg4s,11439
|
|
16
16
|
diffbot/cli/entities.py,sha256=tsHKexF0b6NnsoUEZJUS2rJidTIE8lt6xrcSenPbwtY,5630
|
|
17
17
|
diffbot/cli/ontology.py,sha256=cLuRQ0KTsOJnFCXdG_zIX9J1ODK8ThPznWVDDEpO1pg,2055
|
|
18
|
-
diffbot_python-0.2.
|
|
19
|
-
diffbot_python-0.2.
|
|
20
|
-
diffbot_python-0.2.
|
|
21
|
-
diffbot_python-0.2.
|
|
22
|
-
diffbot_python-0.2.
|
|
18
|
+
diffbot_python-0.2.3.dist-info/METADATA,sha256=PJgy6eJ8WIWEB3q2LjQv6ghRID2567FPTrTTqf5QY-M,8834
|
|
19
|
+
diffbot_python-0.2.3.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
20
|
+
diffbot_python-0.2.3.dist-info/entry_points.txt,sha256=FCxJhrbl7VNEsTK7zl7qYvXID7gQ1_wxhiw5_Vllb_M,40
|
|
21
|
+
diffbot_python-0.2.3.dist-info/licenses/LICENSE,sha256=UZlamI1XGeiG0Mit8dsHssNhOuMGKfmNOp5qpf1533w,1063
|
|
22
|
+
diffbot_python-0.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|