ant0-browser 0.1.0__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.
@@ -0,0 +1,213 @@
1
+ Metadata-Version: 2.5
2
+ Name: ant0-browser
3
+ Version: 0.1.0
4
+ Summary: Local Playwright launcher for the Ant0 Browser research build.
5
+ Project-URL: Homepage, https://docs.ant0.link/sdk
6
+ Project-URL: Support, https://ant0.link/contact
7
+ License: BSD-3-Clause
8
+ License-File: LICENSE
9
+ Keywords: ant0-browser,anti-detect,anti-fingerprint,automation,chromium,farbling,fingerprint,playwright,stealth,ungoogled
10
+ Requires-Python: >=3.9
11
+ Requires-Dist: maxminddb>=2.2
12
+ Requires-Dist: playwright>=1.40
13
+ Provides-Extra: test
14
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'test'
15
+ Requires-Dist: pytest>=7; extra == 'test'
16
+ Description-Content-Type: text/markdown
17
+
18
+ # Ant0 Browser Python SDK
19
+
20
+ Local Playwright launcher for a caller-supplied Ant0 Browser build. This package contains Python
21
+ SDK code, **not the engine**, browser assets, or account credentials. The SDK code is BSD-3-Clause
22
+ licensed; using the engine requires a separately installed Ant0 Browser build and signing in with a
23
+ valid Ant0 licence. Native identity needs no synthetic assets; synthetic identities require separately
24
+ authorized local model/template assets.
25
+
26
+ Once version `0.1.0` is available from PyPI, install it with `python -m pip install ant0-browser==0.1.0`.
27
+ For local candidate installs, use `ant0_browser-0.1.0-py3-none-any.whl` or
28
+ `ant0_browser-0.1.0.tar.gz`; these filenames do not indicate registry availability.
29
+
30
+ ## Local package preparation and installation
31
+
32
+ Prerequisites: Python with `venv` and pip, and access to the package index for build/runtime
33
+ dependencies. Metadata declares Python 3.9+; this local qualification used Python 3.12, not every
34
+ supported interpreter. pip installs `playwright>=1.40` and `maxminddb>=2.2`. An unsupported platform
35
+ may need a compiler to build dependencies when their wheels are unavailable. Do not run
36
+ `playwright install`: it would download stock browser binaries, not Ant0's engine.
37
+
38
+ From the repository root, build both `0.1.0` candidate artifacts without publishing:
39
+
40
+ ```bash
41
+ SDK_SOURCE="$PWD/sdk/python"
42
+ ARTIFACT_DIR="$HOME/ant0-sdk-artifacts"
43
+ mkdir -p "$ARTIFACT_DIR"
44
+ python3 -m venv "$ARTIFACT_DIR/build-venv"
45
+ "$ARTIFACT_DIR/build-venv/bin/python" -m pip install build
46
+ "$ARTIFACT_DIR/build-venv/bin/python" -m build --outdir "$ARTIFACT_DIR" "$SDK_SOURCE"
47
+ ```
48
+
49
+ The candidate filenames are `ant0_browser-0.1.0-py3-none-any.whl` and
50
+ `ant0_browser-0.1.0.tar.gz`. Install each into its own fresh consumer venv outside the checkout,
51
+ not as an editable/source install:
52
+
53
+ ```bash
54
+ CONSUMER_DIR="$(mktemp -d)"
55
+ cd "$CONSUMER_DIR"
56
+ python3 -m venv wheel-venv
57
+ python3 -m venv sdist-venv
58
+ wheel-venv/bin/python -m pip install "$ARTIFACT_DIR/ant0_browser-0.1.0-py3-none-any.whl"
59
+ sdist-venv/bin/python -m pip install "$ARTIFACT_DIR/ant0_browser-0.1.0.tar.gz"
60
+ ```
61
+
62
+ Optional installed-package qualification (no engine launch, daemon discovery, or account access):
63
+ copy the committed smoke script into that consumer. Isolated Python ignores checkout/PYTHONPATH
64
+ imports; run deterministic sync/async checks and console help in both environments:
65
+
66
+ ```bash
67
+ cp "$SDK_SOURCE/scripts/installed_smoke.py" .
68
+ for VENV in wheel-venv sdist-venv; do
69
+ "$VENV/bin/python" -I installed_smoke.py
70
+ "$VENV/bin/python" -m pip check
71
+ "$VENV/bin/ant0-browser-serve" --help
72
+ done
73
+ ```
74
+
75
+ These examples use POSIX venv paths; on Windows use `Scripts/python.exe` and
76
+ `Scripts/ant0-browser-serve.exe`. Remove only the temporary consumer/build venv you created when
77
+ finished. These checks qualify package contents and deterministic SDK operations, not engine
78
+ launches or registry availability.
79
+
80
+ ## Using a separately installed engine
81
+
82
+ For current signed releases, first install Ant0 and sign in to the local `ant0d` with a valid
83
+ licence. Supply the complete matching Ant0 engine installation via `executable_path` or
84
+ `ANT0_BROWSER_BINARY`; arbitrary stock Chrome/Chromium is rejected by the SDK's capability check.
85
+ The daemon must issue a launch ticket for that **exact engine release version**, not the SDK package
86
+ version. See Launch ticket below. Setting `launch_ticket=False` does not bypass engine enforcement.
87
+ New synthetic identities additionally require authorized local model/template assets; the package
88
+ contains neither. The following native-mode example needs no synthetic assets:
89
+
90
+ ```python
91
+ from ant0browser import launch
92
+
93
+ browser = launch(
94
+ executable_path=r"C:\path\to\chrome.exe",
95
+ identity={"mode": "native"},
96
+ )
97
+ page = browser.new_page()
98
+ page.goto("https://example.com")
99
+ browser.close()
100
+ ```
101
+
102
+ Set `ANT0_BROWSER_BINARY` instead of passing `executable_path` on every call. A previously populated
103
+ cache is resolved without network access. If no local binary is found, the SDK stops with
104
+ instructions to build the browser and set its path, unless `ANT0_BROWSER_RELEASE_URL` points at a
105
+ release store: then the SDK installs the channel's release after verifying its minisign signature
106
+ and hashes against the key embedded in the SDK (see `docs/RELEASING.md`).
107
+
108
+ The async API mirrors launch and persistent contexts:
109
+
110
+ ```python
111
+ from ant0browser.async_api import launch
112
+
113
+ browser = await launch(executable_path="/path/to/chrome", identity={"mode": "native"})
114
+ ```
115
+
116
+ Retained helpers include:
117
+
118
+ - `launch()` and `launch_persistent_context()`
119
+ - `serve()` and the `ant0-browser-serve` local CDP command
120
+ - native, captured, and persisted synthetic identities
121
+ - canonical template loading via `ANT0_BROWSER_TEMPLATE_SOURCE`
122
+ - fingerprint-profile encoding, geometry and coherence warnings
123
+ - humanized input wrappers and rendering checks
124
+ - optional GeoIP (Ant0's `ip.ant0.link` + offline database, see Network calls) and Widevine helpers
125
+
126
+ Omitting `identity` means native mode. The removed `fingerprint`, `fingerprint_profile`,
127
+ `light_stealth`, `profile`, `profile_select`, and `geoip` launch options are rejected. Use
128
+ `resolve_geo()` explicitly when needed and place its identity values under `overrides`. Explicit identity
129
+ switches belong under `overrides`; supported keys are `platform`, `platform_version`, `brand`,
130
+ `brand_version`, `gpu_vendor`, `gpu_renderer`, hardware/display fields, `location`, `timezone`,
131
+ `accept_language`, WebRTC/GPU/noise controls, `storage_quota`, `canvas_bridge`, and `tls_profile`.
132
+ Overrides take precedence over captured or synthetic profiles.
133
+
134
+ The SDK resolves browser binaries and identity templates locally by default. Automatic launch-ticket
135
+ requests go only to the local daemon; optional asset/release and GeoIP requests are listed below.
136
+
137
+ ## Network calls
138
+
139
+ Nothing in `launch`/`serve` leaves the machine on its own: the only automatic request is to the
140
+ **local** `ant0d` for a launch ticket (loopback, see the first row). The optional helpers do, and only when
141
+ called:
142
+
143
+ | Helper | Endpoint | Purpose |
144
+ | --- | --- | --- |
145
+ | `launch()` / `serve()` | local `ant0d` only (`ANT0_URL`, else `ant0d.pid`/`ant0d.token` under `ANT0_HOME`/the platform data folder; loopback) | `GET /v1/licence/ticket?engine=<version>` to obtain the engine's launch ticket when the caller passed no `launch_ticket` (see below). Skipped when no daemon token exists, when `launch_ticket=False`, or when the binary is not an installed release. |
146
+ | `resolve_geo()` | `http://ip.ant0.link/` (then `https://ip.ant0.link/`; `api.ipify.org` and `ip-api.com` only if both fail) | Exit-IP echo, sent *through the configured HTTP proxy* so the proxy's exit is measured. Ant0's echo runs with zero request logging (`ant0-infra/ipecho`). |
147
+ | `resolve_geo()` | `https://releases.ant0.link/ant0-assets/geoip/v1/geoip-aio-all.mmdb.zip` | Offline geo database (~52 MB, cached in the SDK cache dir for 30 days), fetched directly, not through the proxy. Mirror of daijro/geoip-all-in-one. |
148
+ | `resolve_geo()` | `http://ip.ant0.link/json` | Geo for the exit IP computed server-side from the same database; used only when the local database is unavailable. |
149
+ | release install | `ANT0_BROWSER_RELEASE_URL` (opt-in) | Signed engine releases. |
150
+ | font pack / model | `ANT0_BROWSER_FONT_PACK_URL`, `ANT0_BROWSER_MODEL_SOURCE`, `ANT0_BROWSER_TEMPLATE_SOURCE` (opt-in) | Assets. |
151
+
152
+ Overrides: `ANT0_BROWSER_IPECHO_URL`, `ANT0_BROWSER_GEOIP_URL`, `ANT0_BROWSER_GEOJSON_URL` (read at call time). Set `ANT0_BROWSER_IPECHO_URL` to disable the third-party
153
+ last-resort echoes entirely (only the given URL is tried).
154
+
155
+ Geo data attribution (required by the sources merged into geoip-all-in-one, GPL-3.0): this product
156
+ uses the IP2Location LITE database for IP geolocation (https://lite.ip2location.com); includes
157
+ GeoLite2 data created by MaxMind, available from https://www.maxmind.com/; IP geolocation by DB-IP
158
+ (https://db-ip.com). The database carries country, coordinates and timezone only.
159
+
160
+ ## Launch ticket (engine patch 0037)
161
+
162
+ Engine releases built with patch `0037-launch-ticket` refuse to start without
163
+ `--ant0-launch=<ticket>`: a licence token from the Ant0 server plus a 15-minute claim signed by the
164
+ local device key, bound to the engine's release version (`ant0/docs/PHASE3-CONTRACT.md` §10). The
165
+ SDK cannot mint one; it resolves the switch like this:
166
+
167
+ 1. `launch_ticket="<lic.claim.csig>"` — passed through verbatim.
168
+ 2. `--ant0-launch=` already in `args` — kept.
169
+ 3. Otherwise, when a local daemon is reachable (see the table above) and the engine's release version
170
+ is known (`.release.json` next to the install's `browser/`, a `<version>/browser/` path, or
171
+ `ANT0_BROWSER_ENGINE_VERSION`), the SDK fetches one. `engine_version=` overrides the inference.
172
+ 4. Else (`launch_ticket=False`, no daemon, daemon refuses, bare binary) the launch proceeds without
173
+ the switch. A patched engine then exits with code 90 and `ant0: launch ticket invalid (<reason>)`
174
+ on stderr, which `launch()`, `launch_persistent_context()`, the async API and `serve()` surface as
175
+ `LaunchTicketRejectedError` (`code == "engine.launch_ticket_rejected"`, `reason` as printed by
176
+ the engine: `missing`, `unknown_kid`, `wrong_engine`, `claim_expired`, ...). Pre-0037 engines
177
+ ignore the switch.
178
+
179
+ ## Known engine behaviours
180
+
181
+ - **Profile portability is not a Chromium launch mode.** The removed `portable_profile` and
182
+ `encryption_key` options did not provide supported engine portability. Cross-machine sync must use
183
+ authenticated encrypted Ant0 bundles of logical profile data, not copied raw user-data directories
184
+ or Chromium portability flags.
185
+ - **No SOCKS5 username/password authentication.** The engine has no RFC 1929 client (stock Chromium
186
+ has none and no Ant0 patch adds one), and Playwright rejects credentials in a SOCKS proxy
187
+ descriptor. `launch()`, `launch_persistent_context()` and `serve()` therefore raise `ValueError`
188
+ on a `socks*://` proxy with `username`/`password`. Use an `http(s)://` proxy with credentials
189
+ (Playwright handles those), a SOCKS5 proxy that allows your client IP without credentials, or a
190
+ local relay that authenticates upstream (the `ant0d` daemon runs one per session) and pass its
191
+ unauthenticated loopback address.
192
+ - **Direct launches show the ungoogled first-run page without hygiene switches.** Playwright's
193
+ `launch()` passes `--no-first-run`, `--no-default-browser-check` and
194
+ `--disable-search-engine-choice-screen` itself; a binary spawned directly with none of them opens
195
+ `chrome://ungoogled-first-run` ("ungoogled-chromium first run page", empty body) in the first tab
196
+ when no start URL is given. `serve()` adds those three switches (plain UI
197
+ switches, no `base::Feature` toggles, so nothing a page can observe changes and the identity
198
+ layer's feature flags are untouched) and append `about:blank` as the final positional when `args`
199
+ carries no URL, so the first tab is neutral. A caller URL in `args` suppresses the `about:blank`.
200
+
201
+ ## Source development and verification
202
+
203
+ From the repository root of an authorized private checkout, use a development venv with the test
204
+ extra installed. This editable install is for source tests, not installed-artifact qualification:
205
+
206
+ ```bash
207
+ python3 -m venv "$ARTIFACT_DIR/test-venv"
208
+ "$ARTIFACT_DIR/test-venv/bin/python" -m pip install -e './sdk/python[test]'
209
+ PYTHONDONTWRITEBYTECODE=1 "$ARTIFACT_DIR/test-venv/bin/python" -m pytest -p no:cacheprovider sdk/python/tests
210
+ ```
211
+
212
+ Leave `ANT0_BROWSER_TEST_BINARY` unset for the engine-free suite; the real-engine serve test is
213
+ opt-in and excluded from this package qualification.
@@ -0,0 +1,35 @@
1
+ ant0browser/__init__.py,sha256=lqPwWWbag2XSreYUHkbe9fV29IDGZWSQv-5PiDXq8Jc,25455
2
+ ant0browser/_fingerprint.py,sha256=OMeXSAgI2LT3Aj4koB0KTNbrS00xEYzM8R1nLDL8PJ0,23160
3
+ ant0browser/_fontpersona.py,sha256=ZkJNVn2Sgv4_xoENYk2nSgPUhYT1ki0YybBYQPgT-XA,7386
4
+ ant0browser/_fonts.py,sha256=fZ0xp-l3L7csrD_CSDOjNWkW-mLNLtimS36fzATINmA,4884
5
+ ant0browser/_geometry.py,sha256=1jStCw4sIHQacZN1PElbjEN3jmpiphA8-t6G7zlDOO0,3481
6
+ ant0browser/_humanize.py,sha256=dXWI5urkOchB8AO0h8iJ4tzwSwMauWvHf6VZQOT2XHg,47521
7
+ ant0browser/_humanize_async.py,sha256=KAndO4GcvIbYL07YvpqxadI9H38tpKwzSRRKKW0ulDs,34021
8
+ ant0browser/_launch_ticket.py,sha256=Aajm_vKl7C-QGitkMFcW9hJvZJpO8SEH5JLEYHR_9lE,11945
9
+ ant0browser/_launchopts.py,sha256=iwL0oBnEINnJjLHdszm7Yc9gKxwe_MhhVIA3gHUi9kM,12188
10
+ ant0browser/_motion.py,sha256=tPefe5SkS3t_9DJZQV3tFOz7JGWJl9c7FK-EshpMe2c,14358
11
+ ant0browser/_motionscore.py,sha256=4ijyYD4kesN1I0OHQG-Y7teY-rIun1vQMmy1FiciV3k,13470
12
+ ant0browser/_render.py,sha256=gocZaLuY6hZKZKzkpSvkwM6uYsI5NGmfEvBjcEXS-eQ,6034
13
+ ant0browser/_render_async.py,sha256=2nNhcHuvua6txZ05YS7i-xzXPj_qFE1BvCcU3YrJbqc,828
14
+ ant0browser/_serve.py,sha256=mSEeDX31n4wbZLwyJqKpcOt02q1nLMd9a6eEhQAwdgY,14613
15
+ ant0browser/_shaderdialect.py,sha256=BYDnK5ZU6m2cIoolAvq_yhj6q4ahyZb5PjR8yjcTYfw,1928
16
+ ant0browser/_warnings.py,sha256=c96n7CrSLstKdBWruAZT-5frwT2D0928r9KNOIU1J68,14199
17
+ ant0browser/_widevine.py,sha256=KMQrzpkndYeds557D0Wz4aMcdrWNiAz0ij97AfXRVRQ,11641
18
+ ant0browser/async_api.py,sha256=9XHuW1bBiLFCNMt7J6En5q-eUrCSz5C_5KdJbiEuQb8,11557
19
+ ant0browser/chromium_version.py,sha256=wMW5e1wyzIncBd7r_qGmoVc5keS7BE_tanJMdTrRaDw,946
20
+ ant0browser/download.py,sha256=xnXPvlrqvMl2-y4s0tpQBncjK46p8hLt2lartdwG4Uc,8363
21
+ ant0browser/fontpack.py,sha256=9dz7AHvWJtXABmoegcLqtm_BAf7zfsmjWXHJK_DCETU,6097
22
+ ant0browser/geoip.py,sha256=W1veUaQ14SCRxM61lcSoKeWdVMLxX1-1KaVeTDqZEaE,11661
23
+ ant0browser/identity.py,sha256=B4_l4MooJ3ZEx2zJg8uEQ-mvxgZxmQ6zIn1NpZ5ThxY,11107
24
+ ant0browser/identity_persistence.py,sha256=3j2_pfeAjiSZCZq5OUjxBFlc_E15GRM2nIgnlY045us,11916
25
+ ant0browser/persona_migration.py,sha256=GsDS93k4_L2CzAqPrDQxF5nSY7akVwr2Q7CyqQ2JhA8,4447
26
+ ant0browser/persona_profile.py,sha256=E4evMC71cCi99ioHJizJxsp1M_y92yQF8XH3j1MgiTo,16822
27
+ ant0browser/population_model.py,sha256=WEHGsruLJEygX8rfvZVgzc4mNrMwfZ2VTNy-g-Gwulk,8523
28
+ ant0browser/release.py,sha256=pE8Nc8lshCNPNU1jfOf3Te0B7LtHyrbrwjrVmU1fKbw,985
29
+ ant0browser/release_fetch.py,sha256=SEyZemhM1UmaZwKfApwrLDJE7efDbpsiYPlv4sPLMoc,15209
30
+ ant0browser/template_selection.py,sha256=G7TA18bHNDhWnilDX7NhvXKPkyLR4d6rDaDXIyB9YMo,2720
31
+ ant0_browser-0.1.0.dist-info/METADATA,sha256=9ZZzywlFXN6cNtENU3FQjY9kly7Bd6E1fbOu4UmYfMI,12267
32
+ ant0_browser-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
33
+ ant0_browser-0.1.0.dist-info/entry_points.txt,sha256=nWaOOvK_HS3d2liFQgCRdOcFfrgRzkth4ET5rIz-0mw,68
34
+ ant0_browser-0.1.0.dist-info/licenses/LICENSE,sha256=9aLoPs9Tq49KwlGaSikFR7XIKgJk3khtzQZlpl5v09c,1803
35
+ ant0_browser-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ ant0-browser-serve = ant0browser._serve:_cli_main
@@ -0,0 +1,35 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Ant0 Browser contributors
4
+ Copyright (c) 2026, Clearcote Labs and the Clearcote contributors
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+
31
+ ---
32
+
33
+ The Clearcote notice above applies to source and patches imported into Ant0
34
+ Browser. Other upstream components (Chromium, ungoogled-chromium, and others)
35
+ are distributed under their respective licenses; see CREDITS.md.