Skip to content

Commit 6faa1eb

Browse files
committed
Added simple async example
1 parent babcb16 commit 6faa1eb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/intro.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ This allows you to use any networking module to obtain the data, and use the lib
5858
character = tibiapy.Character.from_content(content)
5959
return character
6060
61+
On the other hand, using the built-in asynchronous client you can do the fetching and parsing in one step:
62+
63+
.. code-block:: python
64+
65+
import asyncio
66+
import tibiapy
67+
68+
async def main():
69+
client = tibiapy.Client()
70+
character = await client.fetch_character("Galarzaa Fidera")
71+
72+
if __name__ == "__main__":
73+
asyncio.get_event_loop().run_until_complete(main())
74+
6175
6276
Supported Sections
6377
==================

0 commit comments

Comments
 (0)