typeshed_stats.serialize API reference
Tools for serializing and deserializing PackageInfo
and FileInfo
objects.
file_stats_from_csv(data)
file_stats_from_json(data)
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
|
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
|
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. |