Skip to main content

API that parses website content into python data.

Project description

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.

Travis (.org) coverage report PyPI PyPI - Python Version PyPI - License

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.

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

In order to use this library, you need to use an external library (requests, aiohttp) to fetch content from the website.

import tibiapy

# Asynchronously
import aiohttp

async def get_character(name):
  url = tibiapy.Character.get_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.Character.get_url(name)

  r = requests.get(url)
  content = r.text()
  character = tibiapy.Character.from_content(content)
  return character

Documentation

https://tibiapy.readthedocs.io/

Project details


Release history Release notifications | RSS feed

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-1.1.3.tar.gz (40.8 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-1.1.3-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

Details for the file tibia.py-1.1.3.tar.gz.

File metadata

  • Download URL: tibia.py-1.1.3.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.1

File hashes

Hashes for tibia.py-1.1.3.tar.gz
Algorithm Hash digest
SHA256 affec98b12a462b8e3b4705d75cfca0bef846151aaa647c726ca0f6bb9364d1f
MD5 a1e80ac08fb3f2c3b9c2fa93a653f288
BLAKE2b-256 e0675965c5b2d8ff36d0d294ba211bfc3a1c04e93f9391e9062771be62ac0c32

See more details on using hashes here.

File details

Details for the file tibia.py-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: tibia.py-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 48.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.1

File hashes

Hashes for tibia.py-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e0d1ad81536c065e286167a73792b3d77a0ef3f98f2073fc99370845fb5c7210
MD5 9af48b1306ba17f5970b328adc5b6857
BLAKE2b-256 43a4b42a5323e9061b58d0e2c9b51fd18073887d7466196f562af398702dfb57

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