Skip to content

Commit e947ad9

Browse files
🌿 Fern Regeneration -- April 8, 2025 (#51)
* SDK regeneration * remove download --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Cooper Miller <kcoopermiller9@gmail.com>
1 parent 29bec8b commit e947ad9

5 files changed

Lines changed: 2 additions & 274 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "scrapybara"
33

44
[tool.poetry]
55
name = "scrapybara"
6-
version = "2.4.9"
6+
version = "2.5.0"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -805,98 +805,6 @@ client.instance.file(
805805
</dl>
806806

807807

808-
</dd>
809-
</dl>
810-
</details>
811-
812-
<details><summary><code>client.instance.<a href="src/scrapybara/instance/client.py">download</a>(...)</code></summary>
813-
<dl>
814-
<dd>
815-
816-
#### 📝 Description
817-
818-
<dl>
819-
<dd>
820-
821-
<dl>
822-
<dd>
823-
824-
Download a file from the instance and save it to a local path.
825-
826-
Args:
827-
path: Path of the file on the instance
828-
local_path: Path where to save the file locally
829-
</dd>
830-
</dl>
831-
</dd>
832-
</dl>
833-
834-
#### 🔌 Usage
835-
836-
<dl>
837-
<dd>
838-
839-
<dl>
840-
<dd>
841-
842-
```python
843-
from scrapybara import Scrapybara
844-
845-
client = Scrapybara(
846-
api_key="YOUR_API_KEY",
847-
)
848-
client.instance.download(
849-
instance_id="instance_id",
850-
path="path",
851-
local_path="local_path",
852-
)
853-
854-
```
855-
</dd>
856-
</dl>
857-
</dd>
858-
</dl>
859-
860-
#### ⚙️ Parameters
861-
862-
<dl>
863-
<dd>
864-
865-
<dl>
866-
<dd>
867-
868-
**instance_id:** `str`
869-
870-
</dd>
871-
</dl>
872-
873-
<dl>
874-
<dd>
875-
876-
**path:** `str`
877-
878-
</dd>
879-
</dl>
880-
881-
<dl>
882-
<dd>
883-
884-
**local_path:** `str`
885-
886-
</dd>
887-
</dl>
888-
889-
<dl>
890-
<dd>
891-
892-
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
893-
894-
</dd>
895-
</dl>
896-
</dd>
897-
</dl>
898-
899-
900808
</dd>
901809
</dl>
902810
</details>

src/scrapybara/client.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -981,20 +981,6 @@ def upload(
981981
request_options=request_options,
982982
)
983983

984-
def download(
985-
self,
986-
*,
987-
path: str,
988-
local_path: str,
989-
request_options: Optional[RequestOptions] = None,
990-
) -> FileResponse:
991-
return self._client.instance.download(
992-
self.id,
993-
path=path,
994-
local_path=local_path,
995-
request_options=request_options,
996-
)
997-
998984
class BrowserInstance(BaseInstance):
999985
def __init__(
1000986
self,
@@ -1517,20 +1503,6 @@ async def upload(
15171503
request_options=request_options,
15181504
)
15191505

1520-
async def download(
1521-
self,
1522-
*,
1523-
path: str,
1524-
local_path: str,
1525-
request_options: Optional[RequestOptions] = None,
1526-
) -> FileResponse:
1527-
return await self._client.instance.download(
1528-
self.id,
1529-
path=path,
1530-
local_path=local_path,
1531-
request_options=request_options,
1532-
)
1533-
15341506
class AsyncBrowserInstance(AsyncBaseInstance):
15351507
def __init__(
15361508
self,

src/scrapybara/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "scrapybara",
19-
"X-Fern-SDK-Version": "2.4.9",
19+
"X-Fern-SDK-Version": "2.5.0",
2020
}
2121
headers["x-api-key"] = self.api_key
2222
return headers

src/scrapybara/instance/client.py

Lines changed: 0 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -522,78 +522,6 @@ def file(
522522
raise ApiError(status_code=_response.status_code, body=_response.text)
523523
raise ApiError(status_code=_response.status_code, body=_response_json)
524524

525-
def download(
526-
self, instance_id: str, *, path: str, local_path: str, request_options: typing.Optional[RequestOptions] = None
527-
) -> FileResponse:
528-
"""
529-
Download a file from the instance and save it to a local path.
530-
531-
Args:
532-
path: Path of the file on the instance
533-
local_path: Path where to save the file locally
534-
535-
Parameters
536-
----------
537-
instance_id : str
538-
539-
path : str
540-
541-
local_path : str
542-
543-
request_options : typing.Optional[RequestOptions]
544-
Request-specific configuration.
545-
546-
Returns
547-
-------
548-
FileResponse
549-
Successful Response
550-
551-
Examples
552-
--------
553-
from scrapybara import Scrapybara
554-
555-
client = Scrapybara(
556-
api_key="YOUR_API_KEY",
557-
)
558-
client.instance.download(
559-
instance_id="instance_id",
560-
path="path",
561-
local_path="local_path",
562-
)
563-
"""
564-
_response = self._client_wrapper.httpx_client.request(
565-
f"v1/instance/{jsonable_encoder(instance_id)}/download",
566-
method="GET",
567-
params={
568-
"path": path,
569-
"local_path": local_path,
570-
},
571-
request_options=request_options,
572-
)
573-
try:
574-
if 200 <= _response.status_code < 300:
575-
return typing.cast(
576-
FileResponse,
577-
parse_obj_as(
578-
type_=FileResponse, # type: ignore
579-
object_=_response.json(),
580-
),
581-
)
582-
if _response.status_code == 422:
583-
raise UnprocessableEntityError(
584-
typing.cast(
585-
HttpValidationError,
586-
parse_obj_as(
587-
type_=HttpValidationError, # type: ignore
588-
object_=_response.json(),
589-
),
590-
)
591-
)
592-
_response_json = _response.json()
593-
except JSONDecodeError:
594-
raise ApiError(status_code=_response.status_code, body=_response.text)
595-
raise ApiError(status_code=_response.status_code, body=_response_json)
596-
597525
def upload(
598526
self, instance_id: str, *, file: core.File, path: str, request_options: typing.Optional[RequestOptions] = None
599527
) -> UploadResponse:
@@ -1385,86 +1313,6 @@ async def main() -> None:
13851313
raise ApiError(status_code=_response.status_code, body=_response.text)
13861314
raise ApiError(status_code=_response.status_code, body=_response_json)
13871315

1388-
async def download(
1389-
self, instance_id: str, *, path: str, local_path: str, request_options: typing.Optional[RequestOptions] = None
1390-
) -> FileResponse:
1391-
"""
1392-
Download a file from the instance and save it to a local path.
1393-
1394-
Args:
1395-
path: Path of the file on the instance
1396-
local_path: Path where to save the file locally
1397-
1398-
Parameters
1399-
----------
1400-
instance_id : str
1401-
1402-
path : str
1403-
1404-
local_path : str
1405-
1406-
request_options : typing.Optional[RequestOptions]
1407-
Request-specific configuration.
1408-
1409-
Returns
1410-
-------
1411-
FileResponse
1412-
Successful Response
1413-
1414-
Examples
1415-
--------
1416-
import asyncio
1417-
1418-
from scrapybara import AsyncScrapybara
1419-
1420-
client = AsyncScrapybara(
1421-
api_key="YOUR_API_KEY",
1422-
)
1423-
1424-
1425-
async def main() -> None:
1426-
await client.instance.download(
1427-
instance_id="instance_id",
1428-
path="path",
1429-
local_path="local_path",
1430-
)
1431-
1432-
1433-
asyncio.run(main())
1434-
"""
1435-
_response = await self._client_wrapper.httpx_client.request(
1436-
f"v1/instance/{jsonable_encoder(instance_id)}/download",
1437-
method="GET",
1438-
params={
1439-
"path": path,
1440-
"local_path": local_path,
1441-
},
1442-
request_options=request_options,
1443-
)
1444-
try:
1445-
if 200 <= _response.status_code < 300:
1446-
return typing.cast(
1447-
FileResponse,
1448-
parse_obj_as(
1449-
type_=FileResponse, # type: ignore
1450-
object_=_response.json(),
1451-
),
1452-
)
1453-
if _response.status_code == 422:
1454-
raise UnprocessableEntityError(
1455-
typing.cast(
1456-
HttpValidationError,
1457-
parse_obj_as(
1458-
type_=HttpValidationError, # type: ignore
1459-
object_=_response.json(),
1460-
),
1461-
)
1462-
)
1463-
_response_json = _response.json()
1464-
except JSONDecodeError:
1465-
raise ApiError(status_code=_response.status_code, body=_response.text)
1466-
raise ApiError(status_code=_response.status_code, body=_response_json)
1467-
14681316
async def upload(
14691317
self, instance_id: str, *, file: core.File, path: str, request_options: typing.Optional[RequestOptions] = None
14701318
) -> UploadResponse:

0 commit comments

Comments
 (0)