snaprender 0.7.1__tar.gz → 0.7.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.
- {snaprender-0.7.1 → snaprender-0.7.3}/PKG-INFO +12 -6
- {snaprender-0.7.1 → snaprender-0.7.3}/README.md +11 -5
- {snaprender-0.7.1 → snaprender-0.7.3}/pyproject.toml +1 -1
- {snaprender-0.7.1 → snaprender-0.7.3}/snaprender/__init__.py +1 -1
- {snaprender-0.7.1 → snaprender-0.7.3}/.gitignore +0 -0
- {snaprender-0.7.1 → snaprender-0.7.3}/LICENSE +0 -0
- {snaprender-0.7.1 → snaprender-0.7.3}/snaprender/client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: snaprender
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.3
|
|
4
4
|
Summary: Official Python SDK for SnapRender Screenshot API
|
|
5
5
|
Project-URL: Homepage, https://snap-render.com
|
|
6
6
|
Project-URL: Documentation, https://snap-render.com/docs
|
|
@@ -20,7 +20,7 @@ Description-Content-Type: text/markdown
|
|
|
20
20
|
|
|
21
21
|
Official Python SDK for the [SnapRender](https://snap-render.com) Screenshot API. Capture pixel-perfect screenshots, extract page content, run batch jobs, and manage webhooks with a single library.
|
|
22
22
|
|
|
23
|
-
**
|
|
23
|
+
**200 free screenshots/month. [Get your API key](https://snap-render.com/auth/signup?ref=pypi)**
|
|
24
24
|
|
|
25
25
|
## Features
|
|
26
26
|
|
|
@@ -62,6 +62,12 @@ image = snap.capture(html="<h1>Hello World</h1>")
|
|
|
62
62
|
image = snap.capture(markdown="# Hello World\nSome **bold** text.")
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
+
> **Cache is OFF by default.** Every request captures a fresh screenshot. To save credits on repeated requests, pass `cache=True`. Cached hits are free and return in under 200ms:
|
|
66
|
+
>
|
|
67
|
+
> ```python
|
|
68
|
+
> image = snap.capture("https://example.com", cache=True)
|
|
69
|
+
> ```
|
|
70
|
+
|
|
65
71
|
## Context Manager
|
|
66
72
|
|
|
67
73
|
```python
|
|
@@ -138,8 +144,8 @@ print(result["image"]) # data:image/png;base64,...
|
|
|
138
144
|
| `hide_selectors` | str | `None` | Comma-separated CSS selectors to hide |
|
|
139
145
|
| `click_selector` | str | `None` | CSS selector to click before capture |
|
|
140
146
|
| `user_agent` | str | `None` | Custom user-agent string |
|
|
141
|
-
| `cache` | bool | `
|
|
142
|
-
| `cache_ttl` | int | `86400` | Cache
|
|
147
|
+
| `cache` | bool | `False` | Return cached result if available. **Off by default:** set `True` to enable caching. Cached hits are free but may be up to 24h old. |
|
|
148
|
+
| `cache_ttl` | int | `86400` | Cache lifetime in seconds (default 24h). Cached screenshots older than this are recaptured. |
|
|
143
149
|
| `response_type` | str | `None` | Set to `"json"` for metadata + base64 data URI |
|
|
144
150
|
|
|
145
151
|
---
|
|
@@ -229,8 +235,8 @@ result = snap.extract(
|
|
|
229
235
|
| `block_cookie_banners` | bool | `None` | Remove cookie banners |
|
|
230
236
|
| `delay` | int | `None` | Wait (ms) after page load |
|
|
231
237
|
| `max_length` | int | `None` | Truncate content to this many characters |
|
|
232
|
-
| `cache` | bool | `None` |
|
|
233
|
-
| `cache_ttl` | int | `None` | Cache
|
|
238
|
+
| `cache` | bool | `None` | Return cached extraction if available. **Off by default:** set `True` to enable caching. Cached hits are free but may be stale. |
|
|
239
|
+
| `cache_ttl` | int | `None` | Cache lifetime in seconds (default 24h). |
|
|
234
240
|
|
|
235
241
|
**Returns** `{ "url": str, "type": str, "content": ..., "wordCount": int, "processingTimeMs": int }`
|
|
236
242
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Official Python SDK for the [SnapRender](https://snap-render.com) Screenshot API. Capture pixel-perfect screenshots, extract page content, run batch jobs, and manage webhooks with a single library.
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**200 free screenshots/month. [Get your API key](https://snap-render.com/auth/signup?ref=pypi)**
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
@@ -48,6 +48,12 @@ image = snap.capture(html="<h1>Hello World</h1>")
|
|
|
48
48
|
image = snap.capture(markdown="# Hello World\nSome **bold** text.")
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
> **Cache is OFF by default.** Every request captures a fresh screenshot. To save credits on repeated requests, pass `cache=True`. Cached hits are free and return in under 200ms:
|
|
52
|
+
>
|
|
53
|
+
> ```python
|
|
54
|
+
> image = snap.capture("https://example.com", cache=True)
|
|
55
|
+
> ```
|
|
56
|
+
|
|
51
57
|
## Context Manager
|
|
52
58
|
|
|
53
59
|
```python
|
|
@@ -124,8 +130,8 @@ print(result["image"]) # data:image/png;base64,...
|
|
|
124
130
|
| `hide_selectors` | str | `None` | Comma-separated CSS selectors to hide |
|
|
125
131
|
| `click_selector` | str | `None` | CSS selector to click before capture |
|
|
126
132
|
| `user_agent` | str | `None` | Custom user-agent string |
|
|
127
|
-
| `cache` | bool | `
|
|
128
|
-
| `cache_ttl` | int | `86400` | Cache
|
|
133
|
+
| `cache` | bool | `False` | Return cached result if available. **Off by default:** set `True` to enable caching. Cached hits are free but may be up to 24h old. |
|
|
134
|
+
| `cache_ttl` | int | `86400` | Cache lifetime in seconds (default 24h). Cached screenshots older than this are recaptured. |
|
|
129
135
|
| `response_type` | str | `None` | Set to `"json"` for metadata + base64 data URI |
|
|
130
136
|
|
|
131
137
|
---
|
|
@@ -215,8 +221,8 @@ result = snap.extract(
|
|
|
215
221
|
| `block_cookie_banners` | bool | `None` | Remove cookie banners |
|
|
216
222
|
| `delay` | int | `None` | Wait (ms) after page load |
|
|
217
223
|
| `max_length` | int | `None` | Truncate content to this many characters |
|
|
218
|
-
| `cache` | bool | `None` |
|
|
219
|
-
| `cache_ttl` | int | `None` | Cache
|
|
224
|
+
| `cache` | bool | `None` | Return cached extraction if available. **Off by default:** set `True` to enable caching. Cached hits are free but may be stale. |
|
|
225
|
+
| `cache_ttl` | int | `None` | Cache lifetime in seconds (default 24h). |
|
|
220
226
|
|
|
221
227
|
**Returns** `{ "url": str, "type": str, "content": ..., "wordCount": int, "processingTimeMs": int }`
|
|
222
228
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|