Skip to main content

eo-proto-merge

Tests

A CLI tool for merging eo-protocol extensions and outputting extended protocol XML files ready to use with any eolib code generator.


Installation

pip install eo-proto-merge

Requires Python 3.9+.


Commands

Command Description
eo-proto-merge apply Fetch extensions, merge XML, and write extended protocol files
eo-proto-merge validate Dry-run merge to check for conflicts without writing any files

eo-proto-merge apply

Reads an extensions.xml config, fetches extension sources, merges the XML into the base eo-protocol files, and writes the result to an output directory.

eo-proto-merge apply --config=extensions.xml

Options:

Flag Default Description
--config extensions.xml Path to your extensions.xml file
--output ./eo-protocol/xml Output directory for the merged protocol XML files

The output directory mirrors the structure of the upstream eo-protocol/xml/ repo and can be passed directly to any eolib code generator.


eo-proto-merge validate

Fetches the base eo-protocol and all extensions to the local cache, then performs a dry-run merge to check for conflicts — without writing any output files. Useful for catching merge errors during extension development or in CI.

eo-proto-merge validate --config=extensions.xml

extensions.xml format

Create an extensions.xml file in your project to declare which extensions to apply:

<extensions>
  <!-- Official registry extension (git, https://github.com/sorokya/eo-protocol-extensions) -->
  <extension type="git" name="deep"/>

  <!-- Extension from a custom repository -->
  <extension type="git"
             name="my-feature"
             repo="https://github.com/my-org/eo-protocol-extensions"/>

  <!-- Pin to a specific tag or commit -->
  <extension type="git" name="my-feature" ref="v2.0.0"
             repo="https://github.com/my-org/eo-protocol-extensions"/>

  <!-- Local file-based extension (good for development) -->
  <extension type="file" name="local-test" path="../my-extension"/>
</extensions>

Extensions are applied in the order they appear. Later extensions can append to or replace definitions introduced by earlier ones.

The path for type="file" can be relative (resolved from the extensions.xml location) or absolute.


Extension XML format

Extension protocol.xml files mirror the structure of the base eo-protocol XML files.

The extend attribute

extend can be used on top-level elements (<enum>, <struct>, <packet>) to control the merge behavior:

Value Behavior
(absent) New — definition must not already exist. Error if it does.
"append" Append — push child elements onto an existing definition.
"replace" Replace — completely swap out an existing definition.

extend="replace" can also be used on individual <value> children inside an extend="append" enum block to rename a specific existing value by its numeric position, without replacing the whole enum:

<!-- Rename Reserved7 to Spell while leaving all other values intact -->
<enum name="ItemType" extend="append">
    <value name="Spell" extend="replace">7</value>
</enum>

Appending switch cases

Use extend="append" on a <switch> child to add new <case> elements without replacing the whole definition. The merger locates the target <switch> by its field attribute, searching recursively — it works whether the switch is a direct child or nested inside a <chunked> block.

<struct name="AvatarChange" extend="append">
    <switch field="change_type" extend="append">
        <case value="Skin">
            <field name="skin" type="char"/>
        </case>
    </switch>
</struct>

Conflict rules

Situation Behavior
New definition with duplicate name Error — use extend="replace" to override
Append to nonexistent target Error — check name and extension order
Replace nonexistent target Error
Enum append with duplicate numeric value Error — numeric conflicts corrupt generated code
Enum value replace with nonexistent numeric value Error — check the numeric value
Switch append with no matching field Error — check the field name

Example

<?xml version="1.0" encoding="UTF-8"?>
<protocol>
    <!-- Add a brand-new enum -->
    <enum name="Rarity" type="char">
        <value name="Common">0</value>
        <value name="Rare">1</value>
    </enum>

    <!-- Add a new value to an existing enum -->
    <enum name="PacketFamily" extend="append">
        <value name="Rarity">200</value>
    </enum>

    <!-- Rename an existing reserved value by numeric position -->
    <enum name="ItemType" extend="append">
        <value name="Spell" extend="replace">7</value>
    </enum>

    <!-- Completely replace an existing struct -->
    <struct name="Coords" extend="replace">
        <field name="x" type="short"/>
        <field name="y" type="short"/>
        <field name="layer" type="char"/>
    </struct>

    <!-- Add new cases to a switch inside an existing struct -->
    <struct name="AvatarChange" extend="append">
        <switch field="change_type" extend="append">
            <case value="Skin">
                <field name="skin" type="char"/>
            </case>
        </switch>
    </struct>

    <!-- Add a new client-to-server packet -->
    <packet family="Rarity" action="Request">
        <field name="item_id" type="short"/>
    </packet>
</protocol>

Extension directory structure

An extension directory mirrors the layout of eo-protocol/xml/:

my-extension/
  protocol.xml              ← top-level definitions (enums, structs, misc packets)
  net/
    client/
      protocol.xml          ← client-to-server packets
    server/
      protocol.xml          ← server-to-client packets
  pub/
    protocol.xml            ← pub file type definitions (EIF, ENF, ESF, ECF)

Not all files are required — include only what your extension touches.


License

MIT

Metadata

Release files for eo-proto-merge 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eo-proto-merge 0.2.0
File Size Uploaded Provenance Actions
eo_proto_merge-0.2.0.tar.gz 18.7 kB With provenance Details for eo_proto_merge-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for eo-proto-merge 0.2.0
File Interpreter ABI Platform Actions
eo_proto_merge-0.2.0-py3-none-any.whl Python 3 none any Details for eo_proto_merge-0.2.0-py3-none-any.whl

Total release size: 31.9 kB

Release files / eo_proto_merge-0.2.0.tar.gz

Download URL eo_proto_merge-0.2.0.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0c724d5fcf36deb6ae72f95089cbcb89286201fb6e56b9dc348a8fa7056fe75d
BLAKE2b-256 checksum
How to use checksums
8204918717160f162836583bf309c90ca203e5496efaae98ca0b33c8cd56b490
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.

Transparency log

Release files / eo_proto_merge-0.2.0-py3-none-any.whl

Download URL eo_proto_merge-0.2.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee3f16831febbe1bbf0c344a89615ac4c29167ade78acc6275f8b82c62767e09
BLAKE2b-256 checksum
How to use checksums
ecd56c8d9d0b53cd3d805c04ba8e591655c3d33a9607c6c18bd1a81aaaf24cc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.

Transparency log

Security for eo-proto-merge 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for eo_proto_merge-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page