commit | 407cfc0c433ec58cc547fe6d62f4148c04bc579f | [log] [tgz] |
---|---|---|
author | Jairo Llopis <973709+yajo@users.noreply.github.com> | Thu Jul 27 02:43:09 2023 +0100 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Oct 25 14:05:54 2023 -0700 |
tree | 3c1613833c1047bdfdd819d52eff0a96ba7dfeb5 | |
parent | deee1289fbcba8f19794d0a235c94255c753f772 [diff] |
perf: only iter on found escape sequences (#304) Finding used sequences is much faster than iterating over each one of them for each character. The iteration is still used, but at least it will only be used once per any sequence that is actually used in the string. Most strings won't include any sequences and will just be fast. @moduon MT-1075 GitOrigin-RevId: 9e39a63c17e0d1435d18c0aca92ec0feec815c2a Change-Id: Ie5a8ece80526c326814ff739e37004e276712dfa
TOML Kit is a 1.0.0-compliant TOML library.
It includes a parser that preserves all comments, indentations, whitespace and internal element ordering, and makes them accessible and editable via an intuitive API.
You can also create new TOML documents from scratch using the provided helpers.
Part of the implementation has been adapted, improved and fixed from Molten.
See the documentation for more information.
If you are using Poetry, add tomlkit
to your pyproject.toml
file by using:
poetry add tomlkit
If not, you can use pip
:
pip install tomlkit
Please clone the repo with submodules with the following command git clone --recurse-submodules https://github.com/sdispater/tomlkit.git
. We need the submodule - toml-test
for running the tests.
You can run the tests with poetry run pytest -q tests