Skip to main content

Urban dictionary API wrapper for Python

Project description


Simple Python wrapper for Urban Dictionary API.


With PyPI:

pip install udpy



This module defines UrbanDefinition, an object to represent each Urban Dictionary definition. UrbanDefinition has the following accessible attributes:

  • word: the word being defined,
  • definition: the word's definition,
  • example: usage example,
  • upvotes: number of upvotes on Urban Dictionary,
  • downvotes: number of downvotes on Urban Dictionary


Create client:

from udpy import UrbanClient

client = UrbanClient()

Lookup by word:

defs = client.get_definition('netflix and chill')

>	[List of UrbanDef objects]

Lookup random words:

rand = client.get_random_definition()

>	[List of UrbanDef objects]

Read definitions:

for d in defs:

>	It means that you are going to go over ...
>	code for two people going to each others ...
> 	<other Netflix and Chill definitions> ...

UrbanDefinition string representation:

for d in defs:

>	Netflix and Chill: It means that you are going to go over to your par... (21776, 7750)
>	netflix and chill: code for two people going to each others houses an... (8056, 2622)
>	<word>: <definition trimmed to 50 characters> (<upvotes>, <downvotes>)

Also it has asynchronous interface. Just use AsyncUrbanClient and add awaits.

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

udpy-2.0.0.tar.gz (3.5 kB view hashes)

Uploaded source

Built Distribution

udpy-2.0.0-py3-none-any.whl (4.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page