libcorrect 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. libcorrect-0.1.0/LICENSE +26 -0
  2. libcorrect-0.1.0/MANIFEST.in +2 -0
  3. libcorrect-0.1.0/PKG-INFO +79 -0
  4. libcorrect-0.1.0/README.rst +41 -0
  5. libcorrect-0.1.0/correct.c +618 -0
  6. libcorrect-0.1.0/libcorrect/LICENSE +12 -0
  7. libcorrect-0.1.0/libcorrect/include/correct/convolutional/bit.h +44 -0
  8. libcorrect-0.1.0/libcorrect/include/correct/convolutional/convolutional.h +40 -0
  9. libcorrect-0.1.0/libcorrect/include/correct/convolutional/error_buffer.h +15 -0
  10. libcorrect-0.1.0/libcorrect/include/correct/convolutional/history_buffer.h +59 -0
  11. libcorrect-0.1.0/libcorrect/include/correct/convolutional/lookup.h +27 -0
  12. libcorrect-0.1.0/libcorrect/include/correct/convolutional/metric.h +20 -0
  13. libcorrect-0.1.0/libcorrect/include/correct/convolutional.h +28 -0
  14. libcorrect-0.1.0/libcorrect/include/correct/portable.h +20 -0
  15. libcorrect-0.1.0/libcorrect/include/correct/reed-solomon/encode.h +3 -0
  16. libcorrect-0.1.0/libcorrect/include/correct/reed-solomon/field.h +167 -0
  17. libcorrect-0.1.0/libcorrect/include/correct/reed-solomon/polynomial.h +14 -0
  18. libcorrect-0.1.0/libcorrect/include/correct/reed-solomon/reed-solomon.h +3 -0
  19. libcorrect-0.1.0/libcorrect/include/correct/reed-solomon.h +76 -0
  20. libcorrect-0.1.0/libcorrect/include/correct.h +277 -0
  21. libcorrect-0.1.0/libcorrect/src/convolutional/bit.c +232 -0
  22. libcorrect-0.1.0/libcorrect/src/convolutional/convolutional.c +59 -0
  23. libcorrect-0.1.0/libcorrect/src/convolutional/decode.c +321 -0
  24. libcorrect-0.1.0/libcorrect/src/convolutional/encode.c +61 -0
  25. libcorrect-0.1.0/libcorrect/src/convolutional/error_buffer.c +43 -0
  26. libcorrect-0.1.0/libcorrect/src/convolutional/history_buffer.c +158 -0
  27. libcorrect-0.1.0/libcorrect/src/convolutional/lookup.c +74 -0
  28. libcorrect-0.1.0/libcorrect/src/convolutional/metric.c +17 -0
  29. libcorrect-0.1.0/libcorrect/src/reed-solomon/decode.c +508 -0
  30. libcorrect-0.1.0/libcorrect/src/reed-solomon/encode.c +34 -0
  31. libcorrect-0.1.0/libcorrect/src/reed-solomon/polynomial.c +255 -0
  32. libcorrect-0.1.0/libcorrect/src/reed-solomon/reed-solomon.c +187 -0
  33. libcorrect-0.1.0/libcorrect.egg-info/PKG-INFO +79 -0
  34. libcorrect-0.1.0/libcorrect.egg-info/SOURCES.txt +38 -0
  35. libcorrect-0.1.0/libcorrect.egg-info/dependency_links.txt +1 -0
  36. libcorrect-0.1.0/libcorrect.egg-info/requires.txt +1 -0
  37. libcorrect-0.1.0/libcorrect.egg-info/top_level.txt +2 -0
  38. libcorrect-0.1.0/setup.cfg +4 -0
  39. libcorrect-0.1.0/setup.py +55 -0
  40. libcorrect-0.1.0/test_correct.py +164 -0
