Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

android-bp

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

android-bp

A python module to parse Android.bp files

  • 0.3.0
  • PyPI
  • Socket score

Maintainers
1

android-bp

A python module to parse Android.bp files (wrapper for android_bp rust module)

Goals

This module will quickly parse Android.bp files and provide a python interface to access the data.

Non-Goals

This module is only intended to parse Android.bp files, not to generate or rewrite them.

Usage

    from android_bp import Blueprint

    # bp is a rust object, but behave mostly like a read only python object
    bp = Blueprint.from_file("Android.bp")

    # for debug, you can print any of internal objects
    # they will be printed as rust would in debug fmt
    print(bp)

    # internal variables are accessible as a python dict
    print(bp.variables)

    # modules are accessible as a python list
    for m in bp.modules:
        if m.__type__ == "rust_binary":
            # module properties can be accessed directly as python attributes
            print(m.name)

    # or iter them by type
    for m in bp.modules_by_type("rust_host_test"):
        # or via __dict__
        print(m.__dict__["name"])

        # for convenience, unknown properties return None (not an AttributeError)
        print(m.unknown_attribute) # prints None

        # map properties are accessible as python dicts
        print(m.test_options['unit_test'])

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc