Skip to main content

python-urbandict

version versions Python package codecov

This is a python project, that fetches definitions of words from urban dictionary's public API.

Future additions. PRs are always welcome :)

  • Calculate ratio of thumbs_up and thumbs_down and decide the probability of a correct definition.

Installation

Python 3.9 or higher is required

To install the library you can use the following command:

# Linux/MacOS
python3 -m pip install --upgrade python-urbandict

# Windows
py -3 -m pip install --upgrade python-urbandict

Or just try:

pip install python-urbandict

Quick Example

You can create an instance of the UrbanDict class and pass a word to it. After that you can use the search method that will retrieve the definitions from UrbanDictionary. If you want to you can also leave the word attribute empty, in which case a random word is selected by UrbanDictionary.

from pyurbandict import UrbanDict

word = UrbanDict("python")
results = word.search()
print(results[0])

>>> Definition(
    word='python',
    definition='The best thing to happen to [Computer Science] students in a data and [file] structures or [algorithms] class.',
    example='Joe: "Man...I spent a week coding that [algorithm] in C."\r\nMoe: "I got it [done in one] evening with [Python]. It works great."\r\nJoe: "Say, what? Where can I download that?"',
    author='TheNextBillGates',
    thumbs_up=243,
    thumbs_down=71,
    sound_urls=['https://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE7065a4ef810937cc16ae2b6e4b54b67d'],
    written_on='2010-03-24T05:24:18.000Z',
    permalink='http://python.urbanup.com/4826760',
    defid=4826760,
    current_vote=''
)

Links

Metadata

Release files for python-urbandict 0.3.18

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

Source distribution (sdist)

Source distribution for python-urbandict 0.3.18
File Size Uploaded Provenance
python_urbandict-0.3.18.tar.gz 4.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for python-urbandict 0.3.18
File Interpreter ABI Platform
python_urbandict-0.3.18-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / python_urbandict-0.3.18.tar.gz

Download URL python_urbandict-0.3.18.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d41eadaf72d8d0ba0b6711740f0f5decaebe53c8f604716fb6266be1f718b989
BLAKE2b-256 checksum
How to use checksums
30f6198c3c080049744c4e34e44bc7d55670b9032f5d1e611cb4a7a19a20752a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / python_urbandict-0.3.18-py3-none-any.whl

Download URL python_urbandict-0.3.18-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a2d411e6dd8b44a1c280b38a0f4d04492266e66bbee6e59b2426c5fdbd3a8c4
BLAKE2b-256 checksum
How to use checksums
52d720dd4f4fb54a77b94e9d38dec79723e5343a1f3ba13563ddc1f5ddfb8ed2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for python-urbandict 0.3.18

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for python_urbandict-0.3.18.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

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