Place for a direct_url.json parser

As part of PEP 600 and PEP 610 a new file called direct_url.json is created in the distribution folder. There are use cases (see importlib-metadata#404) where users want to get information out of this file. I created a draft PR where @jaraco asked, if importlib-metadata is the right place for this? Another possible place is packaging or maybe a completely new library?

So I open this topic to answer:

  1. does a parser make sense and helps users?
  2. where is the right place for this?

What more is needed here beyond parsing the JSON contents of the file and taking data out of it?

nothing else I guess. Of course it’s possible to code it manually, but since it is a PEP-defined format, an “official parser” would be nice. In addition, the location can depend on the system, therefore another argument for a library to handle it

If this gets implemented, please note also PEP-710 which is in a draft state as of today.

A nice API (a simple function) that would immediately get information about a package could be nice. Without a need to repeat the *.dist-info path creation + related checks and transparently wrap what PEPs define for people who are not familiar with them.