Replying to Avatar Juraj

What is the best current Python Nostr client library?

https://github.com/holgern/pynostr

https://github.com/jeffthibault/python-nostr

Both had last commit two years ago, which is paleolithic in Nostr terms.

Nostr-SDK seems more recent, but it is bindings to Rust. And I hate Rust, which is computational marxism. But I might swallow it if I don't ever need to touch Rust code.

https://pypi.org/project/nostr-sdk/

Suggestions and tips? Am I missing something?

Nostr SDK is the best bet. Yes, it is written in Rust, but you don't have to interact with it directly, although some Rusticisms do boil down all the way to the Python code.

Reply to this note

Please Login to reply.

Discussion

OMG, that is a horrible piece of software :(. API documentation is basically just a few random examples. For example I don't see even basic things how to create a public key from npub (the "Keys" section in documentation contains only secret keys).

Documentation here:

https://rust-nostr.org/

Yes, guessing your way forward...

And even events and tags are not iterable...

:(

(That's the rust computational Marxism making its way to python code).

I'm guessing I should rather have gone with non rust python native library, but they are not very well maintained.

I'm a bit shocked, such a cool new and developing tech, so bad libraries. Almost makes me want to code one, but I'm coding something very cool using Nostr, this would be a total derailment, so I think I'll consider it a pilgrimage and go through the pain.

Use `to_vec` to convert them to an array, so you can iterate them.

As it is written pretty much everywhere, the project is in alpha state, so obviously the documentation is not complete. PRs are welcome to improve it.

To parse a public key (hex, bech32 or nostr URI): `PublicKey.parse`.