{"library":"jsii","title":"jsii Python Client","description":"jsii is an open-source framework developed by AWS that enables code in any language (such as Python, Java, C#, and Go) to naturally interact with JavaScript classes authored in TypeScript. It is a core technology behind the AWS Cloud Development Kit (CDK), allowing polyglot libraries to be delivered from a single TypeScript codebase. The project is actively maintained by AWS, with frequent updates to the compiler, pacmak (bindings generator), and runtime libraries.","status":"active","version":"1.127.0","language":"en","source_language":"en","source_url":"https://github.com/aws/jsii.git","tags":["aws","typescript","code-generation","interoperability","cdk","runtime"],"install":[{"cmd":"pip install jsii","lang":"bash","label":"Install jsii runtime"}],"dependencies":[{"reason":"Used by authors to generate language bindings from jsii assemblies. It has a peer dependency on jsii-rosetta.","package":"jsii-pacmak","optional":true},{"reason":"Peer dependency of jsii-pacmak for sample code transliteration.","package":"jsii-rosetta"}],"imports":[{"note":"The 'jsii' package itself is typically imported for decorators like @jsii.implements when authoring extensions to jsii-generated types. Application code consuming jsii-generated libraries imports directly from those libraries (e.g., 'from my_jsii_lib import MyClass').","symbol":"jsii","correct":"import jsii"},{"note":"Used as a decorator (@jsii.implements) to explicitly declare Python classes implementing jsii interfaces, avoiding metaclass conflicts.","symbol":"implements","correct":"from jsii import implements"}],"quickstart":{"code":"import os\nfrom some_jsii_generated_lib import HelloJsii\n\n# NOTE: In a real scenario, 'some_jsii_generated_lib' would be a library\n# generated by jsii (e.g., AWS CDK, or your own jsii module) which has\n# 'jsii' as a dependency. The 'HelloJsii' class would be defined in TypeScript.\n\n# Example of using a class from a jsii-generated Python library\ntry:\n    # Assuming HelloJsii class and say_hello method are available\n    # This code is illustrative; replace with actual generated lib usage.\n    hello_instance = HelloJsii()\n    message = hello_instance.say_hello(\"World\")\n    print(message)\nexcept ImportError:\n    print(\"To run this, you need a jsii-generated library installed.\")\n    print(\"For example, 'pip install aws-cdk.core' and then use CDK classes.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"The `jsii` library itself provides the runtime for generated modules. Python developers primarily interact with packages that have been *generated* by jsii (e.g., AWS CDK constructs). These generated packages depend on `jsii`. The example above illustrates how you would typically use a class from such a generated library."},"warnings":[{"fix":"Ensure your Python environment is version 3.8 or higher. For best compatibility, use Python 3.11+.","message":"The `jsii-pacmak` tool and the Python libraries it generates now require a minimum Python version of 3.8. Previously, this was Python 3.7. It is recommended to upgrade to Python 3.11 or later.","severity":"breaking","affected_versions":"jsii-pacmak >= 1.86.0 (approx)"},{"fix":"Upgrade your Node.js installation to version 18 or higher. For best compatibility, use Node.js 20+.","message":"All `jsii` libraries and tools now require a minimum version of Node.js 18. This was previously Node.js 16. It is recommended to upgrade to Node.js 20 or later, as `jsii` modules rely on an embedded JavaScript VM.","severity":"breaking","affected_versions":"jsii >= 1.127.0 (and related tools)"},{"fix":"Use the `@jsii.implements(IJsiiInterface)` decorator to explicitly declare interface implementation. For example: `import jsii; @jsii.implements(IJsiiInterface) class MyNewClass():`","message":"When implementing interfaces defined by `jsii` modules in Python, traditional multiple inheritance (e.g., `class MyNewClass(IJsiiInterface):`) will likely cause a metaclass conflict. This is due to `jsii`'s `JSIIMeta` metaclass.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Define properties using `@property` and `@<property_name>.setter` decorators.","message":"When extending or implementing types from `jsii` modules, properties must always be implemented using Python's `@property` decorator to ensure the `jsii` runtime correctly processes access to them by the `jsii` kernel.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Where possible, instantiate the `jsii` struct class explicitly instead of relying on implicit `dict` conversion. Consult the specific `jsii`-generated library's documentation for correct struct usage.","message":"Passing Python `dict` literals in places where a `jsii` struct is expected might not always work consistently. This can lead to type-checking errors in the `jsii/kernel` module, incorrect translation of property keys (e.g., snake_case to camelCase), or properties being dropped entirely.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider the performance implications for your specific use case. If high-performance is critical, native implementations might be more suitable.","message":"jsii modules, due to their reliance on an embedded JavaScript engine and marshalling costs, are best suited for development and build tools (like AWS CDK) rather than performance-sensitive or resource-constrained applications.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-06T00:00:00.000Z","next_check":"2026-07-05T00:00:00.000Z"}