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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_urbandict-0.3.17.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_urbandict-0.3.17-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file python_urbandict-0.3.17.tar.gz.

File metadata

  • Download URL: python_urbandict-0.3.17.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for python_urbandict-0.3.17.tar.gz
Algorithm Hash digest
SHA256 3affd6e24a4c55ae3d66ab6017ec3e218505b3fb434d9f2199a5fefdd73014cf
MD5 361f339e5737f14b1c31330b3d4947d9
BLAKE2b-256 877103f52435629532866673b7b83c376b8986f39d1d7cc88680c8a3908b97a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_urbandict-0.3.17.tar.gz:

Publisher: python-publish.yml on atbuy/pyurbandict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_urbandict-0.3.17-py3-none-any.whl.

File metadata

File hashes

Hashes for python_urbandict-0.3.17-py3-none-any.whl
Algorithm Hash digest
SHA256 2da95a4d9eaae42f48eecfe1e8171b0fc49269d3db1f5c841db1d8b05f45241f
MD5 0cef1172b44c968add26faefa9a02f6f
BLAKE2b-256 8adeb9c00ce0bd7ac7a016a6d295a0c334ba88d8efc435bbcb79147dcb314ecd

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_urbandict-0.3.17-py3-none-any.whl:

Publisher: python-publish.yml on atbuy/pyurbandict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.17 This release

2 files

0.3.15

2 files

0.3.14

2 files

0.3.13

2 files

0.3.12

2 files

0.3.11

2 files

0.3.10

2 files

0.3.9

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.1.2

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page