Skip to main content

xivlodestone is a Python library that interacts with the FFXIV Lodestone website.

Project description

Overview

xivlodestone is a Python library that interacts with the Lodestone website.

Its primary focus is to provide developers with a simple, easy-to-use interface for retrieving up-to-date character information.

It currently supports searching for and retrieving character and free company details. Additional features may be added in the future.

As this project is currently in alpha testing, it is not guaranteed to be stable or feature-complete. Breaking changes may occur anytime, and the API may change without notice.

Installation

You can install this library using pip:

pip install xivlodestone

Usage

You can use the search_character method to search for a character. With a correctly spelled character name and world, this is usually a single character.

Otherwise, you will get a list of characters that match the search criteria.

import asyncio
from xivlodestone import LodestoneScraper

async def search_example():
    lodestone = LodestoneScraper()
    async for character in lodestone.search_characters("Yoshi'p Sampo", "Mandragora"):
        print(f"Found {character.name} from {character.world}")

    # Or if you need to pre-populate the results into a list
    characters = [c async for c in lodestone.search_characters("Yoshi'p Sampo", "Mandragora")]

asyncio.run(search_example())

By default, the library will only fetch a maximum of 50 (the first page of) results.

You can set the limit parameter to a higher value to fetch more results or None to fetch the maximum number of results (up to 1,000).

Search results will only provide basic information about a character, such as their name, world, and avatar.

You can use the get_character method to fetch more details about the character.

from xivlodestone import LodestoneScraper

async def get_character_example():
    lodestone = LodestoneScraper()
    characters = [c async for c in lodestone.search_characters("Yoshi'p Sampo", "Mandragora")]
    character = await lodestone.get_character(characters[0])  # Also accepts a character ID
    print(f"{character.name} from {character.world}")
    print(f"Nameday: {character.nameday}")
    print(f"Bio: {character.bio}")
    if character.free_company:
        print(f"Free Company: {character.free_company.name}")

A common use case for scraping a character’s lodestone profile page is verifying a user’s ownership.

This is often done by asking the user to insert a temporary verification code into their character’s bio section and then scraping their profile page to verify it.

With xivlodestone, this can be done with just a few lines of code:

from xivlodestone import LodestoneScraper

async def verify_character_bio(character_id: int, verification_code: str):
    lodestone = LodestoneScraper()
    character = await lodestone.get_character(character_id)
    if verification_code in character.bio:

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

xivlodestone-0.4.0a1.tar.gz (63.1 kB view details)

Uploaded Source

Built Distribution

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

xivlodestone-0.4.0a1-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file xivlodestone-0.4.0a1.tar.gz.

File metadata

  • Download URL: xivlodestone-0.4.0a1.tar.gz
  • Upload date:
  • Size: 63.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for xivlodestone-0.4.0a1.tar.gz
Algorithm Hash digest
SHA256 15cc6bdeb07542b490962f5867caab2383bf0bec5545d116a8f8af4141bc22df
MD5 e89b726b8075f7d4fb03f1af728c5b79
BLAKE2b-256 0a223533fa4980b3d735b1a1e313a539a32a2ee7926955d8ad6fb80906cba431

See more details on using hashes here.

File details

Details for the file xivlodestone-0.4.0a1-py3-none-any.whl.

File metadata

  • Download URL: xivlodestone-0.4.0a1-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for xivlodestone-0.4.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 00214f1d742e740363b59fb00764c06ec592cb1dcbfc2e088de5e09ddda92219
MD5 737b9d15971063a1c542b4b2aca761ad
BLAKE2b-256 a1f7190db51e6faf78ff529c27d6fd9b8ea4405a5552ffe9b8f3262c4ab5a632

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