Skip to content

Commit 3f26825

Browse files
author
Kevin Sheppard
committed
ENH: Add and update XML io interface
1 parent 65120b7 commit 3f26825

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

pandas-stubs/core/frame.pyi

+24
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ from pandas._typing import (
4848
Axes,
4949
Axis,
5050
AxisType,
51+
CompressionOptions,
5152
Dtype,
5253
DtypeNp,
54+
FilePath,
5355
FilePathOrBuffer,
5456
FilePathOrBytesBuffer,
5557
GroupByObjectNonScalar,
@@ -61,12 +63,15 @@ from pandas._typing import (
6163
Label,
6264
Level,
6365
MaskType,
66+
ReadBuffer,
6467
Renamer,
6568
Scalar,
6669
ScalarT,
6770
SeriesAxisType,
71+
StorageOptions,
6872
StrLike,
6973
T as TType,
74+
WriteBuffer,
7075
np_ndarray_bool,
7176
np_ndarray_str,
7277
num,
@@ -332,6 +337,25 @@ class DataFrame(NDFrame, OpsMixin):
332337
render_links: _bool = ...,
333338
encoding: _str | None = ...,
334339
) -> _str: ...
340+
def to_xml(
341+
self,
342+
path_or_buffer: FilePath | WriteBuffer[bytes] | WriteBuffer[str] | None = ...,
343+
index: bool = ...,
344+
root_name: str | None = ...,
345+
row_name: str | None = ...,
346+
na_rep: str | None = ...,
347+
attr_cols: list[str] | None = ...,
348+
elem_cols: list[str] | None = ...,
349+
namespaces: dict[str | None, str] | None = ...,
350+
prefix: str | None = ...,
351+
encoding: str = ...,
352+
xml_declaration: bool | None = ...,
353+
pretty_print: bool | None = ...,
354+
parser: str | None = ...,
355+
stylesheet: FilePath | ReadBuffer[str] | ReadBuffer[bytes] | None = ...,
356+
compression: CompressionOptions = ...,
357+
storage_options: StorageOptions = ...,
358+
) -> str | None: ...
335359
def info(
336360
self, verbose=..., buf=..., max_cols=..., memory_usage=..., null_counts=...
337361
) -> None: ...

pandas-stubs/io/pickle.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ from pandas._typing import (
1111
)
1212

1313
def to_pickle(
14-
obj: Any,
14+
obj: object,
1515
filepath_or_buffer: FilePath | WriteBuffer[bytes],
1616
compression: CompressionOptions = ...,
1717
protocol: int = ...,

pandas-stubs/io/xml.pyi

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ def read_xml(
2525
dtype: DtypeArg | None = ...,
2626
converters: ConvertersArg | None = ...,
2727
parse_dates: ParseDatesArg | None = ...,
28-
# encoding can not be None for lxml and StringIO input
2928
encoding: str | None = ...,
30-
parser: XMLParsers | None = ...,
29+
parser: XMLParsers = ...,
3130
stylesheet: FilePath | ReadBuffer[bytes] | ReadBuffer[str] | None = ...,
3231
iterparse: dict[str, list[str]] | None = ...,
33-
compression: CompressionOptions | None = ...,
34-
storage_options: StorageOptions | None = ...,
32+
compression: CompressionOptions = ...,
33+
storage_options: StorageOptions = ...,
3534
) -> DataFrame: ...

0 commit comments

Comments
 (0)