Better HN
topnewbestaskshowjobs
Log inSign up

not_skynet

11 karma · joined Jul 25, 2021 (5y ago) · 7 submissions

mivanit.github.io
Submissions

comment 1y ago · link · parent

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))`

comment 1y ago · link · parent

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.

comment 3y ago · link · parent

going to shamelessly plug my library for python architecture visualization here: https://github.com/mivanit/dep-graph-viz

comment 4y ago · link · parent

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.

5.

Show HN: Minimal Static Site Generator(github.com ↗)

5 points · by not_skynet · 4y ago · discuss

comment 4y ago · link · parent

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.

comment 5y ago · link · parent

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.