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.
Under development
This API is still under early development, meaning breaking changes might be introduced at any time without notice. Once the first release has been done, semantic versioning guidelines will be followed.
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
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.0a4.tar.gz
(8.9 kB
view hashes)
Built Distribution
tibia.py-0.1.0a4-py3-none-any.whl
(11.4 kB
view hashes)
Close
Hashes for tibia.py-0.1.0a4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 733fecdb55e59fd03a03d6df19f1726e9fda340c4f355b4437741679546a117b |
|
MD5 | b045fe9b313601788a12c48551e38ec5 |
|
BLAKE2b-256 | 75c5d8457d2a07fba8adeeb5dd1be1725ce1de07d610edb0e12365c4f5809723 |