Skip to main content

Tools for building ESP-IDF related apps.

Project description

esp-bool-parser

esp-bool-parser is a package that provides a way to process boolean statements based on soc_caps files in the ESP-IDF.

It helps you locate soc_headers files in the ESP-IDF, parse them, and store the parsed values as constants, which are then used in ChipAttr.

When you import esp_bool_parser, you will gain access to the following functions:

Key Functions

parse_bool_expr(stmt: str)

Parses a boolean expression.

  • Parameters:

    • stmt (str): A string containing the boolean expression.
  • Returns:

    • A parsed representation of the boolean expression.
  • Usage Example:

    stmt_string = 'IDF_TARGET == "esp32"'
    stmt = parse_bool_expr(stmt_string)
    result = stmt.get_value("esp32", "config_name")
    

register_addition_attribute(attr: str, action: t.Callable[..., t.Any]) -> None

Registers an additional attribute for ChipAttr.

You can extend the functionality of ChipAttr by adding custom handlers for new attributes. Use the register_addition_attribute function to register additional attributes. When these attributes are encountered, the associated handler function will be called. Additionally, you can override existing attributes, as the newly registered handler will take priority over the original ones.

  • Parameters:

    • attr (str): The name of the additional attribute.
    • action (Callable): A callable that processes **kwargs. The target and config_name parameters will be passed as kwargs when the attribute is detected.
  • Usage Example:

    def my_action(target, config_name, **kwargs):
        # Custom logic to handle the attribute
        print(f"Processing {target} with {config_name}")
        return target
    
    register_addition_attribute("CUSTOM_ATTR", my_action)
    

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

esp_bool_parser-0.2.2.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

esp_bool_parser-0.2.2-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file esp_bool_parser-0.2.2.tar.gz.

File metadata

  • Download URL: esp_bool_parser-0.2.2.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for esp_bool_parser-0.2.2.tar.gz
Algorithm Hash digest
SHA256 37311a0762717a6ebbd047a2d298aaea6190ad0d848b07f1fdf38ac6e1ceec4c
MD5 9336991343813cc899e44a60385187c6
BLAKE2b-256 eeefec45b973e7afe312a65cc540f59cdc5dedf31cea14ff0c30f089e07d15e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for esp_bool_parser-0.2.2.tar.gz:

Publisher: publish-pypi.yml on espressif/esp-bool-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file esp_bool_parser-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for esp_bool_parser-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a574b635f935761558ca9d6abf22f3c8ce80cdd6247b8577a8a571f21eaed352
MD5 b5cfdf1c460bc8b9c7d90365a6bf20cc
BLAKE2b-256 6c19463eb01f219eff0eb4d755bd4c80935a48ce1a9c646c9cd8dcf131cff54c

See more details on using hashes here.

Provenance

The following attestation bundles were made for esp_bool_parser-0.2.2-py3-none-any.whl:

Publisher: publish-pypi.yml on espressif/esp-bool-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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