The `java-manifest` library provides functionality to encode and decode Java's `META-INF/MANIFEST.MF` files using Python. It represents a manifest as a list of dictionaries, where each dictionary corresponds to a section within the manifest. The library is currently at version 1.1.0, with its last release in July 2020, indicating a low release cadence.
pip install java-manifestVerified import paths — ran on the pinned version, not inferred.
Demonstrates loading a Java manifest string into a Python list of dictionaries, modifying it, and then dumping it back to a manifest-formatted string.
Always ensure your manifest strings or files terminate with a newline character (e.g., `"Key: Value\n"` for a single line, or a final `\n` after the last entry for multi-line manifests).
For complex or non-string values, provide custom `encoder` and `decoder` functions to `java_manifest.dumps()` and `java_manifest.loads()` respectively, to convert between Python objects and string representations as needed. The default behavior expects string or boolean values.
Ensure that the manifest string or file you are processing or creating explicitly ends with a newline character (`\n`).
Before dumping, convert all non-string/non-boolean values in your manifest data (list of dictionaries) to their string representations, or provide a custom `encoder` function to `java_manifest.dumps()` that handles the specific data types you are using.
No dependency data recorded yet.