Skip to main content

API for Path Of Building's build sharing format.

Project description

Path of Building API Extended (pobapi-extended)

Maintenance Read the Docs PyPI - Python Version PyPI - Version PyPI - Status PyPI - Format License Code style: ruff

API for Path of Building's build sharing format for builds in Path of Exile.

Background

Path Of Building API provides a comprehensive toolbox for processing Path of Building pastebins. It is aimed at community developers:

  • looking to add Path of Building functionality to their apps.
  • upgrading from existing solutions.

Benefits from using this library:

  • Focus on your app's core competences
  • Spend your free time on unique features
  • Backwards-compatibility as PoB's export format changes
  • Tested and secure codebase

Features

  • Look up and process:
    • Character stats (DPS, life, etc.)
    • Skill trees
    • Skills, skill groups and links
    • Gear and item sets
    • Path of Building configuration settings
    • Build author's notes
  • Exposes all of Path of Building's relevant stats and attributes in a simple and pythonic way.
  • Automatically calculates mod values on theorycrafted items.
  • Low memory footprint through dataclasses and dynamically generated attributes.

Installation

pip install pobapi-extended

Or using uv:

uv add pobapi-extended

Dependencies

Note: The library previously used dataslots and unstdlib, but has been migrated to standard Python dataclasses and custom decorators (Python 3.12+).

Usage

import pobapi

# From pastebin URL
url = "https://pastebin.com/bQRjfedq"
build = pobapi.from_url(url)
print(build.ascendancy_name)  # Elementalist
print(build.stats.life)  # 6911

# From import code
import_code = "your-import-code-here"
build = pobapi.from_import_code(import_code)

# Access build data
print(build.class_name)
print(build.level)
print(build.bandit)

# Access stats
print(build.stats.total_dps)
print(build.stats.life)
print(build.stats.mana)

# Access items
for item in build.items:
    if item.name == "Inpulsa's Broken Heart":
        print(item)

# Access skills
for skill_group in build.skill_groups:
    print(skill_group.label)
    for ability in skill_group.abilities:
        print(f"  {ability.name} (Level {ability.level})")

# Access skill tree
tree = build.active_skill_tree
print(f"Tree URL: {tree.url}")
print(f"Nodes: {len(tree.nodes)}")

# Access configuration
config = build.config
print(f"Enemy level: {config.enemy_level}")
print(f"Onslaught: {config.onslaught}")

Async Support

For async applications, use the factory with an async HTTP client:

import aiohttp
from pobapi.factory import BuildFactory
from pobapi.interfaces import AsyncHTTPClient

class AioHTTPClient(AsyncHTTPClient):
    async def get(self, url: str, timeout: float = 6.0) -> str:
        async with aiohttp.ClientSession() as session:
            async with session.get(url, timeout=timeout) as response:
                return await response.text()

factory = BuildFactory(async_http_client=AioHTTPClient())
build = await factory.async_from_url("https://pastebin.com/...")

Caching

Caching is automatically enabled for:

  • Import code decoding (1 hour TTL)
  • Skill tree parsing (24 hours TTL)

You can manage the cache:

from pobapi import clear_cache, get_cache

# Get cache statistics
cache = get_cache()
stats = cache.stats()

# Clear cache
clear_cache()

Error Handling

The library provides custom exceptions:

from pobapi.exceptions import (
    InvalidImportCodeError,
    InvalidURLError,
    NetworkError,
    ParsingError,
    ValidationError,
)

try:
    build = pobapi.from_url("invalid-url")
except InvalidURLError as e:
    print(f"Invalid URL: {e}")
except NetworkError as e:
    print(f"Network error: {e}")

Documentation

Full documentation available at Read the Docs.

License

MIT License - see LICENSE.txt for details.

Roadmap

  • Support corruptions
  • Support enchantments

Feedback

Please open a GitHub issue in this repository for any feedback you may have.

Contributing

Setup repository using Git (recommended):

git clone https://github.com/ppoelzl/PathOfBuildingAPI.git

Install dev dependencies using uv (recommended):

uv sync

Or using pip:

pip install -e ".[dev]"

If you have any questions about contributing, please open a GitHub issue. Pull requests are gladly accepted. Check out the Developer Guide for more info.

Project details


Download files

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

Source Distribution

pobapi_extended-1.3.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

pobapi_extended-1.3.0-py3-none-any.whl (138.3 kB view details)

Uploaded Python 3

File details

Details for the file pobapi_extended-1.3.0.tar.gz.

File metadata

  • Download URL: pobapi_extended-1.3.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for pobapi_extended-1.3.0.tar.gz
Algorithm Hash digest
SHA256 cd12586c0cf9e4ff340e7bc8d536b7134e3a3dcb91b22094b2827bd30181b53c
MD5 61d63369433ada34184253d573dca67d
BLAKE2b-256 3f3f728086917a628d41dff570e83f3a0c901eceed3d09672df99c3a6bb65ab1

See more details on using hashes here.

File details

Details for the file pobapi_extended-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pobapi_extended-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36bc81fe95250d4e9d69d0a4b636a2e8cbbcaabd2725832af847aa2f6360e63d
MD5 2b1142e4ddbf75183e581b6669a598bc
BLAKE2b-256 fcd923a07bfa373471cba419a789ddedd6d8eaa59d9b9ec4fb410b1c4038f114

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page