T2s

Latest version: v2021.1

Safety actively analyzes 638430 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 5

2.1.0

------------------

Features
~~~~~~~~

- The ``gtts`` module

- Added the ability to customize the Google Translate URL hostname.
This is useful when ``google.com`` might be blocked within a network but
a local or different Google host (e.g. ``google.cn``) is not
(`143 <https://github.com/pndurette/gTTS/issues/143>`_, `#203 <https://github.com/pndurette/gTTS/issues/203>`_):

- New ``gTTS()`` parameter ``tld`` to specify the top-level
domain to use for the Google hostname, i.e ``https://translate.google.<tld>``
(default: ``com``).
- Languages are also now fetched using the same customized hostname.

- Pre-generated TTS API request URLs can now be obtained instead of
writing an ``mp3`` file to disk (for example to be used in an
external program):

- New ``get_urls()`` method returns the list of URLs generated by ``gTTS``,
which can be used in lieu of ``write_to_fp()`` or ``save()``.

- The ``gtts-cli`` command-line tool

- New ``--tld`` option to match the new ``gtts`` customizable hostname (`200 <https://github.com/pndurette/gTTS/issues/200>`_, `#207 <https://github.com/pndurette/gTTS/issues/207>`_)

- Other

- Added Python 3.8 support (`204 <https://github.com/pndurette/gTTS/issues/204>`_)


Bugfixes
~~~~~~~~

- Changed default word-for-word pre-processor (``('M.', 'Monsieur')``) which would substitute any 'm.' for 'monsieur' (e.g. 'them.' became 'themonsieur') (`197 <https://github.com/pndurette/gTTS/issues/197>`_)


Improved Documentation
~~~~~~~~~~~~~~~~~~~~~~

- Added examples for newer features (`205 <https://github.com/pndurette/gTTS/issues/205>`_, `#207 <https://github.com/pndurette/gTTS/issues/207>`_)


Misc
~~~~

- `204 <https://github.com/pndurette/gTTS/issues/204>`_, `#205 <https://github.com/pndurette/gTTS/issues/205>`_, `#207 <https://github.com/pndurette/gTTS/issues/207>`_

2.0.4

------------------

Features
~~~~~~~~

- gTTS is now built as a wheel package (Python 2 & 3) (`181 <https://github.com/pndurette/gTTS/issues/181>`_)


Improved Documentation
~~~~~~~~~~~~~~~~~~~~~~

- Fixed bad example in docs (`163 <https://github.com/pndurette/gTTS/issues/163>`_, `#166 <https://github.com/pndurette/gTTS/issues/166>`_)


Misc
~~~~

- `164 <https://github.com/pndurette/gTTS/issues/164>`_, `#171 <https://github.com/pndurette/gTTS/issues/171>`_, `#173 <https://github.com/pndurette/gTTS/issues/173>`_, `#185 <https://github.com/pndurette/gTTS/issues/185>`_

2.0.3

------------------

Features
~~~~~~~~

- Added new tokenizer case for ':' preventing cut in the middle of a time notation (`135 <https://github.com/pndurette/gTTS/issues/135>`_)


Misc
~~~~

- `159 <https://github.com/pndurette/gTTS/issues/159>`_

2.0.2

------------------

Features
~~~~~~~~

- Added Python 3.7 support, modernization of packaging, testing and CI (`126 <https://github.com/pndurette/gTTS/issues/126>`_)


Bugfixes
~~~~~~~~

- Fixed language retrieval/validation broken from new Google Translate page (`156 <https://github.com/pndurette/gTTS/issues/156>`_)

2.0.1

------------------

Bugfixes
~~~~~~~~

- Fixed an UnicodeDecodeError when installing gTTS if system locale was not
utf-8 (`120 <https://github.com/pndurette/gTTS/issues/120>`_)


Improved Documentation
~~~~~~~~~~~~~~~~~~~~~~

- Added *Pre-processing and tokenizing > Minimizing* section about the API's
100 characters limit and how larger tokens are handled (`121
<https://github.com/pndurette/gTTS/issues/121>`_)


Misc
~~~~

- `122 <https://github.com/pndurette/gTTS/issues/122>`_

2.0.0

------------------
(`108 <https://github.com/pndurette/gTTS/issues/108>`_)

Features
~~~~~~~~

- The ``gtts`` module

- New logger ("gtts") replaces all occurrences of ``print()``
- Languages list is now obtained automatically (``gtts.lang``)
(`91 <https://github.com/pndurette/gTTS/issues/91>`_,
`94 <https://github.com/pndurette/gTTS/issues/94>`_,
`106 <https://github.com/pndurette/gTTS/issues/106>`_)
- Added a curated list of language sub-tags that
have been observed to provide different dialects or accents
(e.g. "en-gb", "fr-ca")
- New ``gTTS()`` parameter ``lang_check`` to disable language
checking.
- ``gTTS()`` now delegates the ``text`` tokenizing to the
API request methods (i.e. ``write_to_fp()``, ``save()``),
allowing ``gTTS`` instances to be modified/reused
- Rewrote tokenizing and added pre-processing (see below)
- New ``gTTS()`` parameters ``pre_processor_funcs`` and
``tokenizer_func`` to configure pre-processing and tokenizing
(or use a 3rd party tokenizer)
- Error handling:

