yace-codec 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.
- yace_codec-0.1.0/CHANGELOG.md +68 -0
- yace_codec-0.1.0/LICENSE +21 -0
- yace_codec-0.1.0/MANIFEST.in +3 -0
- yace_codec-0.1.0/PKG-INFO +701 -0
- yace_codec-0.1.0/README.md +669 -0
- yace_codec-0.1.0/examples/bytes_and_unicode.py +28 -0
- yace_codec-0.1.0/examples/quickstart.py +23 -0
- yace_codec-0.1.0/examples/share_tables.py +34 -0
- yace_codec-0.1.0/pyproject.toml +61 -0
- yace_codec-0.1.0/setup.cfg +4 -0
- yace_codec-0.1.0/src/yace_codec/__init__.py +71 -0
- yace_codec-0.1.0/src/yace_codec/__main__.py +6 -0
- yace_codec-0.1.0/src/yace_codec/cli.py +276 -0
- yace_codec-0.1.0/src/yace_codec/codec.py +498 -0
- yace_codec-0.1.0/src/yace_codec/errors.py +65 -0
- yace_codec-0.1.0/src/yace_codec/keystore.py +554 -0
- yace_codec-0.1.0/src/yace_codec/py.typed +0 -0
- yace_codec-0.1.0/src/yace_codec/tables.py +324 -0
- yace_codec-0.1.0/src/yace_codec.egg-info/PKG-INFO +701 -0
- yace_codec-0.1.0/src/yace_codec.egg-info/SOURCES.txt +21 -0
- yace_codec-0.1.0/src/yace_codec.egg-info/dependency_links.txt +1 -0
- yace_codec-0.1.0/src/yace_codec.egg-info/entry_points.txt +2 -0
- yace_codec-0.1.0/src/yace_codec.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [0.1.0] - 2026-10-14
|
|
8
|
+
|
|
9
|
+
First release on PyPI, as `yace-codec` (import name `yace_codec`).
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `yace_codec` package with `Codec`, `encode()`, `decode()`, `parse_header()`, and
|
|
14
|
+
`encode_bytes()` / `decode_bytes()` for binary data and any Unicode text.
|
|
15
|
+
- `KeyStore`: a JSON key store in the per-user data directory (override with
|
|
16
|
+
`YACE_CODEC_KEYSTORE`). It writes atomically, uses a lock file so concurrent
|
|
17
|
+
writers never lose tables, keeps the file's permissions, and can export and import
|
|
18
|
+
table families. `import_tables(..., family=...)` imports a single family.
|
|
19
|
+
- `yace-codec` command (also `python -m yace_codec`) with `encode`, `decode`, and
|
|
20
|
+
`tables path|list|export|import`. `tables import` needs `--family NAME` (or
|
|
21
|
+
`--all-families`), so a shared file cannot add tables for a family you did not
|
|
22
|
+
expect, and it lists the tables it adds.
|
|
23
|
+
- Decoding checks that a token's number of noise chunks matches its length, which
|
|
24
|
+
catches many truncated tokens.
|
|
25
|
+
- Tokens and JSON files saved as UTF-16 or with a byte order mark (as Windows
|
|
26
|
+
PowerShell writes them) are accepted.
|
|
27
|
+
- An exception hierarchy under `YaceError`, type hints (`py.typed`), and runnable
|
|
28
|
+
examples.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- The scripts in `encoder/` were replaced by the package. The algorithm, the table
|
|
33
|
+
format (`encodings.json`), and the token format are unchanged. Old tokens decode
|
|
34
|
+
with the package. New tokens decode with the original scripts when the package
|
|
35
|
+
generated the tables.
|
|
36
|
+
- New tables cover all of `string.printable` (tab, carriage return, vertical tab, and
|
|
37
|
+
form feed were added) and never share a code between characters, spaces, and bins.
|
|
38
|
+
- Tables and per-token randomness come from `secrets.SystemRandom`.
|
|
39
|
+
- Errors raise exceptions instead of printing a message and calling `exit()`.
|
|
40
|
+
- Without a name, the family `default` is used instead of random letters.
|
|
41
|
+
- Encoding needs a family name of 1–64 ASCII letters or underscores, also for
|
|
42
|
+
existing families. Families with other names can still be decoded.
|
|
43
|
+
- Encoding is refused when `len(text) × length ** iterations` exceeds
|
|
44
|
+
2<sup>25</sup> (`MAX_ENCODED_CHARS`); with bins, tokens reach about
|
|
45
|
+
1.25 × 2<sup>25</sup> characters.
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- Characters missing from a table were copied into the token unencoded, which
|
|
50
|
+
corrupted it. They now raise `UnsupportedCharacterError`.
|
|
51
|
+
- Shared codes in tables from the original generator could make decoding return
|
|
52
|
+
garbled text. The encoder no longer emits a shared space or bin code, and the
|
|
53
|
+
decoder recovers many affected legacy tokens.
|
|
54
|
+
- Empty input crashed, a code length of 1 hung, and family names with repeated
|
|
55
|
+
letters (such as `hello`) were rejected.
|
|
56
|
+
- Tables were written into the source directory with a truncate-then-write, so a
|
|
57
|
+
crash could erase them. They are now written atomically to a key store file.
|
|
58
|
+
- Importing the scripts configured the root logger and wrapped standard output, and
|
|
59
|
+
every encode logged three debug entries to `errors.log` for each encoding layer.
|
|
60
|
+
|
|
61
|
+
### Removed
|
|
62
|
+
|
|
63
|
+
- `encoder/encodings.json`, the tables of the original scripts. Keep a copy if you
|
|
64
|
+
still have tokens made with them (see the README's migration section).
|
|
65
|
+
- `randomizer_data.json`, `errors.log`, and `update.log`.
|
|
66
|
+
- The deprecated `encoder (beta).py` and the unfinished `analyzer.py` file encoder
|
|
67
|
+
(use `yace-codec encode FILE` or `--binary` instead).
|
|
68
|
+
- Scratch files unrelated to the encoder, and compiled `__pycache__` files.
|
yace_codec-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Mudith Daga
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|