PyMultiDictionary


NamePyMultiDictionary JSON
Version 1.2.5 PyPI version JSON
download
home_pagehttps://github.com/ppizarror/PyMultiDictionary
SummaryPyMultiDictionary is a Dictionary Module for Python 2 to get meanings, translations, synonyms and antonyms of words in 20 different languages
upload_time2024-11-04 01:11:35
maintainerNone
docs_urlNone
authorPablo Pizarro R.
requires_python<4,>=3.7
licenseMIT
keywords dictionary multi-language synonym antonym definition
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
=================
PyMultiDictionary
=================

.. image:: https://img.shields.io/badge/author-Pablo%20Pizarro%20R.-lightgray.svg
    :target: https://ppizarror.com
    :alt: @ppizarror

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
    :target: https://opensource.org/licenses/MIT
    :alt: License MIT

.. image:: https://img.shields.io/badge/python-3.7+-red.svg
    :target: https://www.python.org/downloads
    :alt: Python 3.7+

.. image:: https://badge.fury.io/py/PyMultiDictionary.svg
    :target: https://pypi.org/project/PyMultiDictionary
    :alt: PyPi package

.. image:: https://img.shields.io/github/actions/workflow/status/ppizarror/PyMultiDictionary/ci.yml?branch=master
    :target: https://github.com/ppizarror/PyMultiDictionary/actions/workflows/ci.yml
    :alt: Build status
    
.. image:: https://app.fossa.com/api/projects/git%2Bgithub.com%2Fppizarror%2FPyMultiDictionary.svg?type=shield
    :target: https://app.fossa.com/projects/git%2Bgithub.com%2Fppizarror%2FPyMultiDictionary?ref=badge_shield
    :alt: FOSSA Status

.. image:: https://codecov.io/gh/ppizarror/PyMultiDictionary/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/ppizarror/PyMultiDictionary
    :alt: Codecov

.. image:: https://img.shields.io/github/issues/ppizarror/PyMultiDictionary
    :target: https://github.com/ppizarror/PyMultiDictionary/issues
    :alt: Open issues

.. image:: https://img.shields.io/pypi/dm/PyMultiDictionary?color=purple
    :target: https://pypi.org/project/PyMultiDictionary
    :alt: PyPi downloads

.. image:: https://static.pepy.tech/personalized-badge/PyMultiDictionary?period=total&units=international_system&left_color=grey&right_color=lightgrey&left_text=total%20downloads
    :target: https://pepy.tech/project/PyMultiDictionary
    :alt: Total downloads
    
.. image:: https://img.shields.io/badge/buy%20me%20a-Ko--fi-02b9fe
    :target: https://ko-fi.com/ppizarror
    :alt: Buy me a Ko-fi

PyMultiDictionary is a dictionary module for Python 3+ to get meanings, translations,
synonyms and antonyms of words in 20 different languages. It uses educalingo.com,
synonym.com, and WordNet for getting meanings, translations, synonyms, and antonyms.

Supported languages
-------------------

- Bengali (**bn**)
- German (**de**)
- English (**en**)
- Spanish (**es**)
- French (**fr**)
- Hindi (**hi**)
- Italian (**it**)
- Japanese (**ja**)
- Javanese (**jv**)
- Korean (**ko**)
- Marathi (**mr**)
- Malay (**ms**)
- Polish (**pl**)
- Portuguese (**pt**)
- Romanian (**ro**)
- Russian (**ru**)
- Tamil (**ta**)
- Turkish (**tr**)
- Ukranian (**uk**)
- Chinese (**zh**)

Install Instructions
--------------------

PyMultiDictionary can be installed via pip, for both MacOS, Windows & Linux. Simply run:

.. code-block:: bash

    $> python3 -m pip install --upgrade PyMultiDictionary

Usage
-----

PyMultiDictionary can be utilized in 2 ways, either by creating a dictionary instance
which can take words as arguments or by creating a dictionary instance with a fixed
amount of words.

**Create a dictionary object**:

For example,

.. code-block:: python

    from PyMultiDictionary import MultiDictionary
    dictionary = MultiDictionary()

This will create a local instance of the MultiDictionary class, and now it can
be used to get meanings, translations, etc.

For **Meanings**,

.. code-block:: python

    print(dictionary.meaning('en', 'good'))

This will return a tuple containing the meanings of the word, in the format
*(word_type, word_meaning, word_wikipedia)*. For example, the above code will return:

.. code-block:: python

    (['Noun', 'Adjective', 'Exclamation'],
     'The first definition of good in the dictionary is having admirable  ...',
     'Good may refer to: ▪ Good and evil, the distinction between positive...')

