|
1 | 1 | # API Reference |
2 | 2 |
|
3 | | -## Presentation |
4 | | - |
5 | | -### Constructor |
6 | | - |
7 | | -```python |
8 | | -Presentation(template: Optional[str] = None) |
9 | | -``` |
10 | | - |
11 | | -Creates a new presentation, optionally using a template. |
12 | | - |
13 | | -### Methods |
14 | | - |
15 | | -#### add_slide |
16 | | - |
17 | | -```python |
18 | | -def add_slide(self, layout: Optional[str] = None) -> Slide |
19 | | -``` |
20 | | - |
21 | | -Adds a new slide to the presentation. |
22 | | - |
23 | | -#### save |
24 | | - |
25 | | -```python |
26 | | -def save(self, filename: str, format: Optional[str] = None) |
27 | | -``` |
28 | | - |
29 | | -Saves the presentation to a file. |
30 | | - |
31 | | -## Slide |
32 | | - |
33 | | -### Methods |
34 | | - |
35 | | -#### add_title |
36 | | - |
37 | | -```python |
38 | | -def add_title(self, text: str) -> Shape |
39 | | -``` |
40 | | - |
41 | | -Adds a title to the slide. |
42 | | - |
43 | | -#### add_text |
44 | | - |
45 | | -```python |
46 | | -def add_text(self, text: str, x: Optional[float] = None, y: Optional[float] = None) -> Shape |
47 | | -``` |
48 | | - |
49 | | -Adds text to the slide at the specified position. |
50 | | - |
51 | | -#### add_image |
52 | | - |
53 | | -```python |
54 | | -def add_image( |
55 | | - self, |
56 | | - image_path: str, |
57 | | - x: Optional[float] = None, |
58 | | - y: Optional[float] = None, |
59 | | - width: Optional[float] = None, |
60 | | - height: Optional[float] = None |
61 | | -) -> Shape |
62 | | -``` |
63 | | - |
64 | | -Adds an image to the slide. |
65 | | - |
66 | | -#### add_table |
67 | | - |
68 | | -```python |
69 | | -def add_table( |
70 | | - self, |
71 | | - data: List[List[Any]], |
72 | | - x: Optional[float] = None, |
73 | | - y: Optional[float] = None, |
74 | | - width: Optional[float] = None, |
75 | | - height: Optional[float] = None |
76 | | -) -> Shape |
77 | | -``` |
78 | | - |
79 | | -Adds a table to the slide. |
80 | | - |
81 | | -#### add_shape |
82 | | - |
83 | | -```python |
84 | | -def add_shape( |
85 | | - self, |
86 | | - shape_type: str, |
87 | | - x: float, |
88 | | - y: float, |
89 | | - width: float, |
90 | | - height: float |
91 | | -) -> Shape |
92 | | -``` |
93 | | - |
94 | | -Adds a shape to the slide. |
95 | | - |
96 | | -## Shape |
97 | | - |
98 | | -### Properties |
99 | | - |
100 | | -- `fill_color: str` - The fill color of the shape |
101 | | -- `line_color: str` - The line color of the shape |
102 | | -- `line_width: float` - The line width of the shape |
103 | | -- `text: str` - The text content of the shape |
104 | | -- `font_name: str` - The font name for text |
105 | | -- `font_size: float` - The font size for text |
106 | | -- `font_bold: bool` - Whether the text is bold |
107 | | -- `font_italic: bool` - Whether the text is italic |
108 | | - |
109 | | -### Methods |
110 | | - |
111 | | -#### set_position |
112 | | - |
113 | | -```python |
114 | | -def set_position(self, x: float, y: float) |
115 | | -``` |
116 | | - |
117 | | -Sets the position of the shape. |
118 | | - |
119 | | -#### set_size |
120 | | - |
121 | | -```python |
122 | | -def set_size(self, width: float, height: float) |
123 | | -``` |
124 | | - |
125 | | -Sets the size of the shape. |
126 | | - |
127 | | -## DataFrameSupport |
128 | | - |
129 | | -When using the pandas or polars support: |
130 | | - |
131 | | -### Methods |
132 | | - |
133 | | -#### add_dataframe |
134 | | - |
135 | | -```python |
136 | | -def add_dataframe( |
137 | | - self, |
138 | | - df: Union[pd.DataFrame, pl.DataFrame], |
139 | | - x: Optional[float] = None, |
140 | | - y: Optional[float] = None, |
141 | | - width: Optional[float] = None, |
142 | | - height: Optional[float] = None |
143 | | -) -> Shape |
144 | | -``` |
145 | | - |
146 | | -Adds a data frame as a table to the slide. |
| 3 | +::: tppt |
| 4 | + options: |
| 5 | + show_root_heading: true |
| 6 | + show_root_full_path: false |
| 7 | + show_category_heading: true |
| 8 | + show_if_no_docstring: true |
| 9 | + show_signature_annotations: true |
| 10 | + show_bases: true |
| 11 | + show_submodules: true |
| 12 | + group_by_category: true |
| 13 | + heading_level: 2 |
| 14 | + members_order: source |
0 commit comments