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.3.0a1.tar.gz (63.0 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.3.0a1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xivlodestone-0.3.0a1.tar.gz
Algorithm Hash digest
SHA256 a1cfd93c5409fd519c2f5b43d0562eb7f3e62abd9cf8a75350e98cb2b5dbe666
MD5 5762f8bc86829deb5be36683e3d1773a
BLAKE2b-256 efc754c5b57382fcd3b8a4e5cc7aed22cf71ad96cdd97eba3949f84bf9b4a7a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xivlodestone-0.3.0a1-py3-none-any.whl
  • Upload date:
  • Size: 14.6 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.3.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5afc3e11f16a333c4f885716c77bdf5276dad566cfe740133c567c3da70848d
MD5 aee9161962f11ca9a984292ab13beaa7
BLAKE2b-256 afa070611180c94c1b50f4067c7d55f92d64e39fd82342fd6efab0ffa77a14d2

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