Skip to main content

Spatial Codec

PyPI version ci

Modified: 2021-06

Navigation

  1. About
  2. Quickstart
  3. Dev
  4. License

About

Spatial codec is a spatial encoding and decoding algorithm developed for iteratively mapping any number of bytes to a 3D (N3 space) matrix. The algorithm uses a psuedo variant of Hilbert's Space Filling Curve which preserves the relative localization of bits in 3D independant of the matrix dimension which is a convienient property for error correction and scalable network policies.

Quickstart

Install scodec from the package index

python3 -m pip install --upgrade pip
...
python3 -m pip install scodec

You may be required to install some apt packages on some linux distros:

sudo xargs -a apt-packages.txt apt install -y

API

Spatial codec provides an api for interacting in 2 (N2) and 3 (N3) dimensional space. Below is an example of using the N2 space api:

from scodec.n2 import N2

# configure a 2D spatial codec using a 64 bit block size
sc = N2(block_size=64)
# encode utf-8 string and enable matplotlib visualizer
space_encode = sc.stream_encode(bytes("Hello World", "utf-8"), mpl=True)
# feed spatial encode stream back into stream decode
bytestream = sc.stream_decode(space_encode)

CLI Tool

The codec provides a cli tool for ease of use. Run the algorithm for a specified block size -b / --block, with a data stream -d / --data and dimension -n / --dimension (2 or 3). The MPL visualizer can be enabled with the -v= flag.

# n2 codec invocation
python3 -m codec -n 2 -b 512 -d "Hello World" -v=
...
# n3 codec invocation 
python3 -m codec -n 3 -b 8 -d "H" -v=

License

BSD 2-Clause License available here

Metadata

Release files for scodec 0.0.5

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

Source distribution (sdist)

Source distribution for scodec 0.0.5
File Size Uploaded Provenance Actions
scodec-0.0.5.tar.gz 9.3 kB Without provenance Details for scodec-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scodec 0.0.5
File Interpreter ABI Platform Actions
scodec-0.0.5-py2-none-any.whl Python 2 none any Details for scodec-0.0.5-py2-none-any.whl

Total release size: 22.6 kB

Release files / scodec-0.0.5.tar.gz

Download URL scodec-0.0.5.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0c3902ef27a93c0ab980e29dabfd71c88a27458d467ccef1a6e1e197986f364f
BLAKE2b-256 checksum
How to use checksums
dc7e8f1004dbff69d39fcf199ebbc163f372b8e50b6e15c4f72c4c7059afc6eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.5

Release files / scodec-0.0.5-py2-none-any.whl

Download URL scodec-0.0.5-py2-none-any.whl
Size 13.3 kB
Tags Python 2
SHA-256 checksum
How to use checksums
786d77274711f99b232434b98a61479ae3d3f6e4d5eab84a1d3b3ac4211f2e1b
BLAKE2b-256 checksum
How to use checksums
440cdf0a87cae213bb68617d328e7a860cd6c5cce920d4d02e160c27122e3495
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.5

Security for scodec 0.0.5

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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