{"id":34041552,"url":"https://github.com/shblock/spatium","last_synced_at":"2026-04-09T04:01:21.767Z","repository":{"id":192830919,"uuid":"686493977","full_name":"shBLOCK/spatium","owner":"shBLOCK","description":"🚀Spatium: a fast python spatial math library","archived":false,"fork":false,"pushed_at":"2024-11-21T09:29:42.000Z","size":1365,"stargazers_count":8,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-15T14:23:08.293Z","etag":null,"topics":["cython","cython-library","fast","linear-algebra","math","math-library","python","spatial-maths","vector"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/spatium","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shBLOCK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-03T01:14:54.000Z","updated_at":"2025-11-05T02:42:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d61b25a-37bf-438b-9d79-bb5fc24d6119","html_url":"https://github.com/shBLOCK/spatium","commit_stats":null,"previous_names":["shblock/gdmath","shblock/spatium"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/shBLOCK/spatium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shBLOCK%2Fspatium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shBLOCK%2Fspatium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shBLOCK%2Fspatium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shBLOCK%2Fspatium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shBLOCK","download_url":"https://codeload.github.com/shBLOCK/spatium/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shBLOCK%2Fspatium/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31584816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cython","cython-library","fast","linear-algebra","math","math-library","python","spatial-maths","vector"],"created_at":"2025-12-13T22:03:28.020Z","updated_at":"2026-04-09T04:01:21.762Z","avatar_url":"https://github.com/shBLOCK.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀Spatium: a fast python spatial math library\n\n[![PyPI Version](https://img.shields.io/pypi/v/spatium?label=PyPI)](https://pypi.org/project/spatium)\n[![Python Version](https://img.shields.io/pypi/pyversions/spatium?label=Python)](https://pypi.org/project/spatium)\n\u003cbr\u003e\n![Language](https://img.shields.io/badge/Language-Cython-FEDF5B)\n![Python Implementation](https://img.shields.io/pypi/implementation/spatium?label=Implementation)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\u003cbr\u003e\n[![Codegen](https://github.com/shBLOCK/spatium/actions/workflows/codegen.yml/badge.svg)](https://github.com/shBLOCK/spatium/actions/workflows/codegen.yml)\n[![Tests](https://github.com/shBLOCK/spatium/actions/workflows/tests.yml/badge.svg)](https://github.com/shBLOCK/spatium/actions/workflows/tests.yml)\n[![Release](https://github.com/shBLOCK/spatium/actions/workflows/release.yml/badge.svg)](https://github.com/shBLOCK/spatium/actions/workflows/release.yml)\n[![Benchmark](https://github.com/shBLOCK/spatium/actions/workflows/benchmark.yml/badge.svg)](https://github.com/shBLOCK/spatium/actions/workflows/benchmark.yml)\n[![Charts](https://github.com/shBLOCK/spatium/actions/workflows/charts.yml/badge.svg)](https://github.com/shBLOCK/spatium/actions/workflows/charts.yml)\n\n## ⚙️Main features\n- **Fast** Pure Cython Implementation\n  - ~***16x*** faster than pure python(3.12) implementation\n- Spatial Math\n  - [Vector](https://github.com/shBLOCK/spatium/wiki#vectors)\n    - Operators +, -, *, /, @(dot), ^(cross), |(distance) ...\n    - Fast (compile-time) swizzling (e.g. `Vec3(1, 2, 3).zxy`)\n    - Flexible constructor (e.g. `Vec3(Vec2(1, 2), 3)`)\n    - Iterating and unpacking (e.g. `x, y, z = Vec3(1, 2, 3)`)\n    - Works with other libraries (pygame, numpy, ...)\n  - Transform\n    - [Transform2D](https://github.com/shBLOCK/spatium/wiki#transform2d) \u0026 [Transform3D](https://github.com/shBLOCK/spatium/wiki#transform3d)\n  - Double-precision floats\n- Pythonic \u0026 GLSL-like interface\n- Custom code generation\n  - IDE-friendly stubs\n\nPlease refer to the [wiki](https://github.com/shBLOCK/spatium/wiki) for more details\n\n## 📈Benchmark\n[![Benchmark Results](https://github.com/shBLOCK/spatium/raw/master/benchmark/charts/latest.svg)](https://github.com/shBLOCK/spatium/tree/master/benchmark/charts)\n\n## 🔧Implementation details\n- **Codegen!**  \n  Custom code generation is used throughout this library.\u003cbr\u003e\n  Every swizzle pattern and constructor are implemented as individual methods and properties (For performance reasons).\u003cbr\u003e\n  As a result, code generation is required so that I don't have to maintain 50,000+ lines of code by hand...\u003cbr\u003e\n  Besides, it also handles vector classes of every dimension and type (e.g. Vec2 Vec3 Vec2i Vec3i) are generated from the same template, so a lot of repetitive code is avoided.\u003cbr\u003e\n  There's also a stub generator that generates stub files from the cython code generated by codegen.\n\n## Credits\n- This library is partially inspired by [Godot](https://godotengine.org/)'s math library.\n\n## Notes\n- This library was originally named GdMath, as I originally used this to bridge Python and Godot and focus on gamedev.\n\u003cbr\u003e\nAs development went on,\nI realized that it has become a versatile spatial math library which is also one of the fastest,\nI also found it useful in many projects.\n\u003cbr\u003e\nThus, I've decided to rename it to Spatium (since Spatial was taken), before it (possibly) gets used by more people.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshblock%2Fspatium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshblock%2Fspatium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshblock%2Fspatium/lists"}