-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Since we already had to roll our own based on writing a particular
styled .clears table to the pps.toml file, this is a task to
choose the best (combo of) lib(s).
Here's the verbatim bullet-task breakout from #345:
-
after much pain and anguish getting
thetomlencoder to output things sanely, i think it's just worth
writing or switching to a super fast custom encoder that writes
adhoc-ly in the format we want for positions entries inpps.toml,
the reader-writer separation is already what
tomlidoes (the fastest pure py reader soon to land in the stdlib) and
then we can just droptomloutright and worry about getting a general encoder later. -
support better indentation
per broker-account for better readability,
indented tables per broker-account would
be super nice if possible- see
tomlkitbelow which supports this -> https://github.com/pikers/tomlkit/blob/writing_docs_tweaks/tomlkit/items.py#L1644 - see our PR adding an indent control to
Array.multiline()
SupportDecimalandMutableMappingcodecs, add a multiline-Arrayindent control python-poetry/tomlkit#294
- see
Turns out there's been a bunch of project updates in the space 🙏🏼,
-
tomlkit: from thepoetry/pendulumauth:
https://github.com/sdispater/tomlkit and is based on arustlib
- contains multi-line array writing: https://github.com/pikers/tomlkit/blob/writing_docs_tweaks/tomlkit/items.py#L1122
- supports inline table rendering: https://github.com/pikers/tomlkit/blob/writing_docs_tweaks/tomlkit/items.py#L1122
- we can now work off our own fork: https://github.com/pikers/tomlkit
- needs
Decimalinput support: SupportDecimalserialization? python-poetry/tomlkit#288 - needs
bidictinput support: Supportbidictinputs? python-poetry/tomlkit#289
- needs
-
msgspec.tomlnow exists :party: which means we can natively render
our msgs and structs easily!- uses
tomli(-w)underneath so using that probably makes the most
sense for our speed solution. - https://jcristharif.com/msgspec/install.html#toml
- https://jcristharif.com/msgspec/api.html#toml
- https://jcristharif.com/msgspec/supported-types.html#datetime
- uses
-
a list of other alt libs that we prolly won't use but figured might as
well put them here just in case:pytomlppc++ wrapped parser: https://bobfang1992.github.io/pytomlpp/pytomlpp.htmltoml-w, stdlib'stomlsibling writer lib: https://github.com/hukkin/tomli-w#does-tomli-w-support-writing-documents-with-comments-or-custom-whitespace- has
Decimalsupport which i don't think is intomlkit: https://github.com/hukkin/tomli#construct-decimaldecimals-from-toml-floats
- has