@@ -0,0 +1,26 @@
1
+ Copyright (c) 2026, Ilan Schnell
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+ 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation
11
+ and/or other materials provided with the distribution.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+
24
+ The views and conclusions contained in the software and documentation are those
25
+ of the authors and should not be interpreted as representing official policies,
26
+ either expressed or implied, of the (Python) correct project.
@@ -0,0 +1,2 @@
1
+ include LICENSE
2
+ include libcorrect/LICENSE
@@ -0,0 +1,79 @@
1
+ Metadata-Version: 2.4
2
+ Name: libcorrect
3
+ Version: 0.1.0
4
+ Summary: Forward Error Correction - bindings for libcorrect
5
+ Home-page: https://github.com/ilanschnell/correct
6
+ Author: Ilan Schnell
7
+ Author-email: ilanschnell@gmail.com
8
+ License: BSD
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: C
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Programming Language :: Python :: 3.15
21
+ Classifier: Topic :: Utilities
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/x-rst
24
+ License-File: LICENSE
25
+ License-File: libcorrect/LICENSE
26
+ Requires-Dist: bitarray>=3.4
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: home-page
33
+ Dynamic: license
34
+ Dynamic: license-file
35
+ Dynamic: requires-dist
36
+ Dynamic: requires-python
37
+ Dynamic: summary
38
+
39
+ correct
40
+ =======
41
+
42
+ ``correct`` provides Python bindings for the convolutional and Reed-Solomon
43
+ forward error correction algorithms from `libcorrect`_. Convolutional codes
44
+ use bitarrays for encoded data, while Reed-Solomon codes operate on bytes.
45
+
46
+ The package requires Python 3.9 or later and bitarray 3.4 or later.
47
+
48
+ Example
49
+ -------
50
+
51
+ Create a rate 1/2, order 7 convolutional code, encode a message, and decode it
52
+ again::
53
+
54
+ >>> import correct
55
+ >>> conv = correct.Convolutional(2, 7, (0o161, 0o127))
56
+ >>> encoded = conv.encode(b"Hello world!")
57
+ >>> encoded.endian
58
+ 'big'
59
+ >>> len(encoded)
60
+ 208
61
+ >>> for i in 97, 123, 198:
62
+ ... encoded.invert(i)
63
+ >>> conv.decode(encoded)
64
+ b'Hello world!'
65
+
66
+ ``encoded`` is a big-endian ``bitarray.bitarray`` and can be stored,
67
+ transmitted, or modified using the normal bitarray operations.
68
+
69
+ Installation
70
+ ------------
71
+
72
+ Install the package from PyPI::
73
+
74
+ python -m pip install libcorrect
75
+
76
+ The Python binding and the vendored libcorrect sources are distributed under
77
+ BSD licenses. See ``LICENSE`` and ``libcorrect/LICENSE`` for details.
78
+
79
+ .. _libcorrect: https://github.com/quiet/libcorrect
@@ -0,0 +1,41 @@
1
+ correct
2
+ =======
3
+
4
+ ``correct`` provides Python bindings for the convolutional and Reed-Solomon
5
+ forward error correction algorithms from `libcorrect`_. Convolutional codes
6
+ use bitarrays for encoded data, while Reed-Solomon codes operate on bytes.
7
+
8
+ The package requires Python 3.9 or later and bitarray 3.4 or later.
9
+
10
+ Example
11
+ -------
12
+
13
+ Create a rate 1/2, order 7 convolutional code, encode a message, and decode it
14
+ again::
15
+
16
+ >>> import correct
17
+ >>> conv = correct.Convolutional(2, 7, (0o161, 0o127))
18
+ >>> encoded = conv.encode(b"Hello world!")
19
+ >>> encoded.endian
20
+ 'big'
21
+ >>> len(encoded)
22
+ 208
23
+ >>> for i in 97, 123, 198:
24
+ ... encoded.invert(i)
25
+ >>> conv.decode(encoded)
26
+ b'Hello world!'
27
+
28
+ ``encoded`` is a big-endian ``bitarray.bitarray`` and can be stored,
29
+ transmitted, or modified using the normal bitarray operations.
30
+
31
+ Installation
32
+ ------------
33
+
34
+ Install the package from PyPI::
35
+
36
+ python -m pip install libcorrect
37
+
38
+ The Python binding and the vendored libcorrect sources are distributed under
39
+ BSD licenses. See ``LICENSE`` and ``libcorrect/LICENSE`` for details.
40
+
41
+ .. _libcorrect: https://github.com/quiet/libcorrect