- Added
- Binary wheels for Python 3.14 (also free-threaded)
- Performance
- Reduced import time
- Fixed
- Don't attempt to compile binary wheels for Python 3.8, 3.9 and 3.10 where cibuildwheel depends on a conflicting Tomli version
- Added
- mypyc generated binary wheels for common platforms
- Deprecated
- Instantiating
TOMLDecodeErrorwith free-form arguments.msg,docandposarguments should be given.
- Instantiating
- Added
msg,doc,pos,linenoandcolnoattributes toTOMLDecodeError
- Removed
- Python 3.7 support
- Improved
- Make
loadsraiseTypeErrornotAttributeErroron bad input types that do not have thereplaceattribute. Improve error message whenbytesis received.
- Make
- Type annotations
- Type annotate
loadinput astyping.IO[bytes](previouslytyping.BinaryIO).
- Type annotate
- Improved
- Make bundling easier by using relative imports internally and adding license and copyright notice to source files.
- Make error messages more uniform
- Raise a friendly
TypeErrorfor wrong file mode - Allow
parse_floatto return objects having theappendattr - Eagerly raise an error if
parse_floatreturns an illegal type
- Packaging
- Move from
pytesttesting framework tounittestand removepython-dateutiltest dependency. Tests now only require Python interpreter.
- Move from
- Fixed
- Backport: Allow lower case "t" and "z" in datetimes
- Removed
- Python 3.6 support
- Support for text file objects as
loadinput. Use binary file objects instead. - First argument of
loadandloadscan no longer be passed by keyword.
- Fixed
- Allow lower case "t" and "z" in datetimes
- Improved
- Raise an error when dotted keys define values outside the "current table". Technically speaking TOML v1.0.0 does allow such assignments but that isn't intended by specification writers, and will change in a future specification version (see the pull request).
- Fixed
- Illegal characters in error messages were surrounded by two pairs of quotation marks
- Improved
TOMLDecodeError.__module__is now the public import path (tomli) instead of private import path (tomli._parser)- Eliminated an import cycle when
typing.TYPE_CHECKINGisTrue. This allowssphinx-autodoc-typehintsto resolve type annotations.
- Fixed
- Raise an error if a carriage return (without a following line feed) is found in a multi-line basic string
- Type annotations
- Type annotate
loadinput astyping.BinaryIOonly to discourage use of deprecated text file objects.
- Type annotate
- Packaging
- Remove legacy
setup.pyfrom PyPI source distribution. If you're a packager and absolutely need this file, please create an issue.
- Remove legacy
- Deprecated
- Text file objects as input to
load. Binary file objects should be used instead to avoid opening a TOML file with universal newlines or with an encoding other than UTF-8.
- Text file objects as input to
- Added
loadcan now take a binary file object
- Performance
- Minor boost (~4%)
- Fixed
- Raise
TOMLDecodeErrorinstead ofValueErrorwhen parsing dates and datetimes that pass the regex check but don't correspond to a valid date or datetime.
- Raise
- Performance
- Improved multiline literal string parsing performance
- Performance
- Minor boost (~4%)
- Performance
- A significant boost
- Fixed
- Raise
TOMLDecodeErrorinstead ofKeyErrorwhen overwriting implicitly in an inline table
- Raise
- Fixed
- Raise
TOMLDecodeErrorif overwriting nested inline tables from the parent inline - Raise
TOMLDecodeErrorif escaped Unicode character is not a Unicode scalar value
- Raise
- Performance
- Increased parsing speed of single line basic strings, and multi-line literal and basic strings
- Fixed
TOMLDecodeErrornow raised when opening a table implicitly created by a key/value pair- Don't error when two array-of-tables items open a subtable with the same name
- Don't error when opening parent table of an already defined array-of-tables item
- Performance
- Significant boost to comment parsing speed
- Added
- Improved
TOMLDecodeErrorerror messages. Line and column are included when applicable.
- Improved
- Performance
- Over 5% boost
- Fixed
- Made exception type
TOMLDecodeErrorwhen overwriting a value with a deeply nested table
- Made exception type
- Fixed
TOMLDecodeErroris now raised when attempting to overwrite a value in an inline table's or array's namespace with a table definition
- Fixed
- Error type was not TOMLDecodeError in some obscure cases
- Added
tomli.loadfor parsing IO streams returned byopen()parse_floatkeyword argument totomli.loads. Allows parsing TOML floats to a non-float type in Python.
- Fixed
TOMLDecodeErroris now raised for duplicate keys in inline tables, as opposed to silently overriding the previous value
- Changed
- Project name to Tomli
- Performance
- A performance boost
- Added
tomli.loadsfor parsing TOML stringstomli.TOMLDecodeErrorthat is raised for parse errors