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-1.0.0b1.tar.gz (67.7 kB view details)

Uploaded Source

Built Distribution

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

xivlodestone-1.0.0b1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file xivlodestone-1.0.0b1.tar.gz.

File metadata

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

File hashes

Hashes for xivlodestone-1.0.0b1.tar.gz
Algorithm Hash digest
SHA256 356c653deefc10692c99af2d82d0560696d54422a4f3715ae82d3b8f8229e5ce
MD5 346a3c4638b592381fddb541a47a1215
BLAKE2b-256 161c572e8c9fd41ca133a8ecd92de6ccdcf2af3f1f45087c5ecfae48a926cce1

See more details on using hashes here.

File details

Details for the file xivlodestone-1.0.0b1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for xivlodestone-1.0.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f976f12e7666201a30d9850a7c911109e3f8c05ed5e6e65ec49d98cdc389ce7
MD5 9603a49f0addd712faaa3a21601314c0
BLAKE2b-256 cde4569c593758f16060b911f760989a22d2e0dd60b68e40e95749435cdeec69

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