HNHacker News
TopNewBestAskShowJobs

not_skynet

11 karma · joined July 25, 2021

mivanit.github.io
submissionscomments
not_skynet··on Loading Pydantic models from JSON without running out of memory
It does allow dumping to/recovering from json, apologies if that isn't well documented.

Calling `x: str = json.dumps(MyClass(...).serialize())` will get you json you can recover to the original object, nested classes and custom types and all, with `MyClass.load(json.loads(x))`

not_skynet··on Loading Pydantic models from JSON without running out of memory
going to shamelessly plug my own library here: https://github.com/mivanit/ZANJ

You can have nested dataclasses, as well as specify custom serializers/loaders for things which aren't natively supported by json.

not_skynet··on Show HN: Archsense – Accurately generated architecture from the source code
going to shamelessly plug my library for python architecture visualization here: https://github.com/mivanit/dep-graph-viz
not_skynet··on Evolving my note-taking processes
I use [Dendron](https://www.dendron.so) for this. You can add tags or links to any entry, and the targets of those links will have backlinks. There's a nice "daily note" mechanism as well.

[Foam](https://github.com/foambubble/foam) seems very similar but I haven't personally tried it.

not_skynet··on The appeal of using plain HTML pages (2019)
this is probably the best chance I'll get to plug this on HN: https://github.com/mivanit/pandoc-sitegen

It's a truly dead simple static site generator that uses pandoc to turn the markdown into HTML, and mustache as the templating language. It's about 400 lines of actual code total. It doesn't include an actual server, it just converts your markdown files into HTML. It's by no means finished but I use it for my personal website.

not_skynet··on How the Python import system works
I actually spent time wrestling with exactly this earlier today, and I think I finally have a 2 line solution for it:

https://pastebin.com/5WCXb2Gg

Assuming `foo.bar` is a script inside the package `foo` that you want to both import and run directly (without `python -m ...`), this lets you do so without too much hassle.