firecrawl 4.3.0__tar.gz → 4.3.1__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.
Potentially problematic release.
This version of firecrawl might be problematic. Click here for more details.
- {firecrawl-4.3.0 → firecrawl-4.3.1}/PKG-INFO +1 -1
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__init__.py +1 -1
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/aio/test_aio_usage.py +7 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/client.py +20 -5
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/types.py +6 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/client_async.py +12 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/aio/usage.py +18 -1
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl.egg-info/PKG-INFO +1 -1
- {firecrawl-4.3.0 → firecrawl-4.3.1}/LICENSE +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/README.md +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/aio/test_aio_batch_scrape.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/aio/test_aio_crawl.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/aio/test_aio_extract.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/aio/test_aio_map.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/aio/test_aio_scrape.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/aio/test_aio_search.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/aio/test_aio_watcher.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/conftest.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/test_async.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/test_batch_scrape.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/test_crawl.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/test_extract.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/test_map.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/test_scrape.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/test_search.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/test_usage.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/e2e/v2/test_watcher.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/aio/test_aio_crawl_params.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/aio/test_aio_crawl_request_preparation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/aio/test_aio_crawl_validation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/aio/test_aio_map_request_preparation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/aio/test_aio_scrape_request_preparation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/aio/test_aio_search_request_preparation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/aio/test_batch_request_preparation_async.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/aio/test_ensure_async.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_batch_request_preparation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_crawl_params.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_crawl_request_preparation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_crawl_validation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_map_request_preparation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_pagination.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_scrape_request_preparation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_search_request_preparation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_search_validation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_usage_types.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_webhook.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/utils/test_validation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/watcher/test_ws_watcher.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/firecrawl.backup.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v1/__init__.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v1/client.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/__init__.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/client.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/aio/__init__.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/aio/batch.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/aio/crawl.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/aio/extract.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/aio/map.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/aio/scrape.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/aio/search.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/batch.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/crawl.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/extract.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/map.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/scrape.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/search.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/methods/usage.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/types.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/utils/__init__.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/utils/error_handler.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/utils/get_version.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/utils/http_client.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/utils/http_client_async.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/utils/normalize.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/utils/validation.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/watcher.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/v2/watcher_async.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl.egg-info/SOURCES.txt +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl.egg-info/dependency_links.txt +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl.egg-info/requires.txt +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl.egg-info/top_level.txt +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/pyproject.toml +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/setup.cfg +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/setup.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/tests/test_change_tracking.py +0 -0
- {firecrawl-4.3.0 → firecrawl-4.3.1}/tests/test_timeout_conversion.py +0 -0
|
@@ -33,3 +33,10 @@ async def test_async_get_token_usage():
|
|
|
33
33
|
tokens = await client.get_token_usage()
|
|
34
34
|
assert hasattr(tokens, "remaining_tokens")
|
|
35
35
|
|
|
36
|
+
|
|
37
|
+
@pytest.mark.asyncio
|
|
38
|
+
async def test_async_get_queue_status():
|
|
39
|
+
client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))
|
|
40
|
+
status = await client.get_queue_status()
|
|
41
|
+
assert hasattr(status, "jobs_in_queue")
|
|
42
|
+
|
|
@@ -56,23 +56,34 @@ class V2Proxy:
|
|
|
56
56
|
self._client = client_instance
|
|
57
57
|
|
|
58
58
|
if client_instance:
|
|
59
|
+
self.scrape = client_instance.scrape
|
|
59
60
|
self.search = client_instance.search
|
|
60
61
|
self.crawl = client_instance.crawl
|
|
62
|
+
self.start_crawl = client_instance.start_crawl
|
|
61
63
|
self.get_crawl_status = client_instance.get_crawl_status
|
|
62
64
|
self.cancel_crawl = client_instance.cancel_crawl
|
|
63
|
-
self.
|
|
65
|
+
self.get_crawl_errors = client_instance.get_crawl_errors
|
|
66
|
+
self.get_active_crawls = client_instance.get_active_crawls
|
|
67
|
+
self.active_crawls = client_instance.active_crawls
|
|
64
68
|
self.crawl_params_preview = client_instance.crawl_params_preview
|
|
69
|
+
|
|
65
70
|
self.extract = client_instance.extract
|
|
71
|
+
self.start_extract = client_instance.start_extract
|
|
72
|
+
self.get_extract_status = client_instance.get_extract_status
|
|
73
|
+
|
|
66
74
|
self.start_batch_scrape = client_instance.start_batch_scrape
|
|
67
75
|
self.get_batch_scrape_status = client_instance.get_batch_scrape_status
|
|
68
76
|
self.cancel_batch_scrape = client_instance.cancel_batch_scrape
|
|
69
77
|
self.batch_scrape = client_instance.batch_scrape
|
|
70
78
|
self.get_batch_scrape_errors = client_instance.get_batch_scrape_errors
|
|
71
|
-
|
|
79
|
+
|
|
72
80
|
self.map = client_instance.map
|
|
73
81
|
self.get_concurrency = client_instance.get_concurrency
|
|
74
82
|
self.get_credit_usage = client_instance.get_credit_usage
|
|
75
83
|
self.get_token_usage = client_instance.get_token_usage
|
|
84
|
+
self.get_queue_status = client_instance.get_queue_status
|
|
85
|
+
|
|
86
|
+
self.watcher = client_instance.watcher
|
|
76
87
|
|
|
77
88
|
def __getattr__(self, name):
|
|
78
89
|
"""Forward attribute access to the underlying client."""
|
|
@@ -99,9 +110,9 @@ class AsyncV1Proxy:
|
|
|
99
110
|
|
|
100
111
|
class AsyncV2Proxy:
|
|
101
112
|
"""Proxy class that forwards method calls to the appropriate version client."""
|
|
102
|
-
_client: Optional[
|
|
113
|
+
_client: Optional[AsyncFirecrawlClient] = None
|
|
103
114
|
|
|
104
|
-
def __init__(self, client_instance: Optional[
|
|
115
|
+
def __init__(self, client_instance: Optional[AsyncFirecrawlClient] = None):
|
|
105
116
|
self._client = client_instance
|
|
106
117
|
|
|
107
118
|
if client_instance:
|
|
@@ -132,6 +143,8 @@ class AsyncV2Proxy:
|
|
|
132
143
|
self.get_concurrency = client_instance.get_concurrency
|
|
133
144
|
self.get_credit_usage = client_instance.get_credit_usage
|
|
134
145
|
self.get_token_usage = client_instance.get_token_usage
|
|
146
|
+
self.get_queue_status = client_instance.get_queue_status
|
|
147
|
+
|
|
135
148
|
self.watcher = client_instance.watcher
|
|
136
149
|
|
|
137
150
|
def __getattr__(self, name):
|
|
@@ -193,7 +206,8 @@ class Firecrawl:
|
|
|
193
206
|
self.get_concurrency = self._v2_client.get_concurrency
|
|
194
207
|
self.get_credit_usage = self._v2_client.get_credit_usage
|
|
195
208
|
self.get_token_usage = self._v2_client.get_token_usage
|
|
196
|
-
|
|
209
|
+
self.get_queue_status = self._v2_client.get_queue_status
|
|
210
|
+
|
|
197
211
|
self.watcher = self._v2_client.watcher
|
|
198
212
|
|
|
199
213
|
class AsyncFirecrawl:
|
|
@@ -238,6 +252,7 @@ class AsyncFirecrawl:
|
|
|
238
252
|
self.get_concurrency = self._v2_client.get_concurrency
|
|
239
253
|
self.get_credit_usage = self._v2_client.get_credit_usage
|
|
240
254
|
self.get_token_usage = self._v2_client.get_token_usage
|
|
255
|
+
self.get_queue_status = self._v2_client.get_queue_status
|
|
241
256
|
|
|
242
257
|
self.watcher = self._v2_client.watcher
|
|
243
258
|
|
|
@@ -65,6 +65,9 @@ from .v2.types import (
|
|
|
65
65
|
ExecuteJavascriptAction,
|
|
66
66
|
PDFAction,
|
|
67
67
|
|
|
68
|
+
# Usage types
|
|
69
|
+
QueueStatusResponse,
|
|
70
|
+
|
|
68
71
|
# Location and format types
|
|
69
72
|
Location,
|
|
70
73
|
|
|
@@ -142,6 +145,9 @@ __all__ = [
|
|
|
142
145
|
'ScrapeAction',
|
|
143
146
|
'ExecuteJavascriptAction',
|
|
144
147
|
'PDFAction',
|
|
148
|
+
|
|
149
|
+
# Usage types
|
|
150
|
+
'QueueStatusResponse',
|
|
145
151
|
|
|
146
152
|
# Location and format types
|
|
147
153
|
'Location',
|
|
@@ -253,6 +253,18 @@ class AsyncFirecrawlClient:
|
|
|
253
253
|
async def get_token_usage(self):
|
|
254
254
|
from .methods.aio import usage as async_usage # type: ignore[attr-defined]
|
|
255
255
|
return await async_usage.get_token_usage(self.async_http_client)
|
|
256
|
+
|
|
257
|
+
async def get_credit_usage_historical(self, by_api_key: bool = False):
|
|
258
|
+
from .methods.aio import usage as async_usage # type: ignore[attr-defined]
|
|
259
|
+
return await async_usage.get_credit_usage_historical(self.async_http_client, by_api_key)
|
|
260
|
+
|
|
261
|
+
async def get_token_usage_historical(self, by_api_key: bool = False):
|
|
262
|
+
from .methods.aio import usage as async_usage # type: ignore[attr-defined]
|
|
263
|
+
return await async_usage.get_token_usage_historical(self.async_http_client, by_api_key)
|
|
264
|
+
|
|
265
|
+
async def get_queue_status(self):
|
|
266
|
+
from .methods.aio import usage as async_usage # type: ignore[attr-defined]
|
|
267
|
+
return await async_usage.get_queue_status(self.async_http_client)
|
|
256
268
|
|
|
257
269
|
# Watcher (sync object usable from async contexts)
|
|
258
270
|
def watcher(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from ...utils.http_client_async import AsyncHttpClient
|
|
2
2
|
from ...utils.error_handler import handle_response_error
|
|
3
|
-
from ...types import ConcurrencyCheck, CreditUsage, TokenUsage, CreditUsageHistoricalResponse, TokenUsageHistoricalResponse
|
|
3
|
+
from ...types import ConcurrencyCheck, CreditUsage, TokenUsage, CreditUsageHistoricalResponse, TokenUsageHistoricalResponse, QueueStatusResponse
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
async def get_concurrency(client: AsyncHttpClient) -> ConcurrencyCheck:
|
|
@@ -49,6 +49,23 @@ async def get_token_usage(client: AsyncHttpClient) -> TokenUsage:
|
|
|
49
49
|
)
|
|
50
50
|
|
|
51
51
|
|
|
52
|
+
async def get_queue_status(client: AsyncHttpClient) -> QueueStatusResponse:
|
|
53
|
+
resp = await client.get("/v2/team/queue-status")
|
|
54
|
+
if resp.status_code >= 400:
|
|
55
|
+
handle_response_error(resp, "get queue status")
|
|
56
|
+
body = resp.json()
|
|
57
|
+
if not body.get("success"):
|
|
58
|
+
raise Exception(body.get("error", "Unknown error"))
|
|
59
|
+
data = body.get("data", body)
|
|
60
|
+
return QueueStatusResponse(
|
|
61
|
+
jobs_in_queue=data.get("jobsInQueue", 0),
|
|
62
|
+
active_jobs_in_queue=data.get("activeJobsInQueue", 0),
|
|
63
|
+
waiting_jobs_in_queue=data.get("waitingJobsInQueue", 0),
|
|
64
|
+
max_concurrency=data.get("maxConcurrency", 0),
|
|
65
|
+
most_recent_success=data.get("mostRecentSuccess", None),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
52
69
|
async def get_credit_usage_historical(client: AsyncHttpClient, by_api_key: bool = False) -> CreditUsageHistoricalResponse:
|
|
53
70
|
query = "?byApiKey=true" if by_api_key else ""
|
|
54
71
|
resp = await client.get(f"/v2/team/credit-usage/historical{query}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/aio/test_aio_crawl_params.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/aio/test_ensure_async.py
RENAMED
|
File without changes
|
|
File without changes
|
{firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_crawl_params.py
RENAMED
|
File without changes
|
|
File without changes
|
{firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_crawl_validation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{firecrawl-4.3.0 → firecrawl-4.3.1}/firecrawl/__tests__/unit/v2/methods/test_search_validation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|