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.
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
Metadata
Release files for tibia.py 6.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tibia_py-6.4.0.tar.gz | 119.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tibia_py-6.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 234.7 kB
Release files / tibia_py-6.4.0.tar.gz
| Download URL | tibia_py-6.4.0.tar.gz |
|---|---|
| Size | 119.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62e1d289ca359b587f9e37df71ac3fa2437c4311fd053281c0c8707c2568770c
|
|
BLAKE2b-256 checksum How to use checksums |
08d064d89a29a3df67333f8b3b31d4f56809ec965f1b2cca5059c5856b5f857f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / tibia_py-6.4.0-py3-none-any.whl
| Download URL | tibia_py-6.4.0-py3-none-any.whl |
|---|---|
| Size | 115.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89a36ba77e8a83bd37a5f0b0ea6b1b962cfde521e405bd90a54ff0e3d3b60963
|
|
BLAKE2b-256 checksum How to use checksums |
69337488772170a129a050c19af17af6f8bdef74de996d26d36aabd87110413c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|