Skip to content

typeshed_stats.serialize API reference

Tools for serializing and deserializing PackageInfo and FileInfo objects.


file_stats_from_csv(data)

Load FileInfo objects from csv format.

Parameters:

Name Type Description Default
data str

A CSV string.

required

Returns:

Type Description
list[FileInfo]

The statistics deserialized into FileInfo objects.


file_stats_from_json(data)

Load FileInfo objects from JSON format.

Parameters:

Name Type Description Default
data str

A JSON string.

required

Returns:

Type Description
list[FileInfo]

The statistics deserialized into FileInfo objects.


package_stats_from_csv(data)

Load PackageInfo objects from csv format.

Parameters:

Name Type Description Default
data str

A CSV string.

required

Returns:

Type Description
list[PackageInfo]

The statistics deserialized into PackageInfo objects.


package_stats_from_json(data)

Load PackageInfo objects from JSON format.

Parameters:

Name Type Description Default
data str

A JSON string.

required

Returns:

Type Description
list[PackageInfo]

The statistics deserialized into PackageInfo objects.


stats_to_csv(stats)

Convert stats on multiple stubs packages to csv format.

Parameters:

Name Type Description Default
stats Sequence[PackageInfo | FileInfo]

The statistics to convert.

required

Returns:

Type Description
str

The statistics serialized as a CSV string.


stats_to_json(stats)

Convert stats on multiple stubs packages to JSON format.

Parameters:

Name Type Description Default
stats Sequence[PackageInfo | FileInfo]

The statistics to convert.

required

Returns:

Type Description
str

The statistics serialized as JSON.


stats_to_markdown(stats)

Generate MarkDown describing statistics on multiple stubs packages.

Parameters:

Name Type Description Default
stats Sequence[PackageInfo]

The statistics to convert.

required

Returns:

Type Description
str

A markdown page describing the statistics.