=================
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 utilised 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 is 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 positiv...')
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 Translation of the word 'Range' in 20 different languages.
You can also extendthe 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 useful if you just 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 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 much more dictionaries to come. Just contribute to this repo!
Author
------
`Pablo Pizarro R. <https://ppizarror.com>`_ | 2021 - 2023
Raw data
{
"_id": null,
"home_page": "https://github.com/ppizarror/PyMultiDictionary",
"name": "PyMultiDictionary",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7, <4",
"maintainer_email": "",
"keywords": "dictionary multi-language synonym antonym definition",
"author": "Pablo Pizarro R.",
"author_email": "pablo@ppizarror.com",
"download_url": "https://files.pythonhosted.org/packages/36/7d/cfaaefa81a7fa4da0c304e6b3f7e84ba29250beedbe82de67ecf1be6982c/PyMultiDictionary-1.2.3.tar.gz",
"platform": "any",
"description": "=================\nPyMultiDictionary\n=================\n\n.. image:: https://img.shields.io/badge/author-Pablo%20Pizarro%20R.-lightgray.svg\n :target: https://ppizarror.com\n :alt: @ppizarror\n\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n :target: https://opensource.org/licenses/MIT\n :alt: License MIT\n\n.. image:: https://img.shields.io/badge/python-3.7+-red.svg\n :target: https://www.python.org/downloads\n :alt: Python 3.7+\n\n.. image:: https://badge.fury.io/py/PyMultiDictionary.svg\n :target: https://pypi.org/project/PyMultiDictionary\n :alt: PyPi package\n\n.. image:: https://img.shields.io/github/actions/workflow/status/ppizarror/PyMultiDictionary/ci.yml?branch=master\n :target: https://github.com/ppizarror/PyMultiDictionary/actions/workflows/ci.yml\n :alt: Build status\n \n.. image:: https://app.fossa.com/api/projects/git%2Bgithub.com%2Fppizarror%2FPyMultiDictionary.svg?type=shield\n :target: https://app.fossa.com/projects/git%2Bgithub.com%2Fppizarror%2FPyMultiDictionary?ref=badge_shield\n :alt: FOSSA Status\n\n.. image:: https://codecov.io/gh/ppizarror/PyMultiDictionary/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/ppizarror/PyMultiDictionary\n :alt: Codecov\n\n.. image:: https://img.shields.io/github/issues/ppizarror/PyMultiDictionary\n :target: https://github.com/ppizarror/PyMultiDictionary/issues\n :alt: Open issues\n\n.. image:: https://img.shields.io/pypi/dm/PyMultiDictionary?color=purple\n :target: https://pypi.org/project/PyMultiDictionary\n :alt: PyPi downloads\n\n.. image:: https://static.pepy.tech/personalized-badge/PyMultiDictionary?period=total&units=international_system&left_color=grey&right_color=lightgrey&left_text=total%20downloads\n :target: https://pepy.tech/project/PyMultiDictionary\n :alt: Total downloads\n \n.. image:: https://img.shields.io/badge/buy%20me%20a-Ko--fi-02b9fe\n :target: https://ko-fi.com/ppizarror\n :alt: Buy me a Ko-fi\n\nPyMultiDictionary is a dictionary module for Python 3+ to get meanings, translations,\nsynonyms and antonyms of words in 20 different languages. It uses educalingo.com,\nsynonym.com, and WordNet for getting meanings, translations, synonyms, and antonyms.\n\nSupported languages\n-------------------\n\n- Bengali (**bn**)\n- German (**de**)\n- English (**en**)\n- Spanish (**es**)\n- French (**fr**)\n- Hindi (**hi**)\n- Italian (**it**)\n- Japanese (**ja**)\n- Javanese (**jv**)\n- Korean (**ko**)\n- Marathi (**mr**)\n- Malay (**ms**)\n- Polish (**pl**)\n- Portuguese (**pt**)\n- Romanian (**ro**)\n- Russian (**ru**)\n- Tamil (**ta**)\n- Turkish (**tr**)\n- Ukranian (**uk**)\n- Chinese (**zh**)\n\nInstall Instructions\n--------------------\n\nPyMultiDictionary can be installed via pip, for both MacOS, Windows & Linux. Simply run:\n\n.. code-block:: bash\n\n $> python3 -m pip install --upgrade PyMultiDictionary\n\nUsage\n-----\n\nPyMultiDictionary can be utilised in 2 ways, either by creating a dictionary instance\nwhich can take words as arguments or by creating a dictionary instance with a fixed\namount of words.\n\n**Create a dictionary object**:\n\nFor example,\n\n.. code-block:: python\n\n from PyMultiDictionary import MultiDictionary\n dictionary = MultiDictionary()\n\nThis is will create a local instance of the MultiDictionary class and now it can\nbe used to get meanings, translations etc.\n\nFor **Meanings**,\n\n.. code-block:: python\n\n print(dictionary.meaning('en', 'good'))\n\nThis will return a tuple containing the meanings of the word, in the format\n*(word_type, word_meaning, word_wikipedia)*. For example the above code will return:\n\n.. code-block:: python\n\n (['Noun', 'Adjective', 'Exclamation'],\n 'The first definition of good in the dictionary is having admirable ...',\n 'Good may refer to: \u25aa Good and evil, the distinction between positiv...')\n\nAll methods support other dictionaries, for example, 'wordnet' can be used\nfor english words.\n\n.. code-block:: python\n\n from PyMultiDictionary import DICT_WORDNET\n dictionary = MultiDictionary()\n print(dictionary.meaning('en', 'good', dictionary=DICT_WORDNET))\n\nWill return:\n\n.. code-block:: python\n\n {\n 'Noun': ['benefit', 'moral excellence or admirableness', ...],\n 'Adjective': ['morally admirable', ...],\n 'Adverb': [...]\n }\n\nFor **Synonyms**,\n\n.. code-block:: python\n\n print(dictionary.synonym('es', 'Bueno'))\n\nThis will return a list containing the Synonyms of the word.\n\nFor **Antonyms**,\n\n.. code-block:: python\n\n print(dictionary.antonym('en', 'Life'))\n\nThis will return a list containing the Antonyms of the word. Currently only English is supported.\n\nFor **Translations**,\n\n.. code-block:: python\n\n print(dictionary.translate('en', 'Range'))\n\nThis will return the Translation of the word 'Range' in 20 different languages.\nYou can also extendthe scope of the translations by providing a target language,\nwhich will use google translate API, for example:\n\n.. code-block:: python\n\n print(dictionary.translate('en', 'Range', to='ru'))\n\nAlternatively, you can set a fixed number of words to the Dictionary Instance. This\nis useful if you just want to get the meanings of some words quickly without any development need.\n\nExample:\n\n.. code-block:: python\n\n from PyMultiDictionary import MultiDictionary, DICT_EDUCALINGO\n\n dictionary=MultiDictionary('hotel', 'ambush', 'nonchalant', 'perceptive')\n dictionary.set_words_lang('en') # All words are english\n \n print(dictionary.get_meanings(dictionary=DICT_EDUCALINGO)) # This print the meanings of all the words\n print(dictionary.get_synonyms()) # Get synonyms list\n print(dictionary.get_antonyms()) # Get antonyms\n print(dictionary.get_translations()) # This will translate all words to over 20 languages\n print(dictionary.get_translations(to='ru')) # This will translate all words to Russian (if Google API available)\n\nSupported dictionaries\n----------------------\n\n- **DICT_EDUCALINGO**: Meaning, synonym, translation for all languages\n- **DICT_SYNONYMCOM**: Synonyms and Antonyms (English)\n- **DICT_THESAURUS**: Synonyms (English)\n- **DICT_WORDNET**: Meanings (English)\n\nThere are much more dictionaries to come. Just contribute to this repo!\n\nAuthor\n------\n\n`Pablo Pizarro R. <https://ppizarror.com>`_ | 2021 - 2023\n\n\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.3",
"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": "aed2a4244da15be437cb605485687ee17109b91d8ea223af8b529a5020f2f5a0",
"md5": "f3d4b08c9ac32eebdca1445622226ce2",
"sha256": "66825b6cef7773bebd6381d7e82f4524d51c1de80c8100e401afee05c8e142a0"
},
"downloads": -1,
"filename": "PyMultiDictionary-1.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f3d4b08c9ac32eebdca1445622226ce2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7, <4",
"size": 22854,
"upload_time": "2023-06-28T18:10:30",
"upload_time_iso_8601": "2023-06-28T18:10:30.396319Z",
"url": "https://files.pythonhosted.org/packages/ae/d2/a4244da15be437cb605485687ee17109b91d8ea223af8b529a5020f2f5a0/PyMultiDictionary-1.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "367dcfaaefa81a7fa4da0c304e6b3f7e84ba29250beedbe82de67ecf1be6982c",
"md5": "7e9d25253672e7abfedc33611d6ca5e4",
"sha256": "41104c5b16827bf486bb74df13ab29a26f76730df312cbb1b10f644f05b77775"
},
"downloads": -1,
"filename": "PyMultiDictionary-1.2.3.tar.gz",
"has_sig": false,
"md5_digest": "7e9d25253672e7abfedc33611d6ca5e4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7, <4",
"size": 24354,
"upload_time": "2023-06-28T18:10:31",
"upload_time_iso_8601": "2023-06-28T18:10:31.757347Z",
"url": "https://files.pythonhosted.org/packages/36/7d/cfaaefa81a7fa4da0c304e6b3f7e84ba29250beedbe82de67ecf1be6982c/PyMultiDictionary-1.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-28 18:10:31",
"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"
}