firecrawl-py 2.15.0__py3-none-any.whl → 2.16.1__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.
Potentially problematic release.
This version of firecrawl-py might be problematic. Click here for more details.
- firecrawl/__init__.py +1 -1
- firecrawl/firecrawl.py +15 -7
- {firecrawl_py-2.15.0.dist-info → firecrawl_py-2.16.1.dist-info}/METADATA +1 -1
- firecrawl_py-2.16.1.dist-info/RECORD +12 -0
- {firecrawl_py-2.15.0.dist-info → firecrawl_py-2.16.1.dist-info}/top_level.txt +0 -2
- build/lib/firecrawl/__init__.py +0 -79
- build/lib/firecrawl/__tests__/e2e_withAuth/__init__.py +0 -0
- build/lib/firecrawl/__tests__/e2e_withAuth/test.py +0 -170
- build/lib/firecrawl/__tests__/v1/e2e_withAuth/__init__.py +0 -0
- build/lib/firecrawl/__tests__/v1/e2e_withAuth/test.py +0 -465
- build/lib/firecrawl/firecrawl.py +0 -4610
- build/lib/tests/test_change_tracking.py +0 -98
- firecrawl_py-2.15.0.dist-info/RECORD +0 -19
- {firecrawl_py-2.15.0.dist-info → firecrawl_py-2.16.1.dist-info}/LICENSE +0 -0
- {firecrawl_py-2.15.0.dist-info → firecrawl_py-2.16.1.dist-info}/WHEEL +0 -0
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import unittest
|
|
2
|
-
from unittest.mock import patch, MagicMock
|
|
3
|
-
import json
|
|
4
|
-
import os
|
|
5
|
-
from firecrawl import FirecrawlApp
|
|
6
|
-
|
|
7
|
-
class TestChangeTracking(unittest.TestCase):
|
|
8
|
-
@patch('requests.post')
|
|
9
|
-
def test_change_tracking_format(self, mock_post):
|
|
10
|
-
mock_response = MagicMock()
|
|
11
|
-
mock_response.status_code = 200
|
|
12
|
-
mock_response.json.return_value = {
|
|
13
|
-
'success': True,
|
|
14
|
-
'data': {
|
|
15
|
-
'markdown': 'Test markdown content',
|
|
16
|
-
'changeTracking': {
|
|
17
|
-
'previousScrapeAt': '2023-01-01T00:00:00Z',
|
|
18
|
-
'changeStatus': 'changed',
|
|
19
|
-
'visibility': 'visible'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
mock_post.return_value = mock_response
|
|
24
|
-
|
|
25
|
-
app = FirecrawlApp(api_key=os.environ.get('TEST_API_KEY', 'dummy-api-key-for-testing'))
|
|
26
|
-
result = app.scrape_url('https://example.com', {
|
|
27
|
-
'formats': ['markdown', 'changeTracking']
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
args, kwargs = mock_post.call_args
|
|
31
|
-
self.assertEqual(kwargs['json']['formats'], ['markdown', 'changeTracking'])
|
|
32
|
-
|
|
33
|
-
self.assertEqual(result['changeTracking']['previousScrapeAt'], '2023-01-01T00:00:00Z')
|
|
34
|
-
self.assertEqual(result['changeTracking']['changeStatus'], 'changed')
|
|
35
|
-
self.assertEqual(result['changeTracking']['visibility'], 'visible')
|
|
36
|
-
|
|
37
|
-
@patch('requests.post')
|
|
38
|
-
def test_change_tracking_options(self, mock_post):
|
|
39
|
-
mock_response = MagicMock()
|
|
40
|
-
mock_response.status_code = 200
|
|
41
|
-
mock_response.json.return_value = {
|
|
42
|
-
'success': True,
|
|
43
|
-
'data': {
|
|
44
|
-
'markdown': 'Test markdown content',
|
|
45
|
-
'changeTracking': {
|
|
46
|
-
'previousScrapeAt': '2023-01-01T00:00:00Z',
|
|
47
|
-
'changeStatus': 'changed',
|
|
48
|
-
'visibility': 'visible',
|
|
49
|
-
'diff': {
|
|
50
|
-
'text': '@@ -1,1 +1,1 @@\n-old content\n+new content',
|
|
51
|
-
'json': {
|
|
52
|
-
'files': [{
|
|
53
|
-
'from': None,
|
|
54
|
-
'to': None,
|
|
55
|
-
'chunks': [{
|
|
56
|
-
'content': '@@ -1,1 +1,1 @@',
|
|
57
|
-
'changes': [{
|
|
58
|
-
'type': 'del',
|
|
59
|
-
'content': '-old content',
|
|
60
|
-
'del': True,
|
|
61
|
-
'ln': 1
|
|
62
|
-
}, {
|
|
63
|
-
'type': 'add',
|
|
64
|
-
'content': '+new content',
|
|
65
|
-
'add': True,
|
|
66
|
-
'ln': 1
|
|
67
|
-
}]
|
|
68
|
-
}]
|
|
69
|
-
}]
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
'json': {
|
|
73
|
-
'title': {
|
|
74
|
-
'previous': 'Old Title',
|
|
75
|
-
'current': 'New Title'
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
mock_post.return_value = mock_response
|
|
82
|
-
|
|
83
|
-
app = FirecrawlApp(api_key=os.environ.get('TEST_API_KEY', 'dummy-api-key-for-testing'))
|
|
84
|
-
result = app.scrape_url('https://example.com', {
|
|
85
|
-
'formats': ['markdown', 'changeTracking'],
|
|
86
|
-
'changeTrackingOptions': {
|
|
87
|
-
'modes': ['git-diff', 'json'],
|
|
88
|
-
'schema': {'type': 'object', 'properties': {'title': {'type': 'string'}}}
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
args, kwargs = mock_post.call_args
|
|
93
|
-
self.assertEqual(kwargs['json']['formats'], ['markdown', 'changeTracking'])
|
|
94
|
-
self.assertEqual(kwargs['json']['changeTrackingOptions']['modes'], ['git-diff', 'json'])
|
|
95
|
-
|
|
96
|
-
self.assertEqual(result['changeTracking']['diff']['text'], '@@ -1,1 +1,1 @@\n-old content\n+new content')
|
|
97
|
-
self.assertEqual(result['changeTracking']['json']['title']['previous'], 'Old Title')
|
|
98
|
-
self.assertEqual(result['changeTracking']['json']['title']['current'], 'New Title')
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
build/lib/firecrawl/__init__.py,sha256=YXfaa8Pl549ESHJ1swTJk2oLmioc1X911u15cTsJtpk,2613
|
|
2
|
-
build/lib/firecrawl/firecrawl.py,sha256=fB2BQFjv_Od6YSDny2Dw47fOHe74wuNpWIu2OCXpaQs,198145
|
|
3
|
-
build/lib/firecrawl/__tests__/e2e_withAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
build/lib/firecrawl/__tests__/e2e_withAuth/test.py,sha256=-Fq2vPcMo0iQi4dwsUkkCd931ybDaTxMBnZbRfGdDcA,7931
|
|
5
|
-
build/lib/firecrawl/__tests__/v1/e2e_withAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
build/lib/firecrawl/__tests__/v1/e2e_withAuth/test.py,sha256=k9IsEbdTHL9Cu49M4FpnQDEo2rnG6RqwmZAsK_EVJr4,21069
|
|
7
|
-
build/lib/tests/test_change_tracking.py,sha256=_IJ5ShLcoj2fHDBaw-nE4I4lHdmDB617ocK_XMHhXps,4177
|
|
8
|
-
firecrawl/__init__.py,sha256=YXfaa8Pl549ESHJ1swTJk2oLmioc1X911u15cTsJtpk,2613
|
|
9
|
-
firecrawl/firecrawl.py,sha256=fB2BQFjv_Od6YSDny2Dw47fOHe74wuNpWIu2OCXpaQs,198145
|
|
10
|
-
firecrawl/__tests__/e2e_withAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
firecrawl/__tests__/e2e_withAuth/test.py,sha256=-Fq2vPcMo0iQi4dwsUkkCd931ybDaTxMBnZbRfGdDcA,7931
|
|
12
|
-
firecrawl/__tests__/v1/e2e_withAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
firecrawl/__tests__/v1/e2e_withAuth/test.py,sha256=k9IsEbdTHL9Cu49M4FpnQDEo2rnG6RqwmZAsK_EVJr4,21069
|
|
14
|
-
tests/test_change_tracking.py,sha256=_IJ5ShLcoj2fHDBaw-nE4I4lHdmDB617ocK_XMHhXps,4177
|
|
15
|
-
firecrawl_py-2.15.0.dist-info/LICENSE,sha256=nPCunEDwjRGHlmjvsiDUyIWbkqqyj3Ej84ntnh0g0zA,1084
|
|
16
|
-
firecrawl_py-2.15.0.dist-info/METADATA,sha256=byOxtZBgz5N-OSz8KcxbGevt5xg2RhCFSRRjMFjthT8,7169
|
|
17
|
-
firecrawl_py-2.15.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
18
|
-
firecrawl_py-2.15.0.dist-info/top_level.txt,sha256=ytN_R30g2U2qZYFyIm710Z8QeK9FO1Uwa-WPGHXyqjE,27
|
|
19
|
-
firecrawl_py-2.15.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|