diffbot-python 0.2.0__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/__init__.py CHANGED
@@ -2,7 +2,12 @@
2
2
  diffbot - Python client library for the Diffbot APIs.
3
3
  """
4
4
 
5
- __version__ = "0.1.0"
5
+ from importlib.metadata import PackageNotFoundError, version as _version
6
+
7
+ try:
8
+ __version__ = _version("diffbot-python")
9
+ except PackageNotFoundError: # not installed (e.g. running from a source tree)
10
+ __version__ = "0.0.0"
6
11
 
7
12
  from ._auth import resolve_token
8
13
  from .client import Diffbot, DiffbotAsync
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.4
1
+ Metadata-Version: 2.5
2
2
  Name: diffbot-python
3
- Version: 0.2.0
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.10
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
- Or, for local development:
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:
@@ -1,4 +1,4 @@
1
- diffbot/__init__.py,sha256=hyIdyzIjXYvM2XXE20bDggIcJkTC7aR5s--LdLGFXOI,619
1
+ diffbot/__init__.py,sha256=OUDi3bVvKowQAQB4m8I4t761ct4pC-3de461qPI4Zok,827
2
2
  diffbot/_auth.py,sha256=dzNMWqIjtG3YtRBb_EKpPRiBxvZgogxvoE0ABLvzfOk,1251
3
3
  diffbot/ask.py,sha256=iNv613j4CoIfdDTOE-pl9KUkjqI-2AxGDMR1prm3DGM,1853
4
4
  diffbot/client.py,sha256=G6vYUEDEaIqjJXcIRxAjwS_cvaXvM7KdQFVMIedkgUY,11315
@@ -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=UVGD3uevKTHmqEdbDhhR2PzO6-3i0xu8d7D_94jLLRo,16488
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.0.dist-info/METADATA,sha256=LooJOiHWS4HP8JlLvackJ2JEauezwZ2qe39xCgyhk2c,7402
19
- diffbot_python-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
20
- diffbot_python-0.2.0.dist-info/entry_points.txt,sha256=FCxJhrbl7VNEsTK7zl7qYvXID7gQ1_wxhiw5_Vllb_M,40
21
- diffbot_python-0.2.0.dist-info/licenses/LICENSE,sha256=UZlamI1XGeiG0Mit8dsHssNhOuMGKfmNOp5qpf1533w,1063
22
- diffbot_python-0.2.0.dist-info/RECORD,,
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,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.32.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any