Hacker News new | ask | show | jobs
by networked 693 days ago
Last year I posted a similar Ask HN; it got 11 comments: https://news.ycombinator.com/item?id=38505531. I asked, "What lesser-known Python libraries do you wish people knew about?" The suggestions there are worth looking up. Don't miss DiskCache (https://github.com/grantjenks/python-diskcache).

I really like xmltodict (https://github.com/martinblech/xmltodict). Despite the name, it works in both directions. It is the most ergonomic library I have used for creating XML. It has external type stubs: https://pypi.org/project/types-xmltodict/.

Since you have recently discovered Rich, you may want rich-argparse (https://github.com/hamdanal/rich-argparse). It colorizes argparse CLIs with little effort from the user.

DeepDiff (https://github.com/seperman/deepdiff) has helped me with testing. I needed to compare two nested data structures but ignore any differences in floats (timestamps). DeepDiff let me do it:

  diff = DeepDiff(
     run_session(config), run_session(config, force=True), exclude_types=(float,)
  )

  assert not diff
pzp (https://github.com/andreax79/pzp) is like fzf in pure Python to use in your programs. Keep in mind it is currently version 0.0.x. I have found bugs, but I think it is just cool that it exists.
1 comments

Thanks so much for pzp !