Metadata-Version: 2.1
Name: ponstrans
Version: 1.1.0
Summary: Add a short description here!
Home-page: https://github.com/plysytsya/ponstrans
Author: Pavlo Lysytsya
Author-email: pavlo.lysytsya@outfittery.de
License: mit
Project-URL: Documentation, https://github.com/plysytsya/ponstrans
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Description-Content-Type: text/markdown; charset=UTF-8
Requires-Dist: requests (>=2.0.0)
Requires-Dist: beautifulsoup4 (>=4.0.0)
Provides-Extra: testing
Requires-Dist: pytest ; extra == 'testing'
Requires-Dist: pytest-cov ; extra == 'testing'

![GitHub Actions status | sdras/awesome-actions](https://github.com/plysytsya/ponstrans/workflows/tests/badge.svg)
[![codecov](https://codecov.io/gh/plysytsya/ponstrans/branch/master/graph/badge.svg)](https://codecov.io/gh/plysytsya/ponstrans/branch/master/graph/badge.svg)
![PyPI](https://img.shields.io/pypi/v/ponstrans)

# ponstrans


Unofficial client for PONS online dictionary


## Description

Translates words scraping https://en.pons.com/ in the background.

Supported languages:
```
"ar": "Arabic",
"bg": "Bulgarian",
"zh": "Chinese",
"nl": "Dutch",
"en": "English",
"fr": "French",
"de": "German",
"el": "Greek",
"it": "Italian",
"la": "Latin",
"pl": "Polish",
"pt": "Portuguese",
"ru": "Russian",
"sl": "Slovenian",
"es": "Spanish",
"tr": "Turkish",
"cs": "Czech",
"da": "Danish",
"hu": "Hungarian",
"no": "Norwegian",
"sv": "Swedish",
"lb": "Elvish"
```

## Installation
```
pip install ponstrans
```

## Usage

```
>>> from ponstrans import translate, find_examples
>>> translations = translate(word="hallo", source_language="de", target_language="en")
>>> translations[:2]
[{'source': 'hallo', 'target': 'hello'}, {'source': 'hallo (zur Begrüßung)', 'target': 'hi'}]
```

Note
====

The performance is quite bad because it scrapes the whole
html page in the background. Use the official (paid) API for better performance:
https://en.pons.com/p/online-dictionary/developers/api