- Added new exception ``gTTSError`` raised on API request errors.
It attempts to guess what went wrong based on known information
and observed behaviour
(`60 <https://github.com/pndurette/gTTS/issues/60>`_,
`106 <https://github.com/pndurette/gTTS/issues/106>`_)
- ``gTTS.write_to_fp()`` and ``gTTS.save()`` also raise ``gTTSError``
on `gtts_token` error
- ``gTTS.write_to_fp()`` raises ``TypeError`` when ``fp`` is not a
file-like object or one that doesn't take bytes
- ``gTTS()`` raises ``ValueError`` on unsupported languages
(and ``lang_check`` is ``True``)
- More fine-grained error handling throughout (e.g.
`request failed` vs. `request successful with a bad response`)

- Tokenizer (and new pre-processors):

- Rewrote and greatly expanded tokenizer (``gtts.tokenizer``)
- Smarter token 'cleaning' that will remove tokens that only contain
characters that can't be spoken (i.e. punctuation and whitespace)
- Decoupled token minimizing from tokenizing, making the latter usable
in other contexts
- New flexible speech-centric text pre-processing
- New flexible full-featured regex-based tokenizer
(``gtts.tokenizer.core.Tokenizer``)
- New ``RegexBuilder``, ``PreProcessorRegex`` and ``PreProcessorSub`` classes
to make writing regex-powered text `pre-processors` and `tokenizer cases`
easier
- Pre-processors:

- Re-form words cut by end-of-line hyphens
- Remove periods after a (customizable) list of known abbreviations
(e.g. "jr", "sr", "dr") that can be spoken the same without a period
- Perform speech corrections by doing word-for-word replacements
from a (customizable) list of tuples

- Tokenizing:

- Keep punctuation that modify the inflection of speech (e.g. "?", "!")
- Don't split in the middle of numbers (e.g. "10.5", "20,000,000")
(`101 <https://github.com/pndurette/gTTS/issues/101>`_)
- Don't split on "dotted" abbreviations and accronyms (e.g. "U.S.A")
- Added Chinese comma (","), ellipsis ("…") to punctuation list
to tokenize on (`86 <https://github.com/pndurette/gTTS/issues/86>`_)

- The ``gtts-cli`` command-line tool

- Rewrote cli as first-class citizen module (``gtts.cli``),
powered by `Click <http://click.pocoo.org>`_
- Windows support using `setuptool`'s `entry_points`
- Better support for Unicode I/O in Python 2
- All arguments are now pre-validated
- New ``--nocheck`` flag to skip language pre-checking
- New ``--all`` flag to list all available languages
- Either the ``--file`` option or the ``<text>`` argument can be set to
"-" to read from ``stdin``
- The ``--debug`` flag uses logging and doesn't pollute ``stdout``
anymore


Bugfixes
~~~~~~~~

- ``_minimize()``: Fixed an infinite recursion loop that would occur
when a token started with the miminizing delimiter (i.e. a space)
(`86 <https://github.com/pndurette/gTTS/issues/86>`_)
- ``_minimize()``: Handle the case where a token of more than 100
characters did not contain a space (e.g. in Chinese).
- Fixed an issue that fused multiline text together if the total number of
characters was less than 100
- Fixed ``gtts-cli`` Unicode errors in Python 2.7 (famous last words)
(`78 <https://github.com/pndurette/gTTS/issues/78>`_,
`93 <https://github.com/pndurette/gTTS/issues/93>`_,
`96 <https://github.com/pndurette/gTTS/issues/96>`_)


Deprecations and Removals
~~~~~~~~~~~~~~~~~~~~~~~~~

- Dropped Python 3.3 support
- Removed ``debug`` parameter of ``gTTS`` (in favour of logger)
- ``gtts-cli``: Changed long option name of ``-o`` to ``--output``
instead of ``--destination``
- ``gTTS()`` will raise a ``ValueError`` rather than an ``AssertionError``
on unsupported language


Improved Documentation
~~~~~~~~~~~~~~~~~~~~~~

- Rewrote all documentation files as reStructuredText
- Comprehensive documentation writen for `Sphinx <http://www.sphinx-doc.org>`_, published to http://gtts.readthedocs.io
- Changelog built with `towncrier <https://github.com/hawkowl/towncrier>`_

Misc
~~~~

- Major test re-work
- Language tests can read a ``TEST_LANGS`` enviromment variable so
not all language tests are run every time.
- Added `AppVeyor <https://www.appveyor.com>`_ CI for Windows
- `PEP 8 <https://www.python.org/dev/peps/pep-0008/>`_ compliance

Page 2 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.