proycon / codemetapy

A Python package for generating and working with codemeta
https://codemeta.github.io/
GNU General Public License v3.0
24 stars 5 forks source link

Metadata from pypi, or internal #37

Open broeder-j opened 1 year ago

broeder-j commented 1 year ago

Just an idea:

Pypi has an API for the basic metadata, for example see: https://pypi.org/pypi/codemetapy/json

one could use that as a backup if the parsing directly fails... (through then there is probably also nothing on pypi).

You use the orginal metadata parser from pkg and importlib_metadata, right?

One could also request the metadata for each python dependency that way to fill from that the metadata of the dependencies required for codemeta, or parse the metadata from the dependencies (which would only work if installed or?).

proycon commented 1 year ago

Pypi has an API for the basic metadata, for example see: https://pypi.org/pypi/codemetapy/json

one could use that as a backup if the parsing directly fails... (through then there is probably also nothing on pypi).

That sounds like a good idea yes. It should be quite doable. We also have Github and Gitlab API support after all, adding PyPi to the mix as a potential source makes sense. Though indeed I'd rather have it as a fallback and not rely on it primarily, as I think it's best if we can get as much from the git clone itself.

I'm definitely open to contributions on this.

You use the orginal metadata parser from pkg and importlib_metadata, right?

Indeed, that saves having to parse pyproject.toml or setup.py or setup.cfg directly and seems to most elegant way.

One could also request the metadata for each python dependency that way to fill from that the metadata of the dependencies required for codemeta, or parse the metadata from the dependencies (which would only work if installed or?).

The actual dependencies seem not be listed in the pypi JSON. But from the source repo, it would work yeah.

broeder-j commented 1 year ago

I am quit busy. I still want to finish the harvester contribution at some point and after lets see.