archae 2026.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.
- archae-2026.1.0/LICENSE +21 -0
- archae-2026.1.0/PKG-INFO +147 -0
- archae-2026.1.0/README.md +97 -0
- archae-2026.1.0/pyproject.toml +107 -0
- archae-2026.1.0/src/archae/__init__.py +1 -0
- archae-2026.1.0/src/archae/__main__.py +9 -0
- archae-2026.1.0/src/archae/cli.py +374 -0
- archae-2026.1.0/src/archae/py.typed +0 -0
- archae-2026.1.0/src/archae/util/__init__.py +1 -0
- archae-2026.1.0/src/archae/util/archiver/__init__.py +6 -0
- archae-2026.1.0/src/archae/util/archiver/base_archiver.py +55 -0
- archae-2026.1.0/src/archae/util/archiver/peazip.py +159 -0
- archae-2026.1.0/src/archae/util/archiver/seven_zip.py +199 -0
- archae-2026.1.0/src/archae/util/archiver/unar.py +158 -0
- archae-2026.1.0/src/archae/util/enum/__init__.py +5 -0
- archae-2026.1.0/src/archae/util/enum/byte_scale.py +46 -0
archae-2026.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Shawn McNaughton
|
|
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.
|
archae-2026.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: archae
|
|
3
|
+
Version: 2026.1.0
|
|
4
|
+
Summary: Archae explodes archives.
|
|
5
|
+
Keywords:
|
|
6
|
+
Author: Shawn McNaughton
|
|
7
|
+
Author-email: Shawn McNaughton <shawngmc@gmail.com>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright © 2026 Shawn McNaughton
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
30
|
+
Classifier: Environment :: Console
|
|
31
|
+
Classifier: Intended Audience :: Developers
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Programming Language :: Python
|
|
34
|
+
Classifier: Programming Language :: Python :: 3
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
39
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
40
|
+
Classifier: Typing :: Typed
|
|
41
|
+
Requires-Dist: click
|
|
42
|
+
Requires-Dist: python-magic
|
|
43
|
+
Requires-Dist: rich-click
|
|
44
|
+
Requires-Python: ~=3.11
|
|
45
|
+
Project-URL: Documentation, https://archae.readthedocs.io/en/stable/
|
|
46
|
+
Project-URL: Changelog, https://archae.readthedocs.io/en/stable/changelog.html
|
|
47
|
+
Project-URL: Source Code, https://github.com/shawngmc/archae
|
|
48
|
+
Project-URL: Issue Tracker, https://github.com/shawngmc/archae/issues
|
|
49
|
+
Description-Content-Type: text/markdown
|
|
50
|
+
|
|
51
|
+
<!-- start docs-include-index -->
|
|
52
|
+
|
|
53
|
+
# Archae
|
|
54
|
+
|
|
55
|
+

