python-urbandict


Namepython-urbandict JSON
Version 0.3.4 PyPI version JSON
download
home_pagehttps://github.com/atbuy/pyurbandict
SummaryPython wrapper for the Urban Dictionary API.
upload_time2024-04-03 00:19:02
maintainerNone
docs_urlNone
authoratbuy
requires_python<4.0,>=3.9
licenseMIT
keywords urban dictionary api wrapper python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # python-urbandict

[![version](https://img.shields.io/pypi/v/python-urbandict.svg)](https://pypi.org/project/python-urbandict/)
[![versions](https://img.shields.io/pypi/pyversions/python-urbandict.svg)](https://pypi.org/project/python-urbandict/)
[![Python package](https://github.com/Vitaman02/pyurbandict/actions/workflows/python-package.yml/badge.svg)](https://github.com/Vitaman02/pyurbandict/actions/workflows/python-package.yml)
[![codecov](https://codecov.io/gh/Vitaman02/pyurbandict/branch/main/graph/badge.svg?token=A244XBTUVH)](https://codecov.io/gh/Vitaman02/pyurbandict)

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.

```python
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
* [PyPi](https://pypi.org/project/python-urbandict/)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/atbuy/pyurbandict",
    "name": "python-urbandict",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "urban, dictionary, api, wrapper, python",
    "author": "atbuy",
    "author_email": "contact.atbuy@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ca/7c/d95d26925f609920314f89d277c8618b15b15c44f15ffaacc37f08bde3c3/python_urbandict-0.3.4.tar.gz",
    "platform": null,
    "description": "# python-urbandict\n\n[![version](https://img.shields.io/pypi/v/python-urbandict.svg)](https://pypi.org/project/python-urbandict/)\n[![versions](https://img.shields.io/pypi/pyversions/python-urbandict.svg)](https://pypi.org/project/python-urbandict/)\n[![Python package](https://github.com/Vitaman02/pyurbandict/actions/workflows/python-package.yml/badge.svg)](https://github.com/Vitaman02/pyurbandict/actions/workflows/python-package.yml)\n[![codecov](https://codecov.io/gh/Vitaman02/pyurbandict/branch/main/graph/badge.svg?token=A244XBTUVH)](https://codecov.io/gh/Vitaman02/pyurbandict)\n\nThis is a python project, that fetches definitions of words from urban dictionary's public API.\n\nFuture additions. PRs are always welcome :)\n* Calculate ratio of `thumbs_up` and `thumbs_down` and decide the probability of a correct definition.\n\n# Installation\n\n*Python 3.9 or higher is required*\n\nTo install the library you can use the following command:\n\n```\n# Linux/MacOS\npython3 -m pip install --upgrade python-urbandict\n\n# Windows\npy -3 -m pip install --upgrade python-urbandict\n```\n\nOr just try:\n\n```\npip install python-urbandict\n```\n\n# Quick Example\n\nYou 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.\nIf you want to you can also leave the word attribute empty, in which case a random word is selected by UrbanDictionary.\n\n```python\nfrom pyurbandict import UrbanDict\n\nword = UrbanDict(\"python\")\nresults = word.search()\nprint(results[0])\n\n>>> Definition(\n    word='python',\n    definition='The best thing to happen to [Computer Science] students in a data and [file] structures or [algorithms] class.',\n    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?\"',\n    author='TheNextBillGates',\n    thumbs_up=243,\n    thumbs_down=71,\n    sound_urls=['https://api.twilio.com/2008-08-01/Accounts/ACd09691b82112e4b26fce156d7c01d0ed/Recordings/RE7065a4ef810937cc16ae2b6e4b54b67d'],\n    written_on='2010-03-24T05:24:18.000Z',\n    permalink='http://python.urbanup.com/4826760',\n    defid=4826760,\n    current_vote=''\n)\n```\n\n# Links\n* [PyPi](https://pypi.org/project/python-urbandict/)\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python wrapper for the Urban Dictionary API.",
    "version": "0.3.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/atbuy/pyurbandict/issues",
        "CI/CD": "https://github.com/atbuy/pyurbandict/actions",
        "Homepage": "https://github.com/atbuy/pyurbandict",
        "Repository": "https://github.com/atbuy/pyurbandict",
        "Source Code": "https://github.com/atbuy/pyurbandict"
    },
    "split_keywords": [
        "urban",
        " dictionary",
        " api",
        " wrapper",
        " python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "409471bfeae1d568912353c5f389cbc89a870a386af0eb5898a2abd8c4c0079f",
                "md5": "c1422098488beb62542bd3babd981043",
                "sha256": "1cf21c95be858325e7d391cc406d76d2c3e398391e75af61035f9a95c1ddc654"
            },
            "downloads": -1,
            "filename": "python_urbandict-0.3.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c1422098488beb62542bd3babd981043",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 5179,
            "upload_time": "2024-04-03T00:19:01",
            "upload_time_iso_8601": "2024-04-03T00:19:01.284175Z",
            "url": "https://files.pythonhosted.org/packages/40/94/71bfeae1d568912353c5f389cbc89a870a386af0eb5898a2abd8c4c0079f/python_urbandict-0.3.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca7cd95d26925f609920314f89d277c8618b15b15c44f15ffaacc37f08bde3c3",
                "md5": "5aa81660eec33a215cc294250924e8d6",
                "sha256": "d66e0bff0981eb9f4354fe2b62b4a66961b89476a606d7ce45dc3061b6368a20"
            },
            "downloads": -1,
            "filename": "python_urbandict-0.3.4.tar.gz",
            "has_sig": false,
            "md5_digest": "5aa81660eec33a215cc294250924e8d6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 3263,
            "upload_time": "2024-04-03T00:19:02",
            "upload_time_iso_8601": "2024-04-03T00:19:02.507406Z",
            "url": "https://files.pythonhosted.org/packages/ca/7c/d95d26925f609920314f89d277c8618b15b15c44f15ffaacc37f08bde3c3/python_urbandict-0.3.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-03 00:19:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "atbuy",
    "github_project": "pyurbandict",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "python-urbandict"
}
        
Elapsed time: 0.27551s