Aspose.Slides FOSS for Python

Overview

The Aspose.Slides FOSS for Python API is organized into the aspose.slides_foss package and its sub-packages. All public classes live under aspose.slides_foss or one of its sub-modules.

import aspose.slides_foss as slides
from aspose.slides_foss.export import SaveFormat
from aspose.slides_foss import ShapeType, FillType, NullableBool
from aspose.slides_foss.drawing import Color, PointF

Core Classes

ClassDescription
PresentationRoot container. Open or create a .pptx file. Must be used as a context manager.
ISlideCollectionCollection of slides accessible via prs.slides.
SlideA single slide; access shapes, notes, and comments via slide.shapes, slide.notes_slide_manager.
ShapeCollectionCollection of shapes on a slide. Add shapes with add_auto_shape(), add_table(), add_connector(), add_picture_frame().
AutoShapeRectangular, elliptical, or other standard shape.
PictureFrameShape containing an embedded raster image.
TableTabular shape with rows, columns, and cell collections. Supports merge_cells() and set_text_format().
RowA table row; also acts as a CellCollection.
CellA table cell with text_frame, cell_format, margin, anchor, and span properties.
ColumnA table column with a width property.
ConnectorLine connector linking two shapes.
TextFrameText container attached to a shape. Contains paragraphs.
ParagraphSingle paragraph in a TextFrame. Contains portions and paragraph_format.
ParagraphFormatParagraph layout: alignment, spacing, indent, depth, and bullet settings.
BulletFormatBullet and numbering settings for a paragraph.
PortionRun of text within a paragraph. Contains text and portion_format.
PortionFormatCharacter-level formatting: font_height, font_bold, font_italic, fill_format, underline, and more.
FillFormatFill settings for a shape or text: fill_type, solid_fill_color, gradient_fill_format.
LineFormatLine/border formatting: width, dash_style, cap_style, join_style, arrowheads.
LineFillFormatFill (colour) of a line stroke.
EffectFormatVisual effects: outer_shadow_effect, glow_effect, blur_effect, reflection_effect, inner_shadow_effect, soft_edge_effect.
ThreeDFormat3D formatting: bevel_top, bevel_bottom, camera, light_rig, material, extrusion_height.
CameraScene camera settings (projection type and rotation).
LightRigScene lighting preset and direction.
ShapeBevelBevel type and dimensions for one edge of a 3D shape.
NotesSlideManagerManages speaker notes for a slide via add_notes_slide().
NotesSlideSpeaker notes page; notes_text_frame gives access to note text.
CommentAuthorCollectionCollection of comment authors; add with prs.comment_authors.add_author().
CommentAuthorA named comment author with initials and a comments collection.
CommentA threaded comment on a slide with position, timestamp, text, and optional parent.
DocumentPropertiesCore, app, and custom presentation properties (title, author, keywords, custom key-value pairs).
ImageCollectionEmbedded images; add with prs.images.add_image(). Iterate to inspect all images.
PPImageA single embedded image. Exposes content_type, width, height, binary_data, and replace_image().
ImagesStatic factory. Load images from disk or stream with Images.from_file() / Images.from_stream().
PictureFillFormatControls stretch/tile fill of a picture inside a shape. Exposes crop, tile, and stretch offsets.
PictureFrameShape containing an embedded raster image. Access image via picture_format.
LayoutSlideTemplate slide defining content arrangement for one or more Slide objects.
MasterSlideTop-level theme slide. Owns a collection of LayoutSlide objects.
LayoutSlideCollectionCollection of layout slides. Use get_by_type(SlideLayoutType) to find a layout by type.
MasterSlideCollectionCollection of master slides (prs.masters). Supports add_clone() to import masters from other presentations.
GlobalLayoutSlideCollectionFlat view of all layouts across all masters (prs.layout_slides).
SlideCollectionprs.slides — manages all slides. add_empty_slide(), add_clone(), insert_clone(), remove_at().
ColorFormatColor used in fills, lines, and text. Supports RGB, preset, scheme, HSL, and system modes.
GradientFormatGradient fill definition. Controls gradient_shape, gradient_direction, linear_gradient_angle, and gradient_stops.
GradientStopA single position/color stop in a gradient.
GradientStopCollectionOrdered list of gradient stops with add(), insert(), remove_at().
PatternFormatHatch pattern fill. Controls pattern_style, fore_color, back_color.
FontDataImmutable font-name wrapper used by PortionFormat.latin_font and related properties.
PlaceholderPlaceholder regions on layout/master slides. See Placeholder reference.

Enumerations

EnumImport PathKey Members
ShapeTypeaspose.slides_fossRECTANGLE, ELLIPSE, TRIANGLE, BENT_CONNECTOR3, STRAIGHT_CONNECTOR1, and many more
FillTypeaspose.slides_fossNOT_DEFINED, NO_FILL, SOLID, GRADIENT, PATTERN, PICTURE
NullableBoolaspose.slides_fossNOT_DEFINED, FALSE, TRUE
SaveFormataspose.slides_foss.exportPPTX (only supported save format)
ColorTypeaspose.slides_fossNOT_DEFINED, RGB, SCHEME, PRESET, SYSTEM, HSL, RGB_PERCENTAGE
PresetColoraspose.slides_foss141 named CSS/Office colors (ALICE_BLUEYELLOW_GREEN)
SchemeColoraspose.slides_fossBACKGROUND1, TEXT1, ACCENT1ACCENT6, HYPERLINK, and more
GradientDirectionaspose.slides_fossFROM_CORNER1FROM_CORNER4, FROM_CENTER
GradientShapeaspose.slides_fossLINEAR, RECTANGLE, RADIAL, PATH
PatternStyleaspose.slides_foss46 hatch patterns (HORIZONTAL, DIAGONAL_CROSS, TRELLIS, …)
SlideLayoutTypeaspose.slides_fossBLANK, TITLE, TITLE_ONLY, SECTION_HEADER, 41 members total
SourceFormataspose.slides_fossPPTX, PPT, ODP

Sub-Packages

PackageDescription
aspose.slides_foss.exportSaveFormat enum and related export types
aspose.slides_foss.drawingColor, PointF, Size, SizeF — drawing primitives and colour helpers

Quick Reference

import aspose.slides_foss as slides
from aspose.slides_foss import ShapeType, FillType, NullableBool
from aspose.slides_foss.drawing import Color
from aspose.slides_foss.export import SaveFormat

with slides.Presentation() as prs:
    slide = prs.slides[0]

    # Add shape with text
    shape = slide.shapes.add_auto_shape(ShapeType.RECTANGLE, 50, 50, 400, 120)
    tf = shape.add_text_frame("Slide content")

    # Format the text
    fmt = tf.paragraphs[0].portions[0].portion_format
    fmt.font_height = 24
    fmt.font_bold = NullableBool.TRUE
    fmt.fill_format.fill_type = FillType.SOLID
    fmt.fill_format.solid_fill_color.color = Color.from_argb(255, 0, 70, 127)

    # Fill the shape
    shape.fill_format.fill_type = FillType.SOLID
    shape.fill_format.solid_fill_color.color = Color.from_argb(255, 230, 240, 255)

    prs.save("demo.pptx", SaveFormat.PPTX)

See Also