Component

class appstream_python.Component.InternetRelationDict

the type for the content of the Internet attribute

value: Literal['alwaysoffline-onlyfirst-run']
bandwidth_mbitps: Optional[int]
class appstream_python.Component.TranslateableTag

Represents a translatable tag

get_default_text() str

Returns the untranslated text

set_default_text(text: str) None

Sets the untranslated text

get_translated_text(lang: str) Optional[str]

Returns the translated text

set_translated_text(lang: str, text: str) None

Sets the translated text

get_available_languages() list[str]

Returns a list with all languages of the tag

load_tags(tag_list: list[lxml.etree.Element]) None

Load a list of Tags

write_tags(parent_tag: Element, tag_name: str) None

Writes a Tag

clear() None

Resets all data

class appstream_python.Component.TranslateableList

Represents a translatable list

get_default_list() list[str]

Returns a list with the default items

load_tag(tag: Element) None

Loads a Tag Only for internal use.

write_all_tag(parent_tag: Element, tag_name: str) None

Writes the XML tags. Onyl for internal use.

clear() None

Resets all data

class appstream_python.Component.DescriptionItem

The Interface for a Description Item

get_type() Literal['paragraph', 'unordered-list', 'ordered-list']

Retutns the Type of the Item

load_tags(tag_list: list[lxml.etree.Element]) None

Loads teh XML tags into the Elemnt. Only for internal use.

get_tags(parent_tag: Element) None

Get the XML Tag from the Element. Only for internal use.

get_translated_tag(lang: Optional[str]) Element

Loads the tag for a given language

class appstream_python.Component.DescriptionParagraph

Represents a paragraph <p> in the Description

content

The Text of the Paragraph

get_type() Literal['paragraph', 'unordered-list', 'ordered-list']

Retutns the Type of the Item

load_tags(tag_list: list[lxml.etree.Element]) None

Loads teh XML tags into the Elemnt. Only for internal use.

get_tags(parent_tag: Element) None

Get the XML Tag from the Element. Only for internal use.

get_translated_tag(lang: Optional[str]) Element

Loads the tag for a given language

class appstream_python.Component.DescriptionList(list_type: str)

Represents a list <ul>/<ol> in the Description

content: TranslateableList

The list

get_type() Literal['paragraph', 'unordered-list', 'ordered-list']

Retutns the Type of the Item

load_tags(tag_list: list[lxml.etree.Element]) None

Loads teh XML tags into the Elemnt. Only for internal use.

get_tags(parent_tag: Element) None

Get the XML Tag from the Element. Only for internal use.

get_translated_tag(lang: Optional[str]) Element

Loads the tag for a given language

class appstream_python.Component.Description

Represents a <description> tag

items: list[appstream_python.Component.DescriptionItem]

All Description Items

load_tags(tag: Element) None

Load a XML tag. Onyl for internal use.

get_tags(parent_tag: Element) None

Writes a Description tag. Only for internal use.

to_html(lang: Optional[str]) str

Get the HTML code of the description in the given language

class appstream_python.Component.Release

Represents a <release> tag

version: str

The version

date: Optional[date]

The date

description

The description

load_tag(tag: Element) None

Loads a release tag

class appstream_python.Component.Image

Represents a <image> tag

url: str

The image URL

type: Literal['source', 'thumbnail']

The image type

width: Optional[int]

The width

height: Optional[int]

The height

language: Optional[str]

The language

load_tag(tag: Element) None

Loads a image tag

class appstream_python.Component.Screenshot

Represents a <screenshot> tag

images: list[appstream_python.Component.Image]

the list with thumbnail images

caption: TranslateableTag

The caption

get_source_image() Optional[Image]

Returns the soucre image

get_thumbnail_images() list[appstream_python.Component.Image]

Returns the thumbnail images

load_tag(tag: Element) None

Load a screenshot tag

class appstream_python.Component.AppstreamComponent

Represents AppStream Component

id: str

The component ID

type: str

The type

name: TranslateableTag

The component name

developer_name: TranslateableTag

The developer name

summary: TranslateableTag

The component summary

description: Description

The description

metadata_license: str

The metadata license

project_license: str

The project license

urls: dict[Literal['homepage', 'bugtracker', 'faq', 'help', 'donation', 'translate', 'contact', 'vcs-browser', 'contribute'], str]

The URLs

oars: dict[Literal['violence-cartoon', 'violence-fantasy', 'violence-realistic', 'violence-bloodshed', 'violence-sexual', 'violence-desecration', 'violence-slavery', 'drugs-alcohol', 'drugs-narcotics', 'drugs_tobacco', 'sex_nudity', 'sex-themes', 'language-profanity', 'language-humor', 'language-discrimination', 'money-advertising', 'money-gambling', 'money-purchasing', 'social-chat', 'social-audio', 'social-contacts', 'social-info', 'social-location'], Literal['none', 'mild', 'moderate', 'intense']]

The content rating

categories: list[str]

The categories

provides: dict[Literal['mediatype', 'library', 'binary', 'font', 'modalias', 'firmware', 'python2', 'python3', 'dbus', 'id'], list[str]]

The provides. The content of the depracted mimetype tag goes intp provides[‘mimetype’]

releases: list[appstream_python.Component.Release]

The releases

screenshots: list[appstream_python.Component.Screenshot]

The screenshots

project_group: Optional[str]

The project group

translation: list[dict[str, str]]

The translations

languages: dict[str, int]

The languages

keywords: TranslateableList

The Keywords

controls: dict[Literal['pointing', 'keyboard', 'console', 'tablet', 'touch', 'gamepad', 'tv-remote', 'voice', 'vision'], Optional[Literal['requires', 'recommends', 'supports']]]

The Controls

kudos: list[str]

The Kudos

update_contact: Optional[str]

The update contact

replaces: list[str]

The replaces tag

suggests: list[str]

The suggests tag

custom: dict[str, str]

The custom tag

extends: list[str]

The extends tag for addons

clear() None

Resets the Component

get_available_languages() list[str]

Returns a list with all available languages of the Component

parse_component_tag(tag: _ElementTree) None

Parses a XML tag

load_file(path: Union[str, PathLike]) None

Load an appdata.xml or metainfo.xml file

load_bytes(data: bytes, encoding: Optional[str] = None) None

Load an appdata.xml or metainfo.xml byte string

load_string(text: str) None

Load an appdata.xml or metainfo.xml string

get_component_tag() Element

Creates a XML tag from the Component

get_xml_string() str

Returns the XML data of the Component as string

save_file(path: str) None

Saves the Component as XML file