diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 1652e4bd..bf6601c4 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -1,6 +1,6 @@
# How to Contribute
-Thank you for taking the time to contribute to `msgspec`!
+Thank you for taking the time to contribute to `msgspec-x`!
Here we document some contribution guidelines to help you ensure that your
contribution is at its best.
@@ -17,17 +17,17 @@ Once you have those installed, you're ready to:
- Clone the repository
- Install all development dependencies
-- Build a development version of `msgspec`
+- Build a development version of `msgspec-x`
- Install the `pre-commit` hooks
```bash
# Clone the repository
-git clone https://github.com/jcrist/msgspec.git
+git clone https://github.com/nightsailer/msgspec-x.git
# cd into the repo root directory
-cd msgspec/
+cd msgspec-x/
-# Build and install msgspec & all dev dependencies
+# Build and install msgspec-x & all dev dependencies
pip install -e ".[dev]"
# Install the pre-commit hooks
@@ -36,9 +36,9 @@ pre-commit install
## Editing and Rebuilding
-You now have a "development" build of `msgspec` installed. This means that you
+You now have a "development" build of `msgspec-x` installed. This means that you
can make changes to the `.py` files and test them without requiring a rebuild
-of msgspec's C extension. Edit away!
+of msgspec-x's C extension. Edit away!
If you do make changes to a `.c` file, you'll need to recompile. You can do
this by running
@@ -47,7 +47,7 @@ this by running
pip install -e .
```
-By default `msgspec` is built in release mode, with optimizations enabled. To
+By default `msgspec-x` is built in release mode, with optimizations enabled. To
build a debug build instead (for use with e.g. `gdb` or `lldb`) define the
`MSGSPEC_DEBUG` environment variable before building.
@@ -112,6 +112,6 @@ and fix any issues that come up.
## Code of Conduct
-``msgspec`` has a code of conduct that must be followed by all contributors to
+``msgspec-x`` has a code of conduct that must be followed by all contributors to
the project. You may read the code of conduct
-[here](https://github.com/jcrist/msgspec/blob/main/CODE_OF_CONDUCT.md).
+[here](https://github.com/nightsailer/msgspec-x/blob/main/CODE_OF_CONDUCT.md).
diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml
index 69642142..0ba43770 100644
--- a/.github/ISSUE_TEMPLATE/bug.yml
+++ b/.github/ISSUE_TEMPLATE/bug.yml
@@ -1,5 +1,5 @@
name: 🪲 Bug Report
-description: Report a bug or unexpected behavior in msgspec
+description: Report a bug or unexpected behavior in msgspec-x
body:
- type: markdown
attributes:
diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml
index 76170921..10e7c1f8 100644
--- a/.github/ISSUE_TEMPLATE/feature.yml
+++ b/.github/ISSUE_TEMPLATE/feature.yml
@@ -1,5 +1,5 @@
name: 🙌 Feature Request
-description: Suggest a new feature or change to msgspec
+description: Suggest a new feature or change to msgspec-x
body:
- type: markdown
attributes:
diff --git a/.github/SECURITY.md b/.github/SECURITY.md
index 2fd47a5b..9b33c631 100644
--- a/.github/SECURITY.md
+++ b/.github/SECURITY.md
@@ -1,7 +1,7 @@
# Security Policy
-If you believe you have found a security-related bug with `msgspec`, **do not
-open a public GitHub issue**. Instead, please email jcristharif@gmail.com.
+If you believe you have found a security-related bug with `msgspec-x`, **do not
+open a public GitHub issue**. Instead, please email nightsailer@gmail.com.
Please include as much detail as you would for a normal issue in your report.
In particular, including a minimal reproducible example will help the
diff --git a/MANIFEST.in b/MANIFEST.in
index 1332a61e..339d01d4 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -3,6 +3,9 @@ include msgspec/*.h
include msgspec/*.py
include msgspec/*.pyi
include msgspec/py.typed
+include msgspec_x/*.py
+include msgspec_x/*.pyi
+include msgspec_x/py.typed
include setup.py
include versioneer.py
include README.md
diff --git a/README.md b/README.md
index ba26bc08..eeda43f4 100644
--- a/README.md
+++ b/README.md
@@ -1,110 +1,141 @@
+# Msgspec-x
+
+
+## Overview
-`msgspec` is a *fast* serialization and validation library, with builtin
-support for [JSON](https://json.org), [MessagePack](https://msgpack.org),
-[YAML](https://yaml.org), and [TOML](https://toml.io). It features:
+`msgspec-x` is a community-driven fork of the [original msgspec library](https://jcristharif.com/msgspec/) by Jim Crist-Harif. This project was created to address the challenge of slow upstream maintenance and to provide a platform for community contributions that couldn't be timely integrated into the original project.
-- 🚀 **High performance encoders/decoders** for common protocols. The JSON and
- MessagePack implementations regularly
- [benchmark](https://jcristharif.com/msgspec/benchmarks.html) as the fastest
- options for Python.
+### Why msgspec-x?
-- 🎉 **Support for a wide variety of Python types**. Additional types may be
- supported through
- [extensions](https://jcristharif.com/msgspec/extending.html).
+The original msgspec library is an excellent project, but the maintainer has limited time to review and merge community pull requests. This has resulted in valuable contributions and bug fixes being stuck in the review process. `msgspec-x` was created to:
-- 🔍 **Zero-cost schema validation** using familiar Python type annotations. In
- [benchmarks](https://jcristharif.com/msgspec/benchmarks.html) `msgspec`
- decodes *and* validates JSON faster than
- [orjson](https://github.com/ijl/orjson) can decode it alone.
+- **Accelerate community contributions**: Provide a faster path for community PRs and enhancements
+- **Enable rapid bug fixes**: Address issues without waiting for upstream review cycles
+- **Extend functionality**: Add new features that complement the original design
+- **Maintain compatibility**: Keep full backward compatibility with the original msgspec API
-- ✨ **A speedy Struct type** for representing structured data. If you already
- use [dataclasses](https://docs.python.org/3/library/dataclasses.html) or
- [attrs](https://www.attrs.org),
- [structs](https://jcristharif.com/msgspec/structs.html) should feel familiar.
- However, they're
- [5-60x faster](https://jcristharif.com/msgspec/benchmarks.html#benchmark-structs>)
- for common operations.
+### **⚠️ IMPORTANT: Installation Notice**
-All of this is included in a
-[lightweight library](https://jcristharif.com/msgspec/benchmarks.html#benchmark-library-size)
-with no required dependencies.
+**Do not install both `msgspec` and `msgspec-x` simultaneously!** They are conflicting packages that cannot coexist in the same environment. If you have the original `msgspec` installed, uninstall it first:
+
+```bash
+pip uninstall msgspec
+pip install msgspec-x
+```
----
+## Dual Namespace Architecture
-`msgspec` may be used for serialization alone, as a faster JSON or
-MessagePack library. For the greatest benefit though, we recommend using
-`msgspec` to handle the full serialization & validation workflow:
+`msgspec-x` provides two distinct namespaces to serve different needs:
-**Define** your message schemas using standard Python type annotations.
+### 1. `msgspec` Namespace - Full Compatibility
+The `msgspec` namespace maintains 100% API compatibility with the original library. All your existing code will work without any changes:
```python
->>> import msgspec
+import msgspec # Drop-in replacement for original msgspec
->>> class User(msgspec.Struct):
-... """A new type describing a User"""
-... name: str
-... groups: set[str] = set()
-... email: str | None = None
+class User(msgspec.Struct):
+ name: str
+ email: str
+
+# All existing msgspec code works exactly the same
+user = User("alice", "alice@example.com")
+data = msgspec.json.encode(user)
+decoded = msgspec.json.decode(data, type=User)
```
-**Encode** messages as JSON, or one of the many other supported protocols.
+### 2. `msgspec_x` Namespace - Extended Features
+The `msgspec_x` namespace provides additional functionality and enhancements not available in the original library:
```python
->>> alice = User("alice", groups={"admin", "engineering"})
+import msgspec_x # Extended features and community contributions
+
+# Extended features will be documented as they are added
+# This namespace allows for innovative features without breaking compatibility
+```
->>> alice
-User(name='alice', groups={"admin", "engineering"}, email=None)
+## Core Features
->>> msg = msgspec.json.encode(alice)
+`msgspec-x` inherits all the powerful features from the original msgspec library:
->>> msg
-b'{"name":"alice","groups":["admin","engineering"],"email":null}'
+- 🚀 **High performance encoders/decoders** for JSON, MessagePack, YAML, and TOML
+- 🎉 **Support for a wide variety of Python types** with extension capabilities
+- 🔍 **Zero-cost schema validation** using Python type annotations
+- ✨ **Fast Struct type** for structured data representation
+- 📦 **Lightweight library** with no required dependencies
+
+All protocols and performance characteristics are maintained from the original implementation.
+
+## Quick Start
+
+### Installation
+
+```bash
+pip install msgspec-x
```
-**Decode** messages back into Python objects, with optional schema validation.
+### Basic Usage
+
+Define your message schemas using standard Python type annotations:
```python
->>> msgspec.json.decode(msg, type=User)
-User(name='alice', groups={"admin", "engineering"}, email=None)
+import msgspec
->>> msgspec.json.decode(b'{"name":"bob","groups":[123]}', type=User)
-Traceback (most recent call last):
- File "", line 1, in
-msgspec.ValidationError: Expected `str`, got `int` - at `$.groups[0]`
+class User(msgspec.Struct):
+ """A new type describing a User"""
+ name: str
+ groups: set[str] = set()
+ email: str | None = None
```
-`msgspec` is designed to be as performant as possible, while retaining some of
-the nicities of validation libraries like
-[pydantic](https://pydantic-docs.helpmanual.io/). For supported types,
-encoding/decoding a message with `msgspec` can be
-[~10-80x faster than alternative libraries](https://jcristharif.com/msgspec/benchmarks.html).
+Encode messages as JSON or other supported protocols:
+
+```python
+alice = User("alice", groups={"admin", "engineering"})
+msg = msgspec.json.encode(alice)
+# Output: b'{"name":"alice","groups":["admin","engineering"],"email":null}'
+```
+
+Decode messages back into Python objects with schema validation:
+
+```python
+# Successful decoding
+user = msgspec.json.decode(msg, type=User)
+
+# Validation error example
+msgspec.json.decode(b'{"name":"bob","groups":[123]}', type=User)
+# Raises: ValidationError: Expected `str`, got `int` - at `$.groups[0]`
+```
+
+## Performance
+
+`msgspec-x` maintains the same exceptional performance characteristics as the original msgspec library. In benchmarks, it can be 10-80x faster than alternative libraries for encoding/decoding with validation.
-See [the documentation](https://jcristharif.com/msgspec/) for more information.
+## Community & Contributing
+
+This project welcomes community contributions! Unlike the original project, we aim to provide faster review cycles and more responsive maintenance.
+
+- 🐛 **Bug Reports**: Issues are addressed promptly
+- 🚀 **Feature Requests**: Community-driven feature development
+- 🔧 **Pull Requests**: Faster review and merge process
+- 📚 **Documentation**: Community-maintained documentation improvements
+
+## Documentation
+
+For detailed documentation, examples, and API references, visit:
+- **Project Documentation**: [https://nightsailer.github.io/msgspec-x/](https://nightsailer.github.io/msgspec-x/)
+- **Original msgspec docs**: [https://jcristharif.com/msgspec/](https://jcristharif.com/msgspec/) (for reference)
+
+## License
+New BSD License. See the [License File](https://github.com/nightsailer/msgspec-x/blob/main/LICENSE).
-## LICENSE
+## Acknowledgments
-New BSD. See the
-[License File](https://github.com/jcrist/msgspec/blob/main/LICENSE).
+Special thanks to Jim Crist-Harif for creating the original msgspec library. This fork exists to complement and extend his excellent work, not to replace it.
diff --git a/docs/source/_templates/help.html b/docs/source/_templates/help.html
index 919b6d3e..550a6e48 100644
--- a/docs/source/_templates/help.html
+++ b/docs/source/_templates/help.html
@@ -1,5 +1,5 @@
+ Open an issue in the issue tracker.
+
\ No newline at end of file
diff --git a/docs/source/api.rst b/docs/source/api.rst
index f7602e03..994cbc4e 100644
--- a/docs/source/api.rst
+++ b/docs/source/api.rst
@@ -8,6 +8,10 @@ Structs
.. autoclass:: Struct
+**StructMeta**
+
+The metaclass for Struct types. This class can be subclassed to create custom struct behaviors. See :ref:`struct-meta-subclasses` for detailed information on using StructMeta subclasses.
+
.. autofunction:: field
.. autofunction:: defstruct
diff --git a/docs/source/benchmarks.rst b/docs/source/benchmarks.rst
index 39934a7e..7d3ec24a 100644
--- a/docs/source/benchmarks.rst
+++ b/docs/source/benchmarks.rst
@@ -2,6 +2,7 @@ Benchmarks
==========
.. note::
+ These benchmarks are for ``msgspec-x``, a community-driven fork of the original msgspec project.
Benchmarks are *hard*.
diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
index b40eba3b..b52166bc 100644
--- a/docs/source/changelog.rst
+++ b/docs/source/changelog.rst
@@ -3,6 +3,90 @@ Changelog
.. currentmodule:: msgspec
+Version 0.20.0 (2025-06-21)
+---------------------------
+
+**🎉 MAJOR: Community Fork Release**
+
+This is the first release of ``msgspec-x``, a community-driven fork of the original msgspec library by Jim Crist-Harif. This fork was created to accelerate community contributions and provide a platform for extended features while maintaining full backward compatibility.
+
+**🚀 NEW MAJOR FEATURE: StructMeta Subclasses Support**
+
+- **Add comprehensive support for StructMeta subclasses** - the primary feature that motivated this fork.
+- Enable custom metaclasses that inherit from `StructMeta` to work seamlessly with all msgspec functions.
+- **TECHNICAL**: Modified C code to use `PyType_IsSubtype()` instead of direct type comparison for StructMeta detection.
+- Affected functions now support StructMeta subclasses:
+
+ - `msgspec.structs.asdict` - Convert struct instances to dictionaries
+ - `msgspec.structs.astuple` - Convert struct instances to tuples
+ - `msgspec.structs.replace` - Create modified copies of struct instances
+ - `msgspec.structs.force_setattr` - Force attribute setting on frozen structs
+ - JSON encoding/decoding operations
+ - MessagePack encoding/decoding operations
+ - `msgspec.convert` - Type conversion operations
+ - `msgspec.to_builtins` - Convert to builtin types
+
+- Comprehensive test coverage for StructMeta subclasses including:
+
+ - Single-level StructMeta inheritance
+ - Multi-level StructMeta inheritance chains
+ - Integration with all struct utility functions
+ - Encoder/decoder compatibility testing
+ - Nested struct support with custom metaclasses
+
+- **Use Cases**: This enables advanced users to create custom struct behaviors through metaclass programming while maintaining full compatibility with msgspec's serialization ecosystem.
+
+**Project Rename and Fork**
+
+- **BREAKING**: Project renamed from ``msgspec`` to ``msgspec-x``. Do not install both packages simultaneously.
+- Fork created due to slow upstream maintenance and to enable faster community contribution cycles.
+- All project metadata, URLs, and documentation updated to reflect the new ``msgspec-x`` identity.
+- Repository moved to ``https://github.com/nightsailer/msgspec-x``.
+- Maintainer changed to Night Sailer (nightsailer@gmail.com).
+
+**Dual Namespace Architecture**
+
+- Introduce dual namespace architecture to support both compatibility and extensions:
+
+ - ``msgspec`` namespace: 100% API compatibility with the original library for drop-in replacement.
+ - ``msgspec_x`` namespace: Extended features and community contributions (placeholder structure created).
+
+- All existing code using ``import msgspec`` will continue to work without changes.
+- New extended features will be available under ``msgspec_x`` namespace.
+
+**Installation and Distribution**
+
+- Package name changed to ``msgspec-x`` on PyPI.
+- Updated installation commands: ``pip install msgspec-x`` and ``conda install msgspec-x -c conda-forge``.
+- Added clear warnings about not installing both ``msgspec`` and ``msgspec-x`` in the same environment.
+- Updated versioneer configuration to use ``msgspec-x-`` prefix for source distributions.
+
+**Documentation Overhaul**
+
+- Comprehensive documentation update to reflect the project fork and new architecture.
+- Added explanation of the dual namespace system and community-driven development model.
+- Updated all GitHub links, issue tracker URLs, and example source references.
+- Enhanced installation documentation with compatibility warnings.
+- Updated contributing guidelines and security policies for the new project structure.
+
+**Community and Development**
+
+- Established faster review and merge cycles for community contributions.
+- Updated GitHub issue templates and workflows for the new repository.
+- Created placeholder structure for experimental features in ``msgspec_x`` namespace.
+- Enhanced project documentation to welcome community contributions.
+
+**Technical Infrastructure**
+
+- Updated build configuration (``setup.py``, ``setup.cfg``, ``MANIFEST.in``) for the new package structure.
+- Enhanced CI/CD workflows for the dual namespace architecture.
+- Updated type stub files and package metadata for both namespaces.
+- Maintained all existing performance characteristics and API compatibility.
+
+**Acknowledgments**
+
+This release acknowledges and thanks Jim Crist-Harif for creating the original msgspec library. This fork exists to complement and extend his excellent work, not to replace it.
+
Version 0.19.0 (2024-12-27)
---------------------------
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 668f3a79..a8d4469e 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -18,9 +18,9 @@ class UnsetType:
pass
-project = "msgspec"
-copyright = "Jim Crist-Harif"
-author = "Jim Crist-Harif"
+project = "msgspec-x"
+copyright = "Night Sailer"
+author = "Night Sailer"
GITHUB_LOGO = """