Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rafaelbroseghini/oxfordapi
:books: Python wrapper around the Oxford Dictionaries API.
https://github.com/rafaelbroseghini/oxfordapi
oxford-dictionary pypi
Last synced: 16 days ago
JSON representation
:books: Python wrapper around the Oxford Dictionaries API.
- Host: GitHub
- URL: https://github.com/rafaelbroseghini/oxfordapi
- Owner: RafaelBroseghini
- License: mit
- Created: 2018-06-28T02:45:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T06:07:56.000Z (almost 2 years ago)
- Last Synced: 2024-10-14T03:37:14.126Z (24 days ago)
- Topics: oxford-dictionary, pypi
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Oxford Dictionary API Python Wrapper
This is a python wrapper around the Oxford Dictionary API.
The Oxford API offers a free plan with up to 3,000 requests per month with full access to Oxford Dictionaries data, although you will need to register for an API key. Sign up [here](https://developer.oxforddictionaries.com/).In addition to the API wrapper a caching structure is provided for requesting entries from APIv2 and persisting the results such that the API is not queried multiple times for the already checked word.
## Installation
* `git clone [email protected]:RafaelBroseghini/OxfordAPI.git`
* `cd OxfordAPI`
* `python OxfordDictionaries.py`## Usage
The code below shows how to query APIv2 for definitions of word 'staple'.
```python
from oxforddictionaries.caching_language_dictionary import CachingLanguageDictionary
from oxforddictionaries.credentials import APPLICATION_ID, APPLICATION_KEY
from oxforddictionaries.oxford_api_v2 import OxfordApiV2if __name__ == "__main__":
oxford_api = OxfordApiV2(APPLICATION_ID, APPLICATION_KEY)
caching_language_dictionary = CachingLanguageDictionary(oxford_api, 'en-gb')
result = caching_language_dictionary.get_definitions("staple")
print(result)
```
Note: before using it you need to create python file credentials.py in oxforddictionaries directory of the following structure:
```python
# this file is part of git ignore, replace with your API credentials
APPLICATION_ID = ""
APPLICATION_KEY = ""
```
## Contributing1. Fork it! :+1:
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :+1: