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.2.0.tar.gz (1.3 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.2.0-py3-none-any.whl (131.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pobapi_extended-1.2.0.tar.gz
Algorithm Hash digest
SHA256 324b770bd75dcc9be386f158f68c6f2a2b5827937dad7bf605d189c3ea03584a
MD5 70f4bfd9ede536da630aa2e41ce1b935
BLAKE2b-256 38401282c48e80d5451a3409d302db6e2d81f54f52c7f8b601f9d2e75963a8b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pobapi_extended-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93eb5aa26a1398353746b8bc8bd5813c895e98688f297c652cffe3177bf373e3
MD5 76a5f24e5fe47d632a8b477c705fb824
BLAKE2b-256 f2ee6954f8d360772319b7a7a8d7ca0b7f574cf109955164179f87ed3a5e4a7b

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