nidhaloff / deep-translator

A flexible free and unlimited python tool to translate between different languages in a simple way using multiple translators.
https://deep-translator.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
1.61k stars 185 forks source link

Current Guidance Around Limits? #228

Open ShaneOH opened 1 year ago

ShaneOH commented 1 year ago

Hi, this is a great library, thank you for maintaining it.

I went to open this in Discussions (as was suggested here https://github.com/nidhaloff/deep-translator/issues/94#issuecomment-904040700) but that seems quite inactive so I wanted to ask here since I do believe it constitutes an issue, technically.

I've seen a few mentions of limit numbers: https://github.com/nidhaloff/deep-translator/issues/154 suggests 5 requests per second and up to 200k requests per day for Google But https://github.com/nidhaloff/deep-translator/discussions/132 suggests being rate limited after fewer than 100 calls https://github.com/nidhaloff/deep-translator/issues/161 suggests only a few words for lingueeTranslator for example

I also read through some other issues like https://github.com/nidhaloff/deep-translator/issues/149 but those weren't very useful.

So the question is: Are there any general benchmarks on how many requests this package can handle? I'm looking to translate in batches of ~50 characters but it could be bursts of many requests at once. Let's say 100 requests/second. I can pay for API access as a fallback, but building out my project, this library seemed to have incredible potential but I'm concerned about being rate limited basically right away and I can't tell if that's a consistent issue or not. Given this has 1K+ stars I'm assuming people are using it fairly heavily?

I'm basically wondering if I should spend time building my project around this library or if I should just bypass it and eat the cost of Google's API directly if I need to scale at all.

Finally, are there any more examples or explanations on how the proxies work?

Basically any guidance around limits, benchmarks, etc. would be greatly appreciated!

vhdmoradi commented 7 months ago

I intend to use GoogleTranslator in my api, so if the user inputs search query in other languages, I can translate them to my desired language. but, there may be a lot of users trying my api, many of them simultaniously. So, I won't be able to use this package for more than 5 requests per second?

bfontaine commented 1 month ago

This package is just a collection of API clients; the rate limits are not different than if you were calling the Google API by yourself.

Regarding proxies: this package doesn’t do anything with them, it just pass them down unchanged to the underlying Requests call.

The presentation of this package as being "free and unlimited" is misleading: it’s as "free and unlimited" as the API you use behind.