All methods support other dictionaries, for example, 'wordnet' can be used
for English words.

.. code-block:: python

    from PyMultiDictionary import DICT_WORDNET
    dictionary = MultiDictionary()
    print(dictionary.meaning('en', 'good', dictionary=DICT_WORDNET))

Will return:

.. code-block:: python

    {
        'Noun': ['benefit', 'moral excellence or admirableness', ...],
        'Adjective': ['morally admirable', ...],
        'Adverb': [...]
    }

For **Synonyms**,

.. code-block:: python

    print(dictionary.synonym('es', 'Bueno'))

This will return a list containing the Synonyms of the word.

For **Antonyms**,

.. code-block:: python

    print(dictionary.antonym('en', 'Life'))

This will return a list containing the Antonyms of the word. Currently, only English is supported.

For **Translations**,

.. code-block:: python

    print(dictionary.translate('en', 'Range'))

This will return the word 'Range' translation in 20 different languages.
You can also extend the scope of the translations by providing a target language,
which will use Google Translate API, for example:

.. code-block:: python

    print(dictionary.translate('en', 'Range', to='ru'))

Alternatively, you can set a fixed number of words to the Dictionary Instance. This
is helpful if you want to get the meanings of some words quickly without any development need.

Example:

.. code-block:: python

    from PyMultiDictionary import MultiDictionary, DICT_EDUCALINGO

    dictionary=MultiDictionary('hotel', 'ambush', 'nonchalant', 'perceptive')
    dictionary.set_words_lang('en') # All words are English
    
    print(dictionary.get_meanings(dictionary=DICT_EDUCALINGO)) # This print the meanings of all the words
    print(dictionary.get_synonyms()) # Get synonyms list
    print(dictionary.get_antonyms()) # Get antonyms
    print(dictionary.get_translations()) # This will translate all words to over 20 languages
    print(dictionary.get_translations(to='ru')) # This will translate all words to Russian (if Google API is available)

Supported dictionaries
----------------------

- **DICT_EDUCALINGO**: Meaning, synonym, translation for all languages
- **DICT_SYNONYMCOM**: Synonyms and Antonyms (English)
- **DICT_THESAURUS**: Synonyms (English)
- **DICT_WORDNET**: Meanings (English)

There are many more dictionaries to come. Just contribute to this repo!

Author
------

