Skip to main content

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

Project description

xivlodestone

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"Birthday: {character.birthday}")
    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.1.0a1.tar.gz (37.8 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.1.0a1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xivlodestone-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 d1e821252b407bad9d4b0b8b2dbe6e79f65bca4dfa7d56c8a694a934981fdce2
MD5 d2817dcf31bb8bdec9ce85458b9149bc
BLAKE2b-256 7799c39364396f0c730f63bc18d6ff2d82952118fa3acdf9bbbbc6d14c0f8b45

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xivlodestone-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 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.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 23f347095d692c6a050dd9e691f137115b6a8fd6b8011482c9409a10c909bab5
MD5 d7e302ece3a9affcfde6208b609a9f3e
BLAKE2b-256 bf23183fc65d68a703ad92767f168e511db1c41c43dc06f853b12bf88b50962d

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