diffbot-python 0.2.0__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.
Files changed (32) hide show
  1. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/PKG-INFO +35 -4
  2. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/README.md +31 -1
  3. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/pyproject.toml +3 -2
  4. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/__init__.py +6 -1
  5. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/cli/__init__.py +2 -1
  6. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/.gitignore +0 -0
  7. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/LICENSE +0 -0
  8. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/_auth.py +0 -0
  9. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/ask.py +0 -0
  10. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/cli/__main__.py +0 -0
  11. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/cli/_common.py +0 -0
  12. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/cli/dql.py +0 -0
  13. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/cli/entities.py +0 -0
  14. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/cli/ontology.py +0 -0
  15. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/client.py +0 -0
  16. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/crawl.py +0 -0
  17. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/errors.py +0 -0
  18. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/extract.py +0 -0
  19. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/kg.py +0 -0
  20. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/nlp.py +0 -0
  21. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/ontology.py +0 -0
  22. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/src/diffbot/web_search.py +0 -0
  23. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/tests/conftest.py +0 -0
  24. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/tests/test_ask.py +0 -0
  25. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/tests/test_async.py +0 -0
  26. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/tests/test_crawl.py +0 -0
  27. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/tests/test_dql.py +0 -0
  28. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/tests/test_dql_cli.py +0 -0
  29. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/tests/test_extract.py +0 -0
  30. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/tests/test_ontology.py +0 -0
  31. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/tests/test_readme_examples.py +0 -0
  32. {diffbot_python-0.2.0 → diffbot_python-0.2.3}/tests/test_web_search.py +0 -0
@@ -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:
@@ -5,11 +5,19 @@ Python client library for [Diffbot](https://www.diffbot.com) APIs.
5
5
 
6
6
  ## Installation
7
7
 
8
+ Install the [standalone CLI binary](#standalone-binary) for [agentic use](#how-to-use-with-an-agent):
9
+
10
+ ```bash
11
+ curl -fsSL https://raw.githubusercontent.com/diffbot/diffbot-python/main/install.sh | sh
12
+ ```
13
+
14
+ If you prefer, the full Python library can also be installed with pip:
15
+
8
16
  ```bash
9
17
  python3 -m pip install diffbot-python
10
18
  ```
11
19
 
12
- Or, for local development:
20
+ For local development:
13
21
 
14
22
  ```bash
15
23
  pip install -e ".[dev]"
@@ -202,6 +210,22 @@ uv tool install .
202
210
 
203
211
  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.
204
212
 
213
+ ### Standalone binary
214
+
215
+ 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`:
216
+
217
+ ```bash
218
+ curl -fsSL https://raw.githubusercontent.com/diffbot/diffbot-python/main/install.sh | sh
219
+ ```
220
+
221
+ 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:
222
+
223
+ ```bash
224
+ curl -fsSL https://raw.githubusercontent.com/diffbot/diffbot-python/main/install.sh | sh -s -- --version v0.2.1 --bin-dir ~/bin
225
+ ```
226
+
227
+ ### How to use
228
+
205
229
  ```bash
206
230
  export DIFFBOT_API_TOKEN=your-token-here
207
231
 
@@ -216,6 +240,12 @@ db entities "Apple CEO Tim Cook announced record quarterly earnings."
216
240
  db entities "Apple CEO Tim Cook announced record quarterly earnings." -f dql
217
241
  ```
218
242
 
243
+ ### How to use with an agent
244
+ 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.
245
+
246
+ `diffbot-skills` will pick up or install this library automatically.
247
+
248
+
219
249
  ## Tests
220
250
 
221
251
  Run the mock test suite:
@@ -4,10 +4,10 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "diffbot-python"
7
- version = "0.2.0"
7
+ version = "0.2.3"
8
8
  description = "Python client library for Diffbot APIs"
9
9
  readme = "README.md"
10
- requires-python = ">=3.10"
10
+ requires-python = ">=3.9"
11
11
  license = "MIT"
12
12
  license-files = ["LICEN[CS]E*"]
13
13
  authors = [
@@ -30,6 +30,7 @@ classifiers = [
30
30
  "Operating System :: OS Independent",
31
31
  "Programming Language :: Python :: 3",
32
32
  "Programming Language :: Python :: 3 :: Only",
33
+ "Programming Language :: Python :: 3.9",
33
34
  "Programming Language :: Python :: 3.10",
34
35
  "Programming Language :: Python :: 3.11",
35
36
  "Programming Language :: Python :: 3.12",
@@ -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
@@ -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.
File without changes