Open goodboy opened 1 year ago
personal todo: Need to link our PR for inline array comment config support and possibly open an issue to support passing through such inputs to .item.array()
Linking in tomlkit
issues we need in order for us to be able to use that lib:
Heh, i actually was on the side of this issue / request submitted to the spec: https://github.com/toml-lang/toml/issues/516
After reading it though, i don't think multi-line tables really are that necessary.
Interested in what others think though as well.
Since we already had to roll our own based on writing a particular styled
.clears
table to thepps.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 the
toml
encoder 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 whattomli
does (the fastest pure py reader soon to land in the stdlib) and then we can just droptoml
outright and worry about getting a general encoder later.[x] support better indentation per broker-account for better readability, indented tables per broker-account would be super nice if possible
tomlkit
below which supports this -> https://github.com/pikers/tomlkit/blob/writing_docs_tweaks/tomlkit/items.py#L1644Array.multiline()
https://github.com/sdispater/tomlkit/pull/294Turns out there's been a bunch of project updates in the space 🙏🏼,
tomlkit
: from thepoetry
/pendulum
auth: https://github.com/sdispater/tomlkit and is based on arust
lib :godmode:Decimal
input support: https://github.com/sdispater/tomlkit/issues/288bidict
input support: https://github.com/sdispater/tomlkit/issues/289msgspec.toml
now exists :party: which means we can natively render our msgs and structs easily!tomli(-w)
underneath so using that probably makes the most sense for our speed solution.a list of other alt libs that we prolly won't use but figured might as well put them here just in case:
pytomlpp
c++ wrapped parser: https://bobfang1992.github.io/pytomlpp/pytomlpp.htmltoml-w
, stdlib'stoml
sibling writer lib: https://github.com/hukkin/tomli-w#does-tomli-w-support-writing-documents-with-comments-or-custom-whitespaceDecimal
support which i don't think is intomlkit
: https://github.com/hukkin/tomli#construct-decimaldecimals-from-toml-floats