Skip to main content

Tibia.py

An API to parse Tibia.com content into object oriented data.

No fetching is done by this module, you must provide the html content.

PyPI GitHub commits since latest release (branch) PyPI - Python Version PyPI - License PyPI - Downloads

Code Smells Coverage Lines of Code Reliability Rating Technical Debt Maintainability Rating

Features:

  • Converts data into well-structured Python objects.
  • Type consistent attributes.
  • All objects can be converted to JSON strings.
  • Can be used with any networking library.
  • Support for characters, guilds, houses and worlds, tournaments, forums, etc.

Installing

Install and update using pip

pip install tibia.py

Installing the latest version form GitHub

pip install git+https://github.com/Galarzaa90/tibia.py.git -U

Usage

This library is composed of two parts, parsers and an asynchronous request client.

The asynchronous client (tibiapy.Client) contains methods to obtain information from Tibia.com.

The parsing methods allow you to get Python objects given the html content of a page.

import tibiapy

# Asynchronously
import aiohttp

async def get_character(name):
    url = tibiapy.urls.get_character_url(name)

    async with aiohttp.ClientSession() as session:
        async with session.get(url) as resp:
            content = await resp.text()
    character = tibiapy.Character.from_content(content)
    return character

# Synchronously
import requests

def get_character_sync(name):
    url = tibiapy.urls.get_character_url(name)
    
    r = requests.get(url)
    content = r.text
    character = tibiapy.Character.from_content(content)
    return character

Running from Docker

A ready to use HTTP server is also available as a Docker image, allowing you to integrate tibia.py in projects using other languages other than Python.

The image can be pulled from Docker Hub:

docker pull galarzaa90/tibia.py

Alternatively, the image can be built from the root of the project's source.

docker build . -t tibia.py:local

To run the image:

docker run -p 8000:8000 --rm -ti tibia.py:local

API documentation will be available at: http://localhost:8000/docs.

Documentation

https://tibiapy.readthedocs.io/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tibia_py-6.4.0.tar.gz (119.4 kB view details)

Uploaded Source

Built Distribution

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

tibia_py-6.4.0-py3-none-any.whl (115.3 kB view details)

Uploaded Python 3

File details

Details for the file tibia_py-6.4.0.tar.gz.

File metadata

  • Download URL: tibia_py-6.4.0.tar.gz
  • Upload date:
  • Size: 119.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tibia_py-6.4.0.tar.gz
Algorithm Hash digest
SHA256 62e1d289ca359b587f9e37df71ac3fa2437c4311fd053281c0c8707c2568770c
MD5 8e0766d5980897f80ce492ccbc922e3b
BLAKE2b-256 08d064d89a29a3df67333f8b3b31d4f56809ec965f1b2cca5059c5856b5f857f

See more details on using hashes here.

File details

Details for the file tibia_py-6.4.0-py3-none-any.whl.

File metadata

  • Download URL: tibia_py-6.4.0-py3-none-any.whl
  • Upload date:
  • Size: 115.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tibia_py-6.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89a36ba77e8a83bd37a5f0b0ea6b1b962cfde521e405bd90a54ff0e3d3b60963
MD5 3eaad16c7b46cb5b6698f6a1d1c464a0
BLAKE2b-256 69337488772170a129a050c19af17af6f8bdef74de996d26d36aabd87110413c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

6.4.0 This release

2 files

6.3.0

2 files

6.2.0

2 files

6.1.0

2 files

6.0.4

2 files

6.0.3

2 files

6.0.2.post2

2 files

6.0.2.post1

2 files

6.0.2

2 files

6.0.1

2 files

6.0.0

2 files

5.7.1

2 files

5.7.0

1 file

5.6.1.post1

2 files

5.6.1

2 files

5.6.0

2 files

5.5.2

2 files

5.5.1

2 files

5.5.0

2 files

5.4.0

2 files

5.3.0

2 files

5.2.1

2 files

5.2.0

2 files

5.1.0

2 files

5.0.1.post0

2 files

5.0.1

2 files

5.0.0

2 files

4.1.7

2 files

4.1.6

2 files

4.1.5

2 files

4.1.4

2 files

4.1.3

2 files

4.1.2

2 files

4.1.1

2 files

4.1.0

2 files

4.0.0

2 files

3.7.1

2 files

3.7.0

2 files

3.6.5

2 files

3.6.4

2 files

3.6.3

2 files

3.6.2

2 files

3.6.1

2 files

3.6.0

2 files

3.5.7

2 files

3.5.6

2 files

3.5.5

2 files

3.5.4

2 files

3.5.3

2 files

3.5.2

2 files

3.5.1

2 files

3.5.0

2 files

3.4.0

2 files

3.3.0

2 files

3.2.2

2 files

3.2.1

2 files

3.2.0

2 files

3.1.0

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.5.1

2 files

2.5.0

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

2 files

2.4.0

2 files

2.3.4

2 files

2.3.3

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.6

2 files

2.2.5

2 files

2.2.4

2 files

2.2.3

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page