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

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-0.1.0.tar.gz (18.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-0.1.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tibia.py-0.1.0.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for tibia.py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cf7f84fed715b445e73fac353d0302ac6e41a0b338d48ccea133a5b96f505e81
MD5 c374fc2b8a8d62dca5dbfc4d21e761a8
BLAKE2b-256 8b3e741598ac1fd204d25ce0d74e0b317ed7a9ea7008248564e37bd605f21fcb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tibia.py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for tibia.py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b36149e125339a64250b72eab0ac36699ded4df16e54c97d80d82b9db28d2b1
MD5 42c25f42727e9f2698fd495c8bad131c
BLAKE2b-256 63440ede66750df42178cbbb00afdcae605abcde52573e4534f0c720a6182d81

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