Skip to main content

A simple wrapper for the Urban Dictionary API

Project description

CodeFactor grade Read the Docs build status Project version on PyPI Python versions supported on PyPI

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

pyud Documentation

License

GNU GPL v3

Project details


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)

Uploaded Source

Built Distribution

pyud-1.0.1-py3-none-any.whl (18.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page