Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Before getting started, you will need to already have installed:
Once you have those installed, you're ready to clone the repository:

```
git clone https://github.com/jcrist/msgspec.git
git clone https://github.com/msgspec/msgspec.git
cd msgspec/
```

Expand Down Expand Up @@ -131,7 +131,7 @@ just doc-serve

## Benchmarking

You can run all [benchmarks](https://jcristharif.com/msgspec/benchmarks.html) with the `bench` recipe, for example:
You can run all [benchmarks](https://msgspec.dev/benchmarks.html) with the `bench` recipe, for example:

```
just bench encodings
Expand Down Expand Up @@ -225,4 +225,4 @@ and fix any issues that come up.

`msgspec` 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/.github/CODE_OF_CONDUCT.md).
[here](https://github.com/msgspec/msgspec/blob/main/.github/CODE_OF_CONDUCT.md).
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<p align="center">
<a href="https://jcristharif.com/msgspec/">
<a href="https://msgspec.dev/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/jcrist/msgspec/main/docs/_static/msgspec-logo-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/jcrist/msgspec/main/docs/_static/msgspec-logo-light.svg">
<img src="https://raw.githubusercontent.com/jcrist/msgspec/main/docs/_static/msgspec-logo-light.svg" width="35%" alt="msgspec">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/msgspec/msgspec/main/docs/_static/msgspec-logo-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/msgspec/msgspec/main/docs/_static/msgspec-logo-light.svg">
<img src="https://raw.githubusercontent.com/msgspec/msgspec/main/docs/_static/msgspec-logo-light.svg" width="35%" alt="msgspec">
</picture>
</a>
</p>

<div align="center">

[![CI](https://github.com/jcrist/msgspec/actions/workflows/ci.yml/badge.svg)](https://github.com/jcrist/msgspec/actions/workflows/ci.yml)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://jcristharif.com/msgspec/)
[![License](https://img.shields.io/github/license/jcrist/msgspec.svg)](https://github.com/jcrist/msgspec/blob/main/LICENSE)
[![CI](https://github.com/msgspec/msgspec/actions/workflows/ci.yml/badge.svg)](https://github.com/msgspec/msgspec/actions/workflows/ci.yml)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://msgspec.dev/)
[![License](https://img.shields.io/github/license/msgspec/msgspec.svg)](https://github.com/msgspec/msgspec/blob/main/LICENSE)
[![PyPI Version](https://img.shields.io/pypi/v/msgspec.svg)](https://pypi.org/project/msgspec/)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/msgspec.svg)](https://anaconda.org/conda-forge/msgspec)
[![Code Coverage](https://codecov.io/gh/jcrist/msgspec/branch/main/graph/badge.svg)](https://app.codecov.io/gh/jcrist/msgspec)
[![Code Coverage](https://codecov.io/gh/msgspec/msgspec/branch/main/graph/badge.svg)](https://app.codecov.io/gh/msgspec/msgspec)

</div>

Expand All @@ -25,28 +25,28 @@ support for [JSON](https://json.org), [MessagePack](https://msgpack.org),

- 🚀 **High performance encoders/decoders** for common protocols. The JSON and
MessagePack implementations regularly
[benchmark](https://jcristharif.com/msgspec/benchmarks.html) as the fastest
[benchmark](https://msgspec.dev/benchmarks.html) as the fastest
options for Python.

- 🎉 **Support for a wide variety of Python types**. Additional types may be
supported through
[extensions](https://jcristharif.com/msgspec/extending.html).
[extensions](https://msgspec.dev/extending.html).

- 🔍 **Zero-cost schema validation** using familiar Python type annotations. In
[benchmarks](https://jcristharif.com/msgspec/benchmarks.html) `msgspec`
[benchmarks](https://msgspec.dev/benchmarks.html) `msgspec`
decodes *and* validates JSON faster than
[orjson](https://github.com/ijl/orjson) can decode it alone.

- ✨ **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/en/stable/),
[structs](https://jcristharif.com/msgspec/structs.html) should feel familiar.
[structs](https://msgspec.dev/structs.html) should feel familiar.
However, they're
[5-60x faster](https://jcristharif.com/msgspec/benchmarks.html#structs)
[5-60x faster](https://msgspec.dev/benchmarks.html#structs)
for common operations.

All of this is included in a
[lightweight library](https://jcristharif.com/msgspec/benchmarks.html#library-size)
[lightweight library](https://msgspec.dev/benchmarks.html#library-size)
with no required dependencies.

---
Expand Down Expand Up @@ -97,18 +97,18 @@ msgspec.ValidationError: Expected `str`, got `int` - at `$.groups[0]`
the nicities of validation libraries like
[pydantic](https://pydantic.dev/docs/validation/latest/get-started/). For supported types,
encoding/decoding a message with `msgspec` can be
[~10-80x faster than alternative libraries](https://jcristharif.com/msgspec/benchmarks.html).
[~10-80x faster than alternative libraries](https://msgspec.dev/benchmarks.html).

<p align="center">
<a href="https://jcristharif.com/msgspec/benchmarks.html">
<img src="https://raw.githubusercontent.com/jcrist/msgspec/main/docs/_static/bench-validation.svg">
<a href="https://msgspec.dev/benchmarks.html">
<img src="https://raw.githubusercontent.com/msgspec/msgspec/main/docs/_static/bench-validation.svg">
</a>
</p>

See [the documentation](https://jcristharif.com/msgspec/) for more information.
See [the documentation](https://msgspec.dev/) for more information.


## LICENSE

New BSD. See the
[License File](https://github.com/jcrist/msgspec/blob/main/LICENSE).
[License File](https://github.com/msgspec/msgspec/blob/main/LICENSE).
2 changes: 1 addition & 1 deletion docs/_templates/help.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h3>Need help?</h3>

<p>
Open an issue in the <a href="https://github.com/jcrist/msgspec/issues">issue tracker</a>.
Open an issue in the <a href="https://github.com/msgspec/msgspec/issues">issue tracker</a>.
</p>
14 changes: 7 additions & 7 deletions docs/benchmarks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Each benchmark creates a message containing one or more ``File``/``Directory``
instances, then serializes, deserializes, and validates it in a loop.

The full benchmark source can be found
`here <https://github.com/jcrist/msgspec/tree/main/benchmarks/bench_validation>`__.
`here <https://github.com/msgspec/msgspec/tree/main/benchmarks/bench_validation>`__.

.. raw:: html

Expand Down Expand Up @@ -130,7 +130,7 @@ popular Python JSON libraries.
- json_ (standard library)

The full benchmark source can be found
`here <https://github.com/jcrist/msgspec/blob/main/benchmarks/bench_encodings.py>`__.
`here <https://github.com/msgspec/msgspec/blob/main/benchmarks/bench_encodings.py>`__.

.. raw:: html

Expand Down Expand Up @@ -187,7 +187,7 @@ For each library, we measure both the peak increase in memory usage (RSS) and
the time to JSON decode the file.

The full benchmark source can be found `here
<https://github.com/jcrist/msgspec/blob/main/benchmarks/bench_large_json.py>`__.
<https://github.com/msgspec/msgspec/blob/main/benchmarks/bench_large_json.py>`__.

**Results (smaller is better):**

Expand Down Expand Up @@ -252,7 +252,7 @@ For each library, the following operations are benchmarked:
- Time to compare two instances for order (``<``/``>``/``<=``/``>=``)

The full benchmark source can be found `here
<https://github.com/jcrist/msgspec/blob/main/benchmarks/bench_structs.py>`__.
<https://github.com/msgspec/msgspec/blob/main/benchmarks/bench_structs.py>`__.

**Results (smaller is better):**

Expand Down Expand Up @@ -299,7 +299,7 @@ of the benchmarked type, then measure:
- The total amount of memory used by this data structure

The full benchmark source can be found `here
<https://github.com/jcrist/msgspec/blob/main/benchmarks/bench_gc.py>`__.
<https://github.com/msgspec/msgspec/blob/main/benchmarks/bench_gc.py>`__.

**Results (smaller is better):**

Expand Down Expand Up @@ -342,7 +342,7 @@ Here we compare the on-disk size of ``msgspec`` and ``pydantic``, its closest
equivalent.

The full benchmark source can be found `here
<https://github.com/jcrist/msgspec/blob/main/benchmarks/bench_library_size.py>`__.
<https://github.com/msgspec/msgspec/blob/main/benchmarks/bench_library_size.py>`__.

**Results (smaller is better)**

Expand Down Expand Up @@ -531,7 +531,7 @@ smaller on disk.
</script>


.. _msgspec: https://jcristharif.com/msgspec/
.. _msgspec: https://msgspec.dev/
.. _msgpack: https://github.com/msgpack/msgpack-python
.. _ormsgpack: https://github.com/ormsgpack/ormsgpack
.. _MessagePack: https://msgpack.org
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class UnsetType:
"footer_icons": [
{
"name": "GitHub",
"url": "https://github.com/jcrist/msgspec",
"url": "https://github.com/msgspec/msgspec",
"html": GITHUB_LOGO,
"class": "",
},
Expand Down Expand Up @@ -98,8 +98,8 @@ class UnsetType:
napoleon_custom_sections = [("Configuration", "params_style")]
default_role = "obj"
extlinks = {
"issue": ("https://github.com/jcrist/msgspec/issues/%s", "Issue #%s"),
"pr": ("https://github.com/jcrist/msgspec/pull/%s", "PR #%s"),
"issue": ("https://github.com/msgspec/msgspec/issues/%s", "Issue #%s"),
"pr": ("https://github.com/msgspec/msgspec/pull/%s", "PR #%s"),
}
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: "
copybutton_prompt_is_regexp = True
4 changes: 2 additions & 2 deletions docs/converters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ support by wrapping the standard library's `tomllib` module as follows:
``msgspec`` uses these APIs to implement ``toml`` and ``yaml`` support,
wrapping external serialization libraries:

- ``msgspec.toml`` (`code <https://github.com/jcrist/msgspec/blob/main/src/msgspec/toml.py>`__)
- ``msgspec.toml`` (`code <https://github.com/msgspec/msgspec/blob/main/src/msgspec/toml.py>`__)

- ``msgspec.yaml`` (`code <https://github.com/jcrist/msgspec/blob/main/src/msgspec/yaml.py>`__)
- ``msgspec.yaml`` (`code <https://github.com/msgspec/msgspec/blob/main/src/msgspec/yaml.py>`__)

The implementation in ``msgspec.toml`` is *almost* identical to the one above,
with some additional code for error handling.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/asyncio-kv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ messages. The length of each message is prefixed to each message
to make it easier to efficiently determine message boundaries.

The full example source can be found `here
<https://github.com/jcrist/msgspec/tree/main/examples/asyncio-kv>`__.
<https://github.com/msgspec/msgspec/tree/main/examples/asyncio-kv>`__.

.. literalinclude:: ../../examples/asyncio-kv/kv.py
:language: python
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/conda-repodata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ determine the top 10 packages by file size.
**Source**

The full example source can be found `here
<https://github.com/jcrist/msgspec/tree/main/examples/conda-repodata>`__.
<https://github.com/msgspec/msgspec/tree/main/examples/conda-repodata>`__.

.. literalinclude:: ../../examples/conda-repodata/query_repodata.py
:language: python
Expand Down Expand Up @@ -112,6 +112,6 @@ The full example source can be found `here
.. _current_repodata.json: https://conda.anaconda.org/conda-forge/noarch/current_repodata.json
.. _json: https://docs.python.org/3/library/json.html
.. _ujson: https://github.com/ultrajson/ultrajson
.. _msgspec: https://jcristharif.com/msgspec/
.. _msgspec: https://msgspec.dev/
.. _orjson: https://github.com/ijl/orjson
.. _simdjson: https://github.com/TkTech/pysimdjson
4 changes: 2 additions & 2 deletions docs/examples/geojson.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ types, and :ref:`struct-tagged-unions` to differentiate between them. See the
relevant docs for more information.

The full example source can be found `here
<https://github.com/jcrist/msgspec/tree/main/examples/geojson>`__.
<https://github.com/msgspec/msgspec/tree/main/examples/geojson>`__.

.. literalinclude:: ../../examples/geojson/msgspec_geojson.py
:language: python
Expand Down Expand Up @@ -71,6 +71,6 @@ GeoJSON. Compared to geojson_ (another validating geojson library for python),
loading the data using ``msgspec`` was **15.3x faster**.

.. _specification: https://datatracker.ietf.org/doc/html/rfc7946
.. _example GeoJSON: https://github.com/jcrist/msgspec/blob/main/examples/geojson/canada.json
.. _example GeoJSON: https://github.com/msgspec/msgspec/blob/main/examples/geojson/canada.json
.. _orjson: https://github.com/ijl/orjson
.. _geojson: https://github.com/jazzband/geojson
2 changes: 1 addition & 1 deletion docs/examples/pyproject-toml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ file. This includes full schema definitions for all fields in the
``tool``.

The full example source can be found `here
<https://github.com/jcrist/msgspec/tree/main/examples/pyproject-toml>`__.
<https://github.com/msgspec/msgspec/tree/main/examples/pyproject-toml>`__.

.. literalinclude:: ../../examples/pyproject-toml/pyproject.py
:language: python
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Used By
-------

``msgspec`` is used by many organizations and `open source projects
<https://github.com/jcrist/msgspec/network/dependents>`__, here we highlight a
<https://github.com/msgspec/msgspec/network/dependents>`__, here we highlight a
few:

.. grid:: 2 2 4 4
Expand Down
2 changes: 1 addition & 1 deletion docs/inspect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ subclass. See the :ref:`API docs <inspect-api>` for a complete list of types.
For an example of using these functions, you might find our builtin
:doc:`jsonschema` generator implementation useful - the code for this can be
found `here
<https://github.com/jcrist/msgspec/blob/main/src/msgspec/_json_schema.py>`__. In
<https://github.com/msgspec/msgspec/blob/main/src/msgspec/_json_schema.py>`__. In
particular, take a look at the large if-else statement in ``_to_schema``.


Expand Down
4 changes: 2 additions & 2 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ Installing from GitHub

If you want wish to use a feature that hasn't been released yet, you may
install from the `development branch on GitHub
<https://github.com/jcrist/msgspec>`__ using ``pip``:
<https://github.com/msgspec/msgspec>`__ using ``pip``:

.. code-block:: shell

pip install git+https://github.com/jcrist/msgspec.git
pip install git+https://github.com/msgspec/msgspec.git


.. _YAML: https://yaml.org
Expand Down
2 changes: 1 addition & 1 deletion docs/supported-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1625,5 +1625,5 @@ TOML_ types are decoded to Python types as follows:
.. _pyright: https://github.com/microsoft/pyright
.. _generic types:
.. _user-defined generic types: https://docs.python.org/3/library/typing.html#user-defined-generic-types
.. _open an issue: https://github.com/jcrist/msgspec/issues>
.. _open an issue: https://github.com/msgspec/msgspec/issues>
.. _ISO 8601 duration strings: https://en.wikipedia.org/wiki/ISO_8601#Durations
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ yaml = [
]

[project.urls]
Homepage = "https://jcristharif.com/msgspec/"
"Issue Tracker" = "https://github.com/jcrist/msgspec/issues"
Source = "https://github.com/jcrist/msgspec"
Homepage = "https://msgspec.dev/"
"Issue Tracker" = "https://github.com/msgspec/msgspec/issues"
Source = "https://github.com/msgspec/msgspec"

[dependency-groups]
bench = [
Expand Down
2 changes: 1 addition & 1 deletion scripts/release_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def main():
}
)

url = f"https://github.com/jcrist/msgspec/releases/new?{params}"
url = f"https://github.com/msgspec/msgspec/releases/new?{params}"
webbrowser.open_new_tab(url)


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
`msgspec` currently doesn't support 32-bit Python windows builds. If
this is important for your use case, please comment on this issue:

https://github.com/jcrist/msgspec/issues/845
https://github.com/msgspec/msgspec/issues/845
====================================================================
"""
print(textwrap.dedent(error))
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def proto(request):


def test_decode_naive_datetime(proto):
"""See https://github.com/jcrist/msgspec/issues/408"""
"""See https://github.com/msgspec/msgspec/issues/408"""
dt = datetime.datetime(2001, 2, 3, 4, 5, 6, 7)
msg = proto.encode(dt)

Expand All @@ -27,7 +27,7 @@ def test_decode_naive_datetime(proto):


def test_decode_naive_time(proto):
"""See https://github.com/jcrist/msgspec/issues/408"""
"""See https://github.com/msgspec/msgspec/issues/408"""
dt = datetime.time(12, 20)
msg = proto.encode(dt)

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_raw_copy():


def test_raw_copy_doesnt_leak():
"""See https://github.com/jcrist/msgspec/pull/709"""
"""See https://github.com/msgspec/msgspec/pull/709"""
script = textwrap.dedent(
"""
import msgspec
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_struct_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ def foo(self) -> int:

def test_struct_meta_pattern_ref_leak():
# ensure that we're not keeping around references to re.Pattern longer than necessary
# see https://github.com/jcrist/msgspec/pull/899 for details
# see https://github.com/msgspec/msgspec/pull/899 for details

# clear cache to get a baseline
re.purge()
Expand Down
Loading