ParseAIA Documentation

ParseAIA is a simple python library for extracting data from .aia files (App Inventor projects)

Simple explanation

The library works by extracting all of the data from an app inventor project. The one class you'll need is Project, it represents one app inventor project.

Quick Example:

from parseaia import Project

myProject = Project("ExampleApp.aia") # Initiate a Project with the filepath to the .aia

print(myProject.Screen1.UI.Properties.Components) # Printing out all the UI elements

This example prints out all the UI elements in the screen "Screen1" (The default screen name when you create an app in app inventor, most apps will have it)

Full Documentation

class Project

Description

Every Screen in the project is a property of this class, so if your project has a screen called "Screen1" then you can reference it with Project.Screen1

Properties

class main.Screen

Description

This is a screen from the Project, it has the screen's code and ui

Properties

class codeclasses.Code

Description

This is all of the code from a screen

Properties

class codeclasses.Block

Description

This is a block in the code of a screen

Properties

class codeclasses.Value

Description

This is a value in the code of a screen. It also contains the information for a block, since a value has both

Properties

class codeclasses.Statement

Description

This is a statement in the code of a screen

Properties

class uiclasses.UI

Description

Represents the screen UI element from a screen

Properties

class uiclasses.Properties

Description

Represents the properties of a screen UI element from a screen. Has many more potential properties than shown here, these are just the default ones, if for example the screen's background color is changed, there would be a property to represent that

Properties

class uiclasses.Component

Description

Represents a Component of a screen UI element from a screen. Has many more potential properties than shown here, these are just the default ones, if for example the element's background color is changed, there would be a property to represent that

Properties

class Audio

Description

Contains info (and data) of one audio file.

Properties

Custom Parsing

Explanation

If you have assets that can't be properly parsed just by reading or that aren't images, then this might help with your problem. You can use the parse_function keyword argument when creating a new project to set how every asset will be parsed.

Just create a parsing function, it can be called anything, and do anything as long as it has three arguments, those being:

Example

import parseaia


def myparsefunction(project, assetpath, filename):  # Create a function for parsing
    print(assetpath + filename)  # This one just prints all the filepaths

myProject = parseaia.Project("Example.aia", parse_function=myparsefunction)  # Use the function when creating a project