|
|
56
|
+
|
|
57
|
+
[](https://img.shields.io/pypi/v/archae)
|
|
58
|
+
[](https://pypi.org/project/archae/)
|
|
59
|
+
[](https://results.pre-commit.ci/latest/github/shawngmc/archae/main)
|
|
60
|
+
[](https://github.com/shawngmc/archae/actions/workflows/test.yml)
|
|
61
|
+
[](https://archae.readthedocs.io/en/latest/?badge=latest)
|
|
62
|
+
[](https://img.shields.io/pypi/l/archae)
|
|
63
|
+
|
|
64
|
+
Archae explodes archives.
|
|
65
|
+
|
|
66
|
+
<!-- end docs-include-index -->
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
<!-- start docs-include-installation -->
|
|
71
|
+
|
|
72
|
+
Archae is available on [PyPI](https://pypi.org/project/archae/). Install with [uv](https://docs.astral.sh/uv/) or your package manager of choice:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
uv tool install archae
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
<!-- end docs-include-installation -->
|
|
79
|
+
|
|
80
|
+
## Documentation
|
|
81
|
+
|
|
82
|
+
Check out the [Archae documentation](https://archae.readthedocs.io/en/stable/) for the [User's Guide](https://archae.readthedocs.io/en/stable/usage.html) and [CLI Reference](https://archae.readthedocs.io/en/stable/cli.html).
|
|
83
|
+
|
|
84
|
+
## Usage
|
|
85
|
+
|
|
86
|
+
<!-- start docs-include-usage -->
|
|
87
|
+
|
|
88
|
+
Running `archae --help` or `python -m archae --help` shows a list of all of the available options and arguments:
|
|
89
|
+
|
|
90
|
+
<!-- [[[cog
|
|
91
|
+
import cog
|
|
92
|
+
from archae import cli
|
|
93
|
+
from click.testing import CliRunner
|
|
94
|
+
runner = CliRunner()
|
|
95
|
+
result = runner.invoke(cli.cli, ["--help"], terminal_width=88)
|
|
96
|
+
help = result.output.replace("Usage: cli", "Usage: archae")
|
|
97
|
+
cog.outl(f"\n```sh\narchae --help\n{help.rstrip()}\n```\n")
|
|
98
|
+
]]] -->
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
archae --help
|
|
102
|
+
|
|
103
|
+
Usage: archae [OPTIONS] ARCHIVE_PATH
|
|
104
|
+
|
|
105
|
+
Archae explodes archives.
|
|
106
|
+
|
|
107
|
+
╭─ Arguments ──────────────────────────────────────────────────────────────────────────╮
|
|
108
|
+
│ * ARCHIVE_PATH FILE Archive to examine [required] │
|
|
109
|
+
╰──────────────────────────────────────────────────────────────────────────────────────╯
|
|
110
|
+
╭─ Options ────────────────────────────────────────────────────────────────────────────╮
|
|
111
|
+
│ --max_total_size_bytes FILESIZE Maximum total extraction size │
|
|
112
|
+
│ before failing, default 100G │
|
|
113
|
+
│ [default: 107374182400] │
|
|
114
|
+
│ --max_archive_size_bytes FILESIZE Maximum individual archive │
|
|
115
|
+
│ extraction size before failing, │
|
|
116
|
+
│ default 10G [default: │
|
|
117
|
+
│ 10737418240] │
|
|
118
|
+
│ --min_archive_ratio FLOAT RANGE [0<=x<=1] Minimum allowed compression │
|
|
119
|
+
│ ratio for an archive. A │
|
|
120
|
+
│ floating-point value between │
|
|
121
|
+
│ 0.0 and 1.0, inclusive. Default │
|
|
122
|
+
│ is 0.005 [default: 0.005] │
|
|
123
|
+
│ --version -v Show the version and exit. │
|
|
124
|
+
│ --help -h Show this message and exit. │
|
|
125
|
+
╰──────────────────────────────────────────────────────────────────────────────────────╯
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
<!-- [[[end]]] -->
|
|
129
|
+
|
|
130
|
+
<!-- end docs-include-usage -->
|
|
131
|
+
|
|
132
|
+
## Features
|
|
133
|
+
|
|
134
|
+
- Uses 7z/peazip/unar (not 7za/7zr) to try to extract archives
|
|
135
|
+
- No substantial limit on the number of archive layers
|
|
136
|
+
- Identifies file types via libmagic
|
|
137
|
+
- Basic archive bomb protections
|
|
138
|
+
|
|
139
|
+
## TODOs
|
|
140
|
+
|
|
141
|
+
- Protect against/detect archive bombs (malicious disk usage)
|
|
142
|
+
- Improve archive type detection
|
|
143
|
+
- Separate between extractable and non-extractable archive types
|
|
144
|
+
- Protect against/detect depth attacks (excessively nested archives)
|
|
145
|
+
- Detect password-protected archives
|
|
146
|
+
- Allow supplying archive passwords by hash
|
|
147
|
+
- Add custom magic to detect obscure archive formats
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<!-- start docs-include-index -->
|
|
2
|
+
|
|
3
|
+
# Archae
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
[](https://img.shields.io/pypi/v/archae)
|
|
8
|
+
[](https://pypi.org/project/archae/)
|
|
9
|
+
[](https://results.pre-commit.ci/latest/github/shawngmc/archae/main)
|
|
10
|
+
[](https://github.com/shawngmc/archae/actions/workflows/test.yml)
|
|
11
|
+
[](https://archae.readthedocs.io/en/latest/?badge=latest)
|
|
12
|
+
[](https://img.shields.io/pypi/l/archae)
|
|
13
|
+
|
|
14
|
+
Archae explodes archives.
|
|
15
|
+
|
|
16
|
+
<!-- end docs-include-index -->
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
<!-- start docs-include-installation -->
|
|
21
|
+
|
|
22
|
+
Archae is available on [PyPI](https://pypi.org/project/archae/). Install with [uv](https://docs.astral.sh/uv/) or your package manager of choice:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
uv tool install archae
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
<!-- end docs-include-installation -->
|
|
29
|
+
|
|
30
|
+
## Documentation
|
|
31
|
+
|
|
32
|
+
Check out the [Archae documentation](https://archae.readthedocs.io/en/stable/) for the [User's Guide](https://archae.readthedocs.io/en/stable/usage.html) and [CLI Reference](https://archae.readthedocs.io/en/stable/cli.html).
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
<!-- start docs-include-usage -->
|
|
37
|
+
|
|
38
|
+
Running `archae --help` or `python -m archae --help` shows a list of all of the available options and arguments:
|
|
39
|
+
|
|
40
|
+
<!-- [[[cog
|
|
41
|
+
import cog
|
|
42
|
+
from archae import cli
|
|
43
|
+
from click.testing import CliRunner
|
|
44
|
+
runner = CliRunner()
|
|
45
|
+
result = runner.invoke(cli.cli, ["--help"], terminal_width=88)
|
|
46
|
+
help = result.output.replace("Usage: cli", "Usage: archae")
|
|
47
|
+
cog.outl(f"\n```sh\narchae --help\n{help.rstrip()}\n```\n")
|
|
48
|
+
]]] -->
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
archae --help
|
|
52
|
+
|
|
53
|
+
Usage: archae [OPTIONS] ARCHIVE_PATH
|
|
54
|
+
|
|
55
|
+
Archae explodes archives.
|
|
56
|
+
|
|
57
|
+
╭─ Arguments ──────────────────────────────────────────────────────────────────────────╮
|
|
58
|
+
│ * ARCHIVE_PATH FILE Archive to examine [required] │
|
|
59
|
+
╰──────────────────────────────────────────────────────────────────────────────────────╯
|
|
60
|
+
╭─ Options ────────────────────────────────────────────────────────────────────────────╮
|
|
61
|
+
│ --max_total_size_bytes FILESIZE Maximum total extraction size │
|
|
62
|
+
│ before failing, default 100G │
|
|
63
|
+
│ [default: 107374182400] │
|
|
64
|
+
│ --max_archive_size_bytes FILESIZE Maximum individual archive │
|
|
65
|
+
│ extraction size before failing, │
|
|
66
|
+
│ default 10G [default: │
|
|
67
|
+
│ 10737418240] │
|
|
68
|
+
│ --min_archive_ratio FLOAT RANGE [0<=x<=1] Minimum allowed compression │
|
|
69
|
+
│ ratio for an archive. A │
|
|
70
|
+
│ floating-point value between │
|
|
71
|
+
│ 0.0 and 1.0, inclusive. Default │
|
|
72
|
+
│ is 0.005 [default: 0.005] │
|
|
73
|
+
│ --version -v Show the version and exit. │
|
|
74
|
+
│ --help -h Show this message and exit. │
|
|
75
|
+
╰──────────────────────────────────────────────────────────────────────────────────────╯
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
<!-- [[[end]]] -->
|
|
79
|
+
|
|
80
|
+
<!-- end docs-include-usage -->
|
|
81
|
+
|
|
82
|
+
## Features
|
|
83
|
+
|
|
84
|
+
- Uses 7z/peazip/unar (not 7za/7zr) to try to extract archives
|
|
85
|
+
- No substantial limit on the number of archive layers
|
|
86
|
+
- Identifies file types via libmagic
|
|
87
|
+
- Basic archive bomb protections
|
|
88
|
+
|
|
89
|
+
## TODOs
|
|
90
|
+
|
|
91
|
+
- Protect against/detect archive bombs (malicious disk usage)
|
|
92
|
+
- Improve archive type detection
|
|
93
|
+
- Separate between extractable and non-extractable archive types
|
|
94
|
+
- Protect against/detect depth attacks (excessively nested archives)
|
|
95
|
+
- Detect password-protected archives
|
|
96
|
+
- Allow supplying archive passwords by hash
|
|
97
|
+
- Add custom magic to detect obscure archive formats
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["uv-build"]
|
|
3
|
+
build-backend = "uv_build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "archae"
|
|
7
|
+
version = "2026.1.0"
|
|
8
|
+
description = "Archae explodes archives."
|
|
9
|
+
authors = [{name = "Shawn McNaughton", email = "shawngmc@gmail.com"}]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
license = {file = "LICENSE"}
|
|
12
|
+
keywords = []
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
15
|
+
"Environment :: Console",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
25
|
+
"Typing :: Typed",
|
|
26
|
+
]
|
|
27
|
+
requires-python = "~=3.11"
|
|
28
|
+
dependencies = [
|
|
29
|
+
"click",
|
|
30
|
+
"python-magic",
|
|
31
|
+
"rich_click",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[dependency-groups]
|
|
35
|
+
tests = [
|
|
36
|
+
"pytest",
|
|
37
|
+
]
|
|
38
|
+
docs = [
|
|
39
|
+
"furo",
|
|
40
|
+
"myst-parser",
|
|
41
|
+
"sphinx",
|
|
42
|
+
"sphinx-copybutton",
|
|
43
|
+
"sphinxext-opengraph",
|
|
44
|
+
]
|
|
45
|
+
dev = [
|
|
46
|
+
{ include-group = "tests" },
|
|
47
|
+
{ include-group = "docs" },
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[project.urls]
|
|
51
|
+
Documentation = "https://archae.readthedocs.io/en/stable/"
|
|
52
|
+
Changelog = "https://archae.readthedocs.io/en/stable/changelog.html"
|
|
53
|
+
"Source Code" = "https://github.com/shawngmc/archae"
|
|
54
|
+
"Issue Tracker" = "https://github.com/shawngmc/archae/issues"
|
|
55
|
+
|
|
56
|
+
[project.scripts]
|
|
57
|
+
archae = "archae.__main__:cli"
|
|
58
|
+
|
|
59
|
+
[tool.ruff]
|
|
60
|
+
lint.select = ["ALL"]
|
|
61
|
+
lint.ignore = [
|
|
62
|
+
"E501", # line too long (pycodestyle), handled by ruff-format
|
|
63
|
+
"ANN002", # missing-type-args (flake8-annotations)
|
|
64
|
+
"ANN003", # missing-type-kwargs (flake8-annotations)
|
|
65
|
+
"ANN401", # any-type (flake8-annotations)
|
|
66
|
+
"COM", # flake8-commas, handled by ruff-format
|
|
67
|
+
"CPY", # flake8-copyright
|
|
68
|
+
"ISC001", # single-line-implicit-string-concatenation (flake8-implicit-str-concat)
|
|
69
|
+
"INP", # flake8-no-pep420
|
|
70
|
+
]
|
|
71
|
+
src = ["src", "tests", "docs"]
|
|
72
|
+
|
|
73
|
+
[tool.ruff.lint.per-file-ignores]
|
|
74
|
+
"__init__.py" = [
|
|
75
|
+
"F401", # unused-import (Pyflakes)
|
|
76
|
+
]
|
|
77
|
+
"noxfile.py" = [
|
|
78
|
+
"D100", # undocumented-public-module (pydocstyle)
|
|
79
|
+
"ERA001", # commented-out-code (eradicate)
|
|
80
|
+
]
|
|
81
|
+
"docs/conf.py" = [
|
|
82
|
+
"A001", # builtin-variable-shadowing (flake8-builtins)
|
|
83
|
+
]
|
|
84
|
+
"src/archae/cli.py" = [
|
|
85
|
+
"C901", # complex-structure (mccabe)
|
|
86
|
+
"FBT001", # boolean-type-hint-positional-argument (flake8-boolean-trap)
|
|
87
|
+
"A001", # builtin-variable-shadowing (flake8-builtins)
|
|
88
|
+
"A002", # builtin-argument-shadowing (flake8-builtins)
|
|
89
|
+
"PLR0913", # too-many-arguments (Pylint)
|
|
90
|
+
]
|
|
91
|
+
"tests/**/test_*.py" = [
|
|
92
|
+
"D", # pydocstyle
|
|
93
|
+
"ANN201", # missing-return-type-undocumented-public-function (flake8-annotations)
|
|
94
|
+
"S101", # assert (flake8-bandit)
|
|
95
|
+
"SIM300", # yoda-conditions (flake8-simplify)
|
|
96
|
+
"PLR2004", # magic-value-comparison (Pylint)
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
[tool.ruff.lint.isort]
|
|
100
|
+
known-first-party = [
|
|
101
|
+
"archae",
|
|
102
|
+
"tests",
|
|
103
|
+
]
|
|
104
|
+
lines-between-types = 0
|
|
105
|
+
|
|
106
|
+
[tool.ruff.lint.pydocstyle]
|
|
107
|
+
convention = "google"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Archae explodes archives."""
|