snaprender 0.7.1__tar.gz → 0.7.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: snaprender
3
- Version: 0.7.1
3
+ Version: 0.7.2
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
@@ -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 | `True` | Use CDN cache |
142
- | `cache_ttl` | int | `86400` | Cache TTL in seconds |
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` | Use cache |
233
- | `cache_ttl` | int | `None` | Cache TTL in seconds |
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
 
@@ -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 | `True` | Use CDN cache |
128
- | `cache_ttl` | int | `86400` | Cache TTL in seconds |
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` | Use cache |
219
- | `cache_ttl` | int | `None` | Cache TTL in seconds |
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
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "snaprender"
7
- version = "0.7.1"
7
+ version = "0.7.2"
8
8
  description = "Official Python SDK for SnapRender Screenshot API"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -3,4 +3,4 @@
3
3
  from .client import SnapRender, SnapRenderError
4
4
 
5
5
  __all__ = ["SnapRender", "SnapRenderError"]
6
- __version__ = "0.5.0"
6
+ __version__ = "0.7.2"
File without changes
File without changes