Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,31 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
build:
if: github.repository == 'stainless-sdks/steel-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.5.0"
".": "0.6.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 25
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-f81cef6f87adc0530d9bc21e8d47c95aadef9d5bc3c282837ae0ad41d7f71bac.yml
openapi_spec_hash: 5b273b225abb80a969ea1485bf399745
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nen-labs%2Fsteel-efa19cc3cc7e8d1692f1952185eb882fd6250d5bc81af147aab3830fc39b4f8d.yml
openapi_spec_hash: 85a6c998ec4fbd8d526ccd3dd40bdf96
config_hash: 42515bf83f1e0e765071038fcf702122
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.6.0 (2025-07-02)

Full Changelog: [v0.5.0...v0.6.0](https://github.com/steel-dev/steel-python/compare/v0.5.0...v0.6.0)

### Features

* **api:** api update ([4a1726f](https://github.com/steel-dev/steel-python/commit/4a1726f54695553013b1bec0ab6c3b7e0f196482))
* **api:** api update ([dc67b27](https://github.com/steel-dev/steel-python/commit/dc67b27864bfcf0e040996cfe3d8538dbdb5328f))


### Chores

* **ci:** change upload type ([76f1526](https://github.com/steel-dev/steel-python/commit/76f1526277ff1a1dbc75ed3ce5c57e51293dfb3d))

## 0.5.0 (2025-06-30)

Full Changelog: [v0.4.0...v0.5.0](https://github.com/steel-dev/steel-python/compare/v0.4.0...v0.5.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "steel-sdk"
version = "0.5.0"
version = "0.6.0"
description = "The official Python library for the steel API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
12 changes: 7 additions & 5 deletions scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
set -exuo pipefail

RESPONSE=$(curl -X POST "$URL" \
FILENAME=$(basename dist/*.whl)

RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \
-H "Authorization: Bearer $AUTH" \
-H "Content-Type: application/json")

Expand All @@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then
exit 1
fi

UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)
UPLOAD_RESPONSE=$(curl -v -X PUT \
-H "Content-Type: binary/octet-stream" \
--data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1)

if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/steel-python/$SHA'\033[0m"
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/steel-python/$SHA/$FILENAME'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion src/steel/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "steel"
__version__ = "0.5.0" # x-release-please-version
__version__ = "0.6.0" # x-release-please-version
20 changes: 14 additions & 6 deletions src/steel/resources/sessions/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ def create(
session_context: session_create_params.SessionContext | NotGiven = NOT_GIVEN,
session_id: str | NotGiven = NOT_GIVEN,
solve_captcha: bool | NotGiven = NOT_GIVEN,
stealth_config: session_create_params.StealthConfig | NotGiven = NOT_GIVEN,
api_timeout: int | NotGiven = NOT_GIVEN,
use_proxy: bool | NotGiven = NOT_GIVEN,
use_proxy: session_create_params.UseProxy | NotGiven = NOT_GIVEN,
user_agent: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -116,10 +117,12 @@ def create(

solve_captcha: Enable automatic captcha solving. Default is false.

stealth_config: Stealth configuration for the session

api_timeout: Session timeout duration in milliseconds. Default is 300000 (5 minutes).

use_proxy: Enable Steel-provided residential proxy usage for the browser session. Default
is false, which routes requests through datacenter proxies.
use_proxy: Proxy configuration for the session. Can be a boolean or array of proxy
configurations

user_agent: Custom user agent string for the browser session

Expand All @@ -146,6 +149,7 @@ def create(
"session_context": session_context,
"session_id": session_id,
"solve_captcha": solve_captcha,
"stealth_config": stealth_config,
"api_timeout": api_timeout,
"use_proxy": use_proxy,
"user_agent": user_agent,
Expand Down Expand Up @@ -432,8 +436,9 @@ async def create(
session_context: session_create_params.SessionContext | NotGiven = NOT_GIVEN,
session_id: str | NotGiven = NOT_GIVEN,
solve_captcha: bool | NotGiven = NOT_GIVEN,
stealth_config: session_create_params.StealthConfig | NotGiven = NOT_GIVEN,
api_timeout: int | NotGiven = NOT_GIVEN,
use_proxy: bool | NotGiven = NOT_GIVEN,
use_proxy: session_create_params.UseProxy | NotGiven = NOT_GIVEN,
user_agent: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -472,10 +477,12 @@ async def create(

solve_captcha: Enable automatic captcha solving. Default is false.

stealth_config: Stealth configuration for the session

api_timeout: Session timeout duration in milliseconds. Default is 300000 (5 minutes).

use_proxy: Enable Steel-provided residential proxy usage for the browser session. Default
is false, which routes requests through datacenter proxies.
use_proxy: Proxy configuration for the session. Can be a boolean or array of proxy
configurations

user_agent: Custom user agent string for the browser session

Expand All @@ -502,6 +509,7 @@ async def create(
"session_context": session_context,
"session_id": session_id,
"solve_captcha": solve_captcha,
"stealth_config": stealth_config,
"api_timeout": api_timeout,
"use_proxy": use_proxy,
"user_agent": user_agent,
Expand Down
22 changes: 18 additions & 4 deletions src/steel/types/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from .._models import BaseModel

__all__ = ["Session", "Dimensions"]
__all__ = ["Session", "Dimensions", "StealthConfig"]


class Dimensions(BaseModel):
Expand All @@ -19,6 +19,17 @@ class Dimensions(BaseModel):
"""Width of the browser window"""


class StealthConfig(BaseModel):
humanize_interactions: Optional[bool] = FieldInfo(alias="humanizeInteractions", default=None)
"""
This flag will make the browser act more human-like by moving the mouse in a
more natural way
"""

skip_fingerprint_injection: Optional[bool] = FieldInfo(alias="skipFingerprintInjection", default=None)
"""This flag will skip the fingerprint generation for the session."""


class Session(BaseModel):
id: str
"""Unique identifier for the session"""
Expand All @@ -44,6 +55,9 @@ class Session(BaseModel):
proxy_bytes_used: int = FieldInfo(alias="proxyBytesUsed")
"""Amount of data transmitted through the proxy"""

proxy_source: Optional[Literal["steel", "external"]] = FieldInfo(alias="proxySource", default=None)
"""Source of the proxy used for the session"""

session_viewer_url: str = FieldInfo(alias="sessionViewerUrl")
"""URL to view session details"""

Expand All @@ -59,14 +73,14 @@ class Session(BaseModel):
is_selenium: Optional[bool] = FieldInfo(alias="isSelenium", default=None)
"""Indicates if Selenium is used in the session"""

proxy: Optional[str] = None
"""Proxy server used for the session"""

region: Optional[Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"]] = None
"""The region where the session was created"""

solve_captcha: Optional[bool] = FieldInfo(alias="solveCaptcha", default=None)
"""Indicates if captcha solving is enabled"""

stealth_config: Optional[StealthConfig] = FieldInfo(alias="stealthConfig", default=None)
"""Stealth configuration for the session"""

user_agent: Optional[str] = FieldInfo(alias="userAgent", default=None)
"""User agent string used in the session"""
Loading