|
1 | | -Welcome to python-FreeDictionaryApi! |
| 1 | +Welcome to python-freeDictionaryAPI! |
2 | 2 | ==================================== |
3 | 3 |
|
4 | | -.. note:: |
| 4 | +.. image:: https://img.shields.io/pypi/v/python-freeDictionaryAPI?style=flat-square |
| 5 | + :target: https://pypi.org/project/python-freeDictionaryAPI/ |
| 6 | + :alt: PyPI |
5 | 7 |
|
6 | | - It is in development now! |
| 8 | +.. image:: https://img.shields.io/pypi/status/python-freeDictionaryAPI?style=flat-square |
| 9 | + :target: https://pypi.org/project/python-freeDictionaryAPI/ |
| 10 | + :alt: PyPI - Status |
7 | 11 |
|
8 | | - Release soon! |
| 12 | +.. image:: https://img.shields.io/pypi/pyversions/python-freeDictionaryAPI?style=flat-square |
| 13 | + :target: https://pypi.org/project/python-freeDictionaryAPI/ |
| 14 | + :alt: PyPI - Python Version |
| 15 | + |
| 16 | +.. image:: https://img.shields.io/pypi/dm/python-freeDictionaryAPI?style=flat-square |
| 17 | + :target: https://pypi.org/project/python-freeDictionaryAPI/ |
| 18 | + :alt: PyPI - Downloads |
| 19 | + |
| 20 | +.. image:: https://img.shields.io/readthedocs/python-freedictionaryapi?style=flat-square |
| 21 | + :target: https://python-freedictionaryapi.readthedocs.io/ |
| 22 | + :alt: Read the Docs |
| 23 | + |
| 24 | +.. image:: https://img.shields.io/website?down_message=API%60s%20failed&style=flat-square&up_message=API%60s%20working&url=https%3A%2F%2Fdictionaryapi.dev%2F |
| 25 | + :target: https://dictionaryapi.dev/ |
| 26 | + :alt: API`s working |
| 27 | + |
| 28 | +.. image:: https://img.shields.io/pypi/l/python-freeDictionaryAPI?style=flat-square |
| 29 | + :target: https://pypi.org/project/python-freeDictionaryAPI/ |
| 30 | + :alt: PyPI - License |
| 31 | + |
| 32 | +.. image:: https://img.shields.io/github/issues/Max-Zhenzhera/python-freeDictionaryAPI?style=flat-square |
| 33 | + :target: https://github.com/Max-Zhenzhera/python-freeDictionaryAPI/issues |
| 34 | + :alt: GitHub issues |
| 35 | + |
| 36 | + |
| 37 | +**python-freeDictionaryAPI** is a wrapper for `Free Dictionary API <https://dictionaryapi.dev/>`_. |
| 38 | + |
| 39 | +Library is simple, light and uses very cool fully free dictionary API. |
| 40 | + |
| 41 | +Library components can be used with high level API (clients) |
| 42 | +or if you wish so |
| 43 | +you can use only some implemented parts that you`re interested in (like URL generating, parsers, ...). |
| 44 | + |
| 45 | +Implemented synchronous and asynchronous clients |
| 46 | +that powered with |
| 47 | +`httpx <https://pypi.org/project/httpx/>`_ |
| 48 | +and |
| 49 | +`aiohttp <https://pypi.org/project/aiohttp/>`_ |
| 50 | +accordingly. |
| 51 | + |
| 52 | +You can `read the docs here <https://python-freedictionaryapi.readthedocs.io/>`_. |
| 53 | + |
| 54 | + |
| 55 | +Installation |
| 56 | +^^^^^^^^^^^^ |
| 57 | + |
| 58 | +.. code-block:: bash |
| 59 | +
|
| 60 | + $ pip install python-freeDictionaryAPI |
| 61 | +
|
| 62 | +
|
| 63 | +Super Quick Start |
| 64 | +^^^^^^^^^^^^^^^^^ |
| 65 | + |
| 66 | +.. code-block:: python |
| 67 | +
|
| 68 | + >>> from freedictionaryapi.clients.sync_client import DictionaryApiClient |
| 69 | + >>> with DictionaryApiClient() as client: |
| 70 | + ... parser = client.fetch_parser('hello') |
| 71 | + >>> word = parser.word |
| 72 | + >>> word.word |
| 73 | + 'hello' |
| 74 | + >>> word.phonetics |
| 75 | + [Phonetic(text='/həˈloʊ/', audio='https://lex-audio.useremarkable.com/mp3/hello_us_1_rr.mp3'), Phonetic(text='/hɛˈloʊ/', audio='https://lex-audio.useremarkable.com/mp3/hello_us_2_rr.mp3')] |
| 76 | + >>> for meaning in word.meanings: |
| 77 | + ... print(meaning.part_of_speech) |
| 78 | + ... for definition in meaning.definitions: |
| 79 | + ... orint(definition) |
| 80 | + ... print() |
| 81 | + noun |
| 82 | + Definition(definition='An utterance of “hello”; a greeting.', example='she was getting polite nods and hellos from people', synonyms=['greeting', 'welcome', 'salutation', 'saluting', 'hailing', 'address', 'hello', 'hallo']) |
| 83 | +
|
| 84 | + intransitive verb |
| 85 | + Definition(definition='Say or shout “hello”; greet someone.', example='I pressed the phone button and helloed', synonyms=None) |
| 86 | +
|
| 87 | + exclamation |
| 88 | + Definition(definition='Used as a greeting or to begin a phone conversation.', example='hello there, Katie!', synonyms=None) |
| 89 | + >>> parser.get_transcription() |
| 90 | + '/həˈloʊ/' |
| 91 | + >>> parser.get_link_on_audio_with_pronunciation() |
| 92 | + 'https://lex-audio.useremarkable.com/mp3/hello_us_1_rr.mp3' |
| 93 | + >>> parser.get_all_definitions() |
| 94 | + ['An utterance of “hello”; a greeting.', 'Say or shout “hello”; greet someone.', 'Used as a greeting or to begin a phone conversation.'] |
| 95 | + >>> parser.get_all_synonyms() |
| 96 | + ['hello', 'hailing', 'welcome', 'address', 'salutation', 'hallo', 'saluting', 'greeting'] |
| 97 | + >>> parser.get_all_examples() |
| 98 | + ['she was getting polite nods and hellos from people', 'I pressed the phone button and helloed', 'hello there, Katie!'] |
| 99 | +
|
| 100 | +
|
| 101 | +Developer |
| 102 | +^^^^^^^^^ |
| 103 | +**Good luck!** |
0 commit comments