Skip to content

Commit ffec836

Browse files
🌷 Update 1.4.0 - Pull Request
- Circumvent some Google Translate limitations by switching user agents - Raise `TranslateError` instead of `JsonDecodeError`/generic exceptions when getting rate limited - Added useful resources in `README.md` - Updated package on [pypi](https://pypi.org/project/gpytranslate/1.4.0/)
2 parents 86ee12a + 65480ef commit ffec836

24 files changed

+196
-128
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Davide Galilei
3+
Copyright (c) 2022 Davide Galilei
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ translator = SyncTranslator()
8282
with open("test.mp3", "wb") as file:
8383
translator.tts("Hello world!", file=file)
8484
```
85+
86+
----
87+
## Useful Resources
88+
https://danpetrov.xyz/programming/2021/12/30/telegram-google-translate.html
89+
https://vielhuber.de/en/blog/google-translation-api-hacking/
90+
8591
----
8692
## Development
8793
Want to contribute? Pull requests are accepted!

examples/async/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
gpytranslate - A Python3 library for translating text using Google Translate API.
33
MIT License
44
5-
Copyright (c) 2021 Davide Galilei
5+
Copyright (c) 2022 Davide Galilei
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

examples/async/https_proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
gpytranslate - A Python3 library for translating text using Google Translate API.
33
MIT License
44
5-
Copyright (c) 2021 Davide Galilei
5+
Copyright (c) 2022 Davide Galilei
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

examples/async/socks5_proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
gpytranslate - A Python3 library for translating text using Google Translate API.
33
MIT License
44
5-
Copyright (c) 2021 Davide Galilei
5+
Copyright (c) 2022 Davide Galilei
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

examples/async/tts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
gpytranslate - A Python3 library for translating text using Google Translate API.
33
MIT License
44
5-
Copyright (c) 2021 Davide Galilei
5+
Copyright (c) 2022 Davide Galilei
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

examples/sync/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
gpytranslate - A Python3 library for translating text using Google Translate API.
33
MIT License
44
5-
Copyright (c) 2021 Davide Galilei
5+
Copyright (c) 2022 Davide Galilei
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

examples/sync/https_proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
gpytranslate - A Python3 library for translating text using Google Translate API.
33
MIT License
44
5-
Copyright (c) 2021 Davide Galilei
5+
Copyright (c) 2022 Davide Galilei
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

examples/sync/socks5_proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
gpytranslate - A Python3 library for translating text using Google Translate API.
33
MIT License
44
5-
Copyright (c) 2021 Davide Galilei
5+
Copyright (c) 2022 Davide Galilei
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

gpytranslate/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
from .gpytranslate import Translator
22
from .sync import SyncTranslator
33
from .types import TranslatedObject
4+
from .exceptions import GpytranslateException, TranslationError
45

5-
__version__ = "1.2.0"
6-
__all__ = ["Translator", "SyncTranslator", "TranslatedObject", "__version__"]
6+
__version__ = "1.4.0"
7+
__all__ = [
8+
"Translator",
9+
"SyncTranslator",
10+
"TranslatedObject",
11+
"GpytranslateException",
12+
"TranslationError",
13+
"__version__",
14+
]

0 commit comments

Comments
 (0)