Skip to main content

HVBrowser

HVBrowser provides typed browser automation components for HentaiVerse. It builds on hbrowser for one authenticated browser transport; reusable battle operations remain in the separate hvbattle package.

Component graph

HentaiVerseSession is the public composition root. HVDriver is deliberately limited to browser lifecycle and authenticated transport, while every HentaiVerse feature has a named component:

HentaiVerseSession
├── browser: HVDriver
├── realm: RealmNavigator
├── maintenance_navigation: MaintenanceNavigator
├── player: PlayerClient
├── equipment: EquipmentRepairClient
├── market: MarketClient
├── lottery: LotteryClient
└── monster_lab: MonsterLabClient
from hvbrowser import HentaiVerseSession, Realm


async with HentaiVerseSession(headless=True) as session:
    player = await session.player.inspect()
    realm = await session.realm.current()
    print(player.level, player.stamina, realm is Realm.ISEKAI)

The session initializes the browser, authenticates, enters Persistent, and closes the browser on exit. An application may inject a configured but not-yet-started transport with HentaiVerseSession(browser=browser); after injection, the session owns that transport's lifecycle.

All components share the same browser page. Call their operations sequentially; concurrent navigation by multiple components is not supported.

Player and equipment

Player reads and mutations are explicit. Stamina recovery returns a StaminaRecoveryReport; a successful report confirms that the visible stamina increased. Missing controls and unknown submission outcomes raise typed errors.

before = await session.player.read_stamina()
report = await session.player.recover_stamina(expected_before=before)
if report.recovered:
    print(report.before, report.after)

Equipment repair separates inspection from mutation and scopes snapshots to a typed Realm. repair_all() returns NO_REPAIR_NEEDED, REPAIRED, or MATERIALS_UNAVAILABLE. It verifies a disabled submit control against a fresh server page before reporting unavailable materials.

snapshot = await session.equipment.inspect()
report = await session.equipment.repair_all(expected_before=snapshot)
if not report.ready:
    print(report.outcome)

Lottery and Monster Lab

Lottery inspection returns the current ticket count, shared GP balance, and fixed ticket price. Purchasing requires an explicit kind and positive quantity, then verifies the exact ticket increase and GP decrease.

from hvbrowser import LotteryKind

snapshot = await session.lottery.inspect(LotteryKind.WEAPON)
report = await session.lottery.purchase(
    LotteryKind.WEAPON,
    25,
    expected_before=snapshot,
)

Target counts, Weapon-versus-Armor priority, and limited-GP behavior are application policy and do not belong in this package.

Monster Lab similarly exposes each resource as one atomic operation:

from hvbrowser import MonsterLabFeed

snapshot = await session.monster_lab.inspect()
food = await session.monster_lab.feed_all(MonsterLabFeed.FOOD)
drugs = await session.monster_lab.feed_all(MonsterLabFeed.DRUGS)

Lottery, Monster Lab, and equipment repair share one fail-closed MaintenanceNavigator. An atomic DOM snapshot classifies timed challenge, final-completion, next-floor, and active-battle markers before unsafe Bazaar interaction. A marker raises MaintenanceNavigationBlockedError with a typed blocker. Marker-free missing Bazaar state permits exactly one same-realm retry.

Market

Market inspection and sale planning are read-only. A MarketSaleRequest contains immutable item-name selections, and the resulting plan records its realm.

from hvbrowser import MarketSaleRequest

snapshot = await session.market.inspect()
plan = await session.market.plan_sales(
    MarketSaleRequest(materials=("Low-Grade Metals",)),
)
print(snapshot.realm, plan.total_units)

Submission requires an explicit submit_sales(plan) call. It remains blocked by a fail-closed runtime gate until the current live quote and pricing semantics have been verified. The guarded implementation never deposits credits or re-lists unrelated orders.

Guarded live smoke test

The surrounding application owns account selection. The smoke probe requires credentials through environment indirection, stops on active battle markers, and performs no purchase, feed-all, Market submission, repair, recovery, or battle action:

uv run --no-sync python scripts/live_readonly_smoke.py \
  --skip-market \
  --inspect-lotteries \
  --inspect-monster-lab

Lottery and Monster Lab inspection are skipped in Isekai without switching realms.

Development

Build a clean environment backed by the PyPI release of hbrowser:

bash scripts/rebuild-env.sh

For coordinated local development, overlay the local checkout after rebuilding:

uv pip install --python .venv/bin/python --reinstall --no-deps --editable \
  /Users/kuanlun_wang/Desktop/git-repo/hbrowser.clone

Commands that must preserve the editable overlay use uv run --no-sync.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hvbrowser-0.3.0.tar.gz (64.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hvbrowser-0.3.0-py3-none-any.whl (48.1 kB view details)

Uploaded Python 3

File details

Details for the file hvbrowser-0.3.0.tar.gz.

File metadata

  • Download URL: hvbrowser-0.3.0.tar.gz
  • Upload date:
  • Size: 64.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hvbrowser-0.3.0.tar.gz
Algorithm Hash digest
SHA256 84e4475dd1f9a91b83749fcef37db6fbb8f0a4c284bd682d18c7c8c4d4e82cba
MD5 0efc3d909389ea6f6f1443858cdea0a0
BLAKE2b-256 3bcb8cc4368978995e8a5606dd2c763db4a319605ad9e20a5053e47863170626

See more details on using hashes here.

Provenance

The following attestation bundles were made for hvbrowser-0.3.0.tar.gz:

Publisher: publish.yml on Kuan-Lun/hvbrowser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hvbrowser-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: hvbrowser-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 48.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hvbrowser-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ae9520c09c1b0ebfd6dd1531e8ead584b7166083c9ce29f91dc1f3e1094e3a4
MD5 4695b6fa790ae09e3bbb29520cf6e79e
BLAKE2b-256 7cf9886884966f6064c95044b49256e357d43db1613b7d52d2aa40a56385b28e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hvbrowser-0.3.0-py3-none-any.whl:

Publisher: publish.yml on Kuan-Lun/hvbrowser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.10.2

2 files

0.10.1

2 files

0.9.8

2 files

0.9.7

2 files

0.9.6

2 files

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.8.0

2 files

0.7.3

2 files

0.7.2

2 files

0.7.0

2 files

0.6.1

2 files

0.5.0

2 files

0.4.0

2 files

This release

0.3.0 This release

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page