Skip to main content

urbandictionary-py

Simple Python wrapper for Urban Dictionary API.

Installation

With PyPI:

pip install udpy

Usage

UrbanDefinition

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

Examples

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:
	print(d.definition)

>	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:
	print(d)

>	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.

Metadata

Release files for udpy 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for udpy 2.0.0
File Size Uploaded Provenance Actions
udpy-2.0.0.tar.gz 3.5 kB Without provenance Details for udpy-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for udpy 2.0.0
File Interpreter ABI Platform Actions
udpy-2.0.0-py3-none-any.whl Python 3 none any Details for udpy-2.0.0-py3-none-any.whl

Total release size: 7.8 kB

Release files / udpy-2.0.0.tar.gz

Download URL udpy-2.0.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d0026abf16b2a616bd9a10ceb0d3d2a49b046aa53295fd6d2735ad051cc7271e
BLAKE2b-256 checksum
How to use checksums
306af042fa77b28e29ea59803816e14e43c16859341d2305b5fa07e0f5191413
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.1 Linux/5.4.24-1-MANJARO

Release files / udpy-2.0.0-py3-none-any.whl

Download URL udpy-2.0.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f1e45d346af1f63b648bbd06b9a44f5b930b8a7c8cc21ddada383ea3e26cb1b
BLAKE2b-256 checksum
How to use checksums
a8385e41a06a565915084bb8dddc6efa9c86f69d99dc9d6ebbb946773ba7d256
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.1 Linux/5.4.24-1-MANJARO

Security for udpy 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page