uinput / deeplator Goto Github PK
View Code? Open in Web Editor NEWA Python library and application enabling translation via the DeepL translator available at deepl.com.
License: MIT License
A Python library and application enabling translation via the DeepL translator available at deepl.com.
License: MIT License
Does deeplator support translation with alternatives?
Free API is dead: https://www.deepl.com/jsonrpc
deeplator/deeplator/translator.py
Line 5 in 6972ad5
can you add support for Russian language?
Hi,
seems like DeepL change something. It doesn't work anymore.
(git pull DONE, current sha1 is 9aed34d)
I don't make many request, so I don't know why I get this error.
Regards
I've done the install with :
sudo python3 setup.py install
(no error) then try the hello world example :
$ cat /tmp/file.py
from deeplator import Translator
t = Translator("EN", "DE")
sentence = "Hello world."
translation = t.translate_sentence(sentence)
print(translation)
Then run it :
$ python3 !$
python3 /tmp/file.py
Traceback (most recent call last):
File "/tmp/file.py", line 5, in <module>
translation = t.translate_sentence(sentence)
File "/usr/local/lib/python3.5/dist-packages/deeplator-0.0.4-py3.5.egg/deeplator/translator.py", line 113, in translate_sentence
File "/usr/local/lib/python3.5/dist-packages/deeplator-0.0.4-py3.5.egg/deeplator/translator.py", line 84, in translate_sentences
File "/usr/local/lib/python3.5/dist-packages/deeplator-0.0.4-py3.5.egg/deeplator/translator.py", line 131, in _send_jsonrpc
File "/usr/local/lib/python3.5/dist-packages/deeplator-0.0.4-py3.5.egg/deeplator/jsonrpc.py", line 30, in send
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
Any hint ?
i just installed deeplator to get around the Too many requests problem of https://github.com/vsetka/deepl-translator-cli/ ; but it seams to be the same:
$ git clone https://github.com/uinput/deeplator.git
Cloning into 'deeplator'...
remote: Enumerating objects: 147, done.
remote: Total 147 (delta 0), reused 0 (delta 0), pack-reused 147
Receiving objects: 100% (147/147), 23.92 KiB | 2.66 MiB/s, done.
Resolving deltas: 100% (78/78), done.
n@nTP:~/git$ cd deeplator/
n@nTP:~/git/deeplator$ ls
deeplator deeplator.py LICENSE.txt README.md setup.py
n@nTP:~/git/deeplator$ ./deeplator.py
You did not specify a translation code.
Available languages are EN,DE,FR,ES,IT,NL,PL,PT,RU,AUTO.
Source language: AUTO
Output language: DE
Enter the text to be translated. Use Ctrl+D to exit.
hello whats that?
i dont know...
----------------
Traceback (most recent call last):
File "/home/t/git/deeplator/deeplator/translator.py", line 134, in _send_jsonrpc
return rpc.send(POST_URL)
File "/home/t/git/deeplator/deeplator/jsonrpc.py", line 29, in send
data_str = request.urlopen(req).read()
File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.9/urllib/request.py", line 523, in open
response = meth(req, response)
File "/usr/lib/python3.9/urllib/request.py", line 632, in http_response
response = self.parent.error(
File "/usr/lib/python3.9/urllib/request.py", line 561, in error
return self._call_chain(*args)
File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/lib/python3.9/urllib/request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 429: Too many requests
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/t/git/deeplator/./deeplator.py", line 52, in <module>
translations = t.translate_sentences(sentences)
File "/home/t/git/deeplator/deeplator/translator.py", line 87, in translate_sentences
resp = _send_jsonrpc(method, params)
File "/home/t/git/deeplator/deeplator/translator.py", line 136, in _send_jsonrpc
raise TranslationError(e.reason)
deeplator.translator.TranslationError: Too many requests
n@nTP:~/git/deeplator$
thanks for fixing that in advance
Hi, I'm trying to install and run Deeplator via pip, and I get:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/deeplator.py", line 7, in <module> from deeplator import Translator, VALID_LANGS ImportError: cannot import name 'Translator'
Upon examining the PyPi package here:
https://pypi.python.org/pypi/deeplator/0.0.3
I found that the /deeplator/ directory is missing, so the module doesn't import properly.
Would it be possible to re-upload the PyPi package with all the required files?
The DeepL API allows for an auto
option as the source language. It will detect the used language automatically.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.