gentle.metadata.utils#

Utilities for metadata generators.

gentle.metadata.utils.extract_name_email(author: str) Person | None#

Make a Person object from a string.

Parameters:

author – string in the name <email> format

Returns:

person object

>>> extract_name_email("Foo Bar <foobar@example.com>")
Person(name='Foo Bar', email='foobar@example.com', status=<MaintainerStatus.NONE: 1>)
>>> extract_name_email("Foo Bar") is None
True
gentle.metadata.utils.extract_remote_id(url: str) RemoteID | None#

Make a RemoteID object from a string.

Parameters:

url – project’s source repository

Returns:

remote-id object

>>> extract_remote_id("https://pypi.org/project/foo-bar")
RemoteID(attr='pypi', value='foo-bar')
>>> extract_remote_id("https://example.com") is None
True