Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

API to parse tibia.com content into python objects.

License

NotificationsYou must be signed in to change notification settings

Galarzaa90/tibia.py

Repository files navigation

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

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

PyPIGitHub commits since latest release (branch)PyPI - Python VersionPyPI - LicensePyPI - Downloads

Code SmellsCoverageLines of CodeReliability RatingTechnical DebtMaintainability 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.

importtibiapy# Asynchronouslyimportaiohttpasyncdefget_character(name):url=tibiapy.urls.get_character_url(name)asyncwithaiohttp.ClientSession()assession:asyncwithsession.get(url)asresp:content=awaitresp.text()character=tibiapy.Character.from_content(content)returncharacter# Synchronouslyimportrequestsdefget_character_sync(name):url=tibiapy.urls.get_character_url(name)r=requests.get(url)content=r.textcharacter=tibiapy.Character.from_content(content)returncharacter

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 fromDocker 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/

About

API to parse tibia.com content into python objects.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp