Skip to main content

Generate and edit Touch OSC .tosc files

Project description

tosc-generate

Using XML trees to generate simple Touch OSC XML templates. Make sure to backup your .tosc files before editing them.

Custom classes and functions that help navigate the structure of the .tosc file. Example:

def setPropertyValue(self, key : str, text : str = "", params : dict = {}) -> bool:
    """ Set the key's value.text and/or value's {<element> : element.text} """
    for property in self.properties:
        if re.fullmatch(property.find("key").text, key):
            value = property.find("value")
            for paramKey in params:
                param = ET.SubElement(value, paramKey)
                param.text = params[paramKey]

            value.text = text if text else ""
            return True
    return False

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tosclib-0.1.1.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

tosclib-0.1.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page