A simple wrapper for the Urban Dictionary API
Project description
A simple wrapper for the Urban Dictionary API in Python.
Features
Synchronous and asynchronous clients for the API
Definition objects for object-style access to definition attributes, and includes all fields
Full coverage of the known API
Requirements
Python 3.5.3 or higher. Python 2 is not supported.
aiohttp, version 3.6.2
Installing
You can install directly from PyPI:
python3 -m pip install pyud
On Windows this is:
py -3 -m pip install pyud
Quick Examples
Synchronous Example
import pyud
ud = pyud.Client()
definitions = ud.define("hello")
print(definitions[0].word) # Outputs "hello"
Asynchronous Example
import asyncio
import pyud
async def example():
ud = pyud.AsyncClient()
definitions = await ud.define("hello")
print(definitions[0].word) # Outputs "hello"
loop = asyncio.get_event_loop()
loop.run_until_complete(example())
Documentation
License
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
pyud-1.0.1.tar.gz
(17.3 kB
view hashes)
Built Distribution
pyud-1.0.1-py3-none-any.whl
(18.4 kB
view hashes)