aeat.adapters.outbound.aeat.browser.profile module¶
Profile defaults for Playwright browser sessions.
Profile is the small browser-runtime record consumed by
adapters.outbound.aeat.browser.BrowserSession,
adapters.outbound.aeat.browser.default_browser_session_factory(), and
Sede helpers that open Playwright pages. It carries the profile name, fallback
storage-state JSON path, optional user agent, and the locale/timezone values
forwarded into browser.new_context(...).
The locale and timezone defaults are resolved lazily from
core.config.Settings when a Profile is instantiated. Importing
this module therefore does not construct settings or validate external
constants for commands that never touch the browser adapter.
See also
adapters.outbound.aeat.browser.BrowserSession.create_context()Consumes
Profileto build Playwright context kwargs.adapters.outbound.aeat.browser.opened_browser_page()Uses
Profilefor short-lived Sede browser contexts.
- class Profile(name, storage_state_path, user_agent=None, locale=<factory>, timezone_id=<factory>)[source]¶
Bases:
objectBrowser profile values forwarded into a Playwright context.
storage_state_pathis a fallback path: auth providers and Sede readers may pass an explicit storage-state path or in-memory state toadapters.outbound.aeat.browser.BrowserSession.create_context(), which takes precedence.localeandtimezone_iddefault fromcore.config.Settingsat construction time unless supplied explicitly.- Variables:
name – A unique identifier for this profile.
storage_state_path – Path to the JSON file containing cookies and localStorage.
user_agent – Optional custom User-Agent string.
locale – Optional locale (e.g., ‘es-ES’); defaults to
Settings.aeat_browser_locale.timezone_id – Optional timezone (e.g., ‘Europe/Madrid’); defaults to
Settings.aeat_browser_timezone.
- Parameters:
-
storage_state_path:
Path¶
- ensure_storage_dir()[source]¶
Create the parent directory for
storage_state_pathonly.BrowserSession.create_contextcalls this before deciding whether the fallback storage-state file exists. The method creates directories but never creates or mutates the storage-state JSON file itself.- Return type: