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

This version

1.1.1

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.1.tar.gz (40.5 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.1-py3-none-any.whl (48.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tibia.py-1.1.1.tar.gz
  • Upload date:
  • Size: 40.5 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.1.tar.gz
Algorithm Hash digest
SHA256 badf5ec62421566ab2a22e422a1c76866fd27068a408b758298fdc17e06c9cff
MD5 4bbf52e507b7c63c66c3d1d602fb76f1
BLAKE2b-256 82a13a65d2ac306f76e9089b3758cc01bb6d8160570ec12e5208494793d9e58a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tibia.py-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 48.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73a4a96e1bfd9ff7fa372c9c88e588d8753897865ec9c9ce114cbab54e2d5266
MD5 4ba075bccc45f35f9d2e23a469c93419
BLAKE2b-256 ff2e3f27b8ecea18695836a1b864fd5b7753d801d7ea1e123afa1985453cba2c

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