pyprojectsort#

pyprojectsort implementation.

Code Documentation#

pyprojectsort implementation.

pyprojectsort.main.get_comparison_array(items: list | dict, values: bool = False) list[str]#

Returns an array from an iterable to be used for comparison.

Dictionary keys are returned by default, and values if specified.

Examples

>>> get_comparison_array([2, 4, 5])
['2', '4', '5']
>>> get_comparison_array({"a": 1, "b": 2})
['a', 'b']
>>> get_comparison_array({"a": 1, "b": 2}, values=True)
['1', '2']
pyprojectsort.main.main() None#

Run application.

pyprojectsort.main.reformat_pyproject(pyproject: dict | list) dict#

Reformat pyproject toml file.