`Pablo Pizarro R. <https://ppizarror.com>`_ | 2021 - 2024

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ppizarror/PyMultiDictionary",
    "name": "PyMultiDictionary",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.7",
    "maintainer_email": null,
    "keywords": "dictionary multi-language synonym antonym definition",
    "author": "Pablo Pizarro R.",
    "author_email": "pablo@ppizarror.com",
    "download_url": "https://files.pythonhosted.org/packages/33/89/cd0443263adc017ad6909195540f44ce410713db5825806604f178c548e0/pymultidictionary-1.2.5.tar.gz",
    "platform": "any",
    "description": "\r\n=================\r\nPyMultiDictionary\r\n=================\r\n\r\n.. image:: https://img.shields.io/badge/author-Pablo%20Pizarro%20R.-lightgray.svg\r\n    :target: https://ppizarror.com\r\n    :alt: @ppizarror\r\n\r\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\r\n    :target: https://opensource.org/licenses/MIT\r\n    :alt: License MIT\r\n\r\n.. image:: https://img.shields.io/badge/python-3.7+-red.svg\r\n    :target: https://www.python.org/downloads\r\n    :alt: Python 3.7+\r\n\r\n.. image:: https://badge.fury.io/py/PyMultiDictionary.svg\r\n    :target: https://pypi.org/project/PyMultiDictionary\r\n    :alt: PyPi package\r\n\r\n.. image:: https://img.shields.io/github/actions/workflow/status/ppizarror/PyMultiDictionary/ci.yml?branch=master\r\n    :target: https://github.com/ppizarror/PyMultiDictionary/actions/workflows/ci.yml\r\n    :alt: Build status\r\n    \r\n.. image:: https://app.fossa.com/api/projects/git%2Bgithub.com%2Fppizarror%2FPyMultiDictionary.svg?type=shield\r\n    :target: https://app.fossa.com/projects/git%2Bgithub.com%2Fppizarror%2FPyMultiDictionary?ref=badge_shield\r\n    :alt: FOSSA Status\r\n\r\n.. image:: https://codecov.io/gh/ppizarror/PyMultiDictionary/branch/master/graph/badge.svg\r\n    :target: https://codecov.io/gh/ppizarror/PyMultiDictionary\r\n    :alt: Codecov\r\n\r\n.. image:: https://img.shields.io/github/issues/ppizarror/PyMultiDictionary\r\n    :target: https://github.com/ppizarror/PyMultiDictionary/issues\r\n    :alt: Open issues\r\n\r\n.. image:: https://img.shields.io/pypi/dm/PyMultiDictionary?color=purple\r\n    :target: https://pypi.org/project/PyMultiDictionary\r\n    :alt: PyPi downloads\r\n\r\n.. image:: https://static.pepy.tech/personalized-badge/PyMultiDictionary?period=total&units=international_system&left_color=grey&right_color=lightgrey&left_text=total%20downloads\r\n    :target: https://pepy.tech/project/PyMultiDictionary\r\n    :alt: Total downloads\r\n    \r\n.. image:: https://img.shields.io/badge/buy%20me%20a-Ko--fi-02b9fe\r\n    :target: https://ko-fi.com/ppizarror\r\n    :alt: Buy me a Ko-fi\r\n\r\nPyMultiDictionary is a dictionary module for Python 3+ to get meanings, translations,\r\nsynonyms and antonyms of words in 20 different languages. It uses educalingo.com,\r\nsynonym.com, and WordNet for getting meanings, translations, synonyms, and antonyms.\r\n\r\nSupported languages\r\n-------------------\r\n\r\n- Bengali (**bn**)\r\n- German (**de**)\r\n- English (**en**)\r\n- Spanish (**es**)\r\n- French (**fr**)\r\n- Hindi (**hi**)\r\n- Italian (**it**)\r\n- Japanese (**ja**)\r\n- Javanese (**jv**)\r\n- Korean (**ko**)\r\n- Marathi (**mr**)\r\n- Malay (**ms**)\r\n- Polish (**pl**)\r\n- Portuguese (**pt**)\r\n- Romanian (**ro**)\r\n- Russian (**ru**)\r\n- Tamil (**ta**)\r\n- Turkish (**tr**)\r\n- Ukranian (**uk**)\r\n- Chinese (**zh**)\r\n\r\nInstall Instructions\r\n--------------------\r\n\r\nPyMultiDictionary can be installed via pip, for both MacOS, Windows & Linux. Simply run:\r\n\r\n.. code-block:: bash\r\n\r\n    $> python3 -m pip install --upgrade PyMultiDictionary\r\n\r\nUsage\r\n-----\r\n\r\nPyMultiDictionary can be utilized in 2 ways, either by creating a dictionary instance\r\nwhich can take words as arguments or by creating a dictionary instance with a fixed\r\namount of words.\r\n\r\n**Create a dictionary object**:\r\n\r\nFor example,\r\n\r\n.. code-block:: python\r\n\r\n    from PyMultiDictionary import MultiDictionary\r\n    dictionary = MultiDictionary()\r\n\r\nThis will create a local instance of the MultiDictionary class, and now it can\r\nbe used to get meanings, translations, etc.\r\n\r\nFor **Meanings**,\r\n\r\n.. code-block:: python\r\n\r\n    print(dictionary.meaning('en', 'good'))\r\n\r\nThis will return a tuple containing the meanings of the word, in the format\r\n*(word_type, word_meaning, word_wikipedia)*. For example, the above code will return:\r\n\r\n.. code-block:: python\r\n\r\n    (['Noun', 'Adjective', 'Exclamation'],\r\n     'The first definition of good in the dictionary is having admirable  ...',\r\n     'Good may refer to: \u25aa Good and evil, the distinction between positive...')\r\n\r\nAll methods support other dictionaries, for example, 'wordnet' can be used\r\nfor English words.\r\n\r\n.. code-block:: python\r\n\r\n    from PyMultiDictionary import DICT_WORDNET\r\n    dictionary = MultiDictionary()\r\n    print(dictionary.meaning('en', 'good', dictionary=DICT_WORDNET))\r\n\r\nWill return:\r\n\r\n.. code-block:: python\r\n\r\n    {\r\n        'Noun': ['benefit', 'moral excellence or admirableness', ...],\r\n        'Adjective': ['morally admirable', ...],\r\n        'Adverb': [...]\r\n    }\r\n\r\nFor **Synonyms**,\r\n\r\n.. code-block:: python\r\n\r\n    print(dictionary.synonym('es', 'Bueno'))\r\n\r\nThis will return a list containing the Synonyms of the word.\r\n\r\nFor **Antonyms**,\r\n\r\n.. code-block:: python\r\n\r\n    print(dictionary.antonym('en', 'Life'))\r\n\r\nThis will return a list containing the Antonyms of the word. Currently, only English is supported.\r\n\r\nFor **Translations**,\r\n\r\n.. code-block:: python\r\n\r\n    print(dictionary.translate('en', 'Range'))\r\n\r\nThis will return the word 'Range' translation in 20 different languages.\r\nYou can also extend the scope of the translations by providing a target language,\r\nwhich will use Google Translate API, for example:\r\n\r\n.. code-block:: python\r\n\r\n    print(dictionary.translate('en', 'Range', to='ru'))\r\n\r\nAlternatively, you can set a fixed number of words to the Dictionary Instance. This\r\nis helpful if you want to get the meanings of some words quickly without any development need.\r\n\r\nExample:\r\n\r\n.. code-block:: python\r\n\r\n    from PyMultiDictionary import MultiDictionary, DICT_EDUCALINGO\r\n\r\n    dictionary=MultiDictionary('hotel', 'ambush', 'nonchalant', 'perceptive')\r\n    dictionary.set_words_lang('en') # All words are English\r\n    \r\n    print(dictionary.get_meanings(dictionary=DICT_EDUCALINGO)) # This print the meanings of all the words\r\n    print(dictionary.get_synonyms()) # Get synonyms list\r\n    print(dictionary.get_antonyms()) # Get antonyms\r\n    print(dictionary.get_translations()) # This will translate all words to over 20 languages\r\n    print(dictionary.get_translations(to='ru')) # This will translate all words to Russian (if Google API is available)\r\n\r\nSupported dictionaries\r\n----------------------\r\n\r\n- **DICT_EDUCALINGO**: Meaning, synonym, translation for all languages\r\n- **DICT_SYNONYMCOM**: Synonyms and Antonyms (English)\r\n- **DICT_THESAURUS**: Synonyms (English)\r\n- **DICT_WORDNET**: Meanings (English)\r\n\r\nThere are many more dictionaries to come. Just contribute to this repo!\r\n\r\nAuthor\r\n------\r\n\r\n`Pablo Pizarro R. <https://ppizarror.com>`_ | 2021 - 2024\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "PyMultiDictionary is a Dictionary Module for Python 2 to get meanings, translations, synonyms and antonyms of words in 20 different languages",
    "version": "1.2.5",
    "project_urls": {
        "Bug Tracker": "https://github.com/ppizarror/PyMultiDictionary",
        "Documentation": "https://github.com/ppizarror/PyMultiDictionary",
        "Homepage": "https://github.com/ppizarror/PyMultiDictionary",
        "Source Code": "https://github.com/ppizarror/PyMultiDictionary"
    },
    "split_keywords": [
        "dictionary",
        "multi-language",
        "synonym",
        "antonym",
        "definition"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b653bd2124cf5c1eb9943f813d1cd4da071a3a91170be5e024332a17f38c0a93",
                "md5": "387fb3b1e4320634edd478986a5f2014",
                "sha256": "b7446e0b5e8344ecad5718776c8ad3e604ad521f8c33b4cf80c3201a5c5d8496"
            },
            "downloads": -1,
            "filename": "PyMultiDictionary-1.2.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "387fb3b1e4320634edd478986a5f2014",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.7",
            "size": 23161,
            "upload_time": "2024-11-04T01:11:33",
            "upload_time_iso_8601": "2024-11-04T01:11:33.413718Z",
            "url": "https://files.pythonhosted.org/packages/b6/53/bd2124cf5c1eb9943f813d1cd4da071a3a91170be5e024332a17f38c0a93/PyMultiDictionary-1.2.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3389cd0443263adc017ad6909195540f44ce410713db5825806604f178c548e0",
                "md5": "65f4d1dad54aa6b584eb87f41009e096",
                "sha256": "df60867c3cdad328e461a619a3c45f0ac147f90f62a28d4a1ba6d248c755acc0"
            },
            "downloads": -1,
            "filename": "pymultidictionary-1.2.5.tar.gz",
            "has_sig": false,
            "md5_digest": "65f4d1dad54aa6b584eb87f41009e096",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.7",
            "size": 24348,
            "upload_time": "2024-11-04T01:11:35",
            "upload_time_iso_8601": "2024-11-04T01:11:35.482127Z",
            "url": "https://files.pythonhosted.org/packages/33/89/cd0443263adc017ad6909195540f44ce410713db5825806604f178c548e0/pymultidictionary-1.2.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-04 01:11:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ppizarror",
    "github_project": "PyMultiDictionary",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pymultidictionary"
}
        
Elapsed time: 0.41586s