darknet-toolkit 1.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 (196) hide show
  1. darknet_toolkit-1.1.0/CHANGELOG.md +222 -0
  2. darknet_toolkit-1.1.0/CODE_OF_CONDUCT.md +101 -0
  3. darknet_toolkit-1.1.0/CONTRIBUTING.md +88 -0
  4. darknet_toolkit-1.1.0/LICENSE +21 -0
  5. darknet_toolkit-1.1.0/MANIFEST.in +16 -0
  6. darknet_toolkit-1.1.0/PKG-INFO +686 -0
  7. darknet_toolkit-1.1.0/README.md +626 -0
  8. darknet_toolkit-1.1.0/SECURITY.md +106 -0
  9. darknet_toolkit-1.1.0/docs/api/automation.md +81 -0
  10. darknet_toolkit-1.1.0/docs/api/concurrent.md +86 -0
  11. darknet_toolkit-1.1.0/docs/api/core.md +132 -0
  12. darknet_toolkit-1.1.0/docs/api/crypto.md +80 -0
  13. darknet_toolkit-1.1.0/docs/api/data.md +68 -0
  14. darknet_toolkit-1.1.0/docs/api/datetime.md +80 -0
  15. darknet_toolkit-1.1.0/docs/api/developer.md +130 -0
  16. darknet_toolkit-1.1.0/docs/api/files.md +107 -0
  17. darknet_toolkit-1.1.0/docs/api/integrations.md +45 -0
  18. darknet_toolkit-1.1.0/docs/api/network.md +135 -0
  19. darknet_toolkit-1.1.0/docs/api/security.md +132 -0
  20. darknet_toolkit-1.1.0/docs/api/storage.md +71 -0
  21. darknet_toolkit-1.1.0/docs/api/system.md +91 -0
  22. darknet_toolkit-1.1.0/docs/api/text.md +110 -0
  23. darknet_toolkit-1.1.0/docs/api/web.md +95 -0
  24. darknet_toolkit-1.1.0/docs/architecture.md +125 -0
  25. darknet_toolkit-1.1.0/docs/cli.md +450 -0
  26. darknet_toolkit-1.1.0/docs/configuration.md +172 -0
  27. darknet_toolkit-1.1.0/docs/faq.md +126 -0
  28. darknet_toolkit-1.1.0/docs/index.md +66 -0
  29. darknet_toolkit-1.1.0/docs/library.md +813 -0
  30. darknet_toolkit-1.1.0/docs/quickstart.md +172 -0
  31. darknet_toolkit-1.1.0/docs/security.md +209 -0
  32. darknet_toolkit-1.1.0/docs/troubleshooting.md +186 -0
  33. darknet_toolkit-1.1.0/examples/01_system_report.py +124 -0
  34. darknet_toolkit-1.1.0/examples/02_network_checks.py +128 -0
  35. darknet_toolkit-1.1.0/examples/03_file_integrity.py +82 -0
  36. darknet_toolkit-1.1.0/examples/04_security_audit.py +85 -0
  37. darknet_toolkit-1.1.0/examples/05_data_pipeline.py +99 -0
  38. darknet_toolkit-1.1.0/examples/06_http_api_client.py +98 -0
  39. darknet_toolkit-1.1.0/examples/07_cli_extras.py +84 -0
  40. darknet_toolkit-1.1.0/examples/08_crypto_concurrent.py +71 -0
  41. darknet_toolkit-1.1.0/examples/09_automation.py +72 -0
  42. darknet_toolkit-1.1.0/examples/README.md +25 -0
  43. darknet_toolkit-1.1.0/pyproject.toml +195 -0
  44. darknet_toolkit-1.1.0/scripts/build_dist.sh +13 -0
  45. darknet_toolkit-1.1.0/scripts/check.sh +48 -0
  46. darknet_toolkit-1.1.0/scripts/smoke_test.sh +55 -0
  47. darknet_toolkit-1.1.0/setup.cfg +4 -0
  48. darknet_toolkit-1.1.0/src/dark_net/__init__.py +1316 -0
  49. darknet_toolkit-1.1.0/src/dark_net/__main__.py +8 -0
  50. darknet_toolkit-1.1.0/src/dark_net/_version.py +12 -0
  51. darknet_toolkit-1.1.0/src/dark_net/automation/__init__.py +105 -0
  52. darknet_toolkit-1.1.0/src/dark_net/automation/clipboard.py +149 -0
  53. darknet_toolkit-1.1.0/src/dark_net/automation/lockfile.py +213 -0
  54. darknet_toolkit-1.1.0/src/dark_net/automation/notify.py +107 -0
  55. darknet_toolkit-1.1.0/src/dark_net/automation/processes.py +442 -0
  56. darknet_toolkit-1.1.0/src/dark_net/automation/schedule.py +389 -0
  57. darknet_toolkit-1.1.0/src/dark_net/automation/shell.py +98 -0
  58. darknet_toolkit-1.1.0/src/dark_net/automation/tasks.py +85 -0
  59. darknet_toolkit-1.1.0/src/dark_net/automation/watch.py +273 -0
  60. darknet_toolkit-1.1.0/src/dark_net/cli/__init__.py +8 -0
  61. darknet_toolkit-1.1.0/src/dark_net/cli/__main__.py +8 -0
  62. darknet_toolkit-1.1.0/src/dark_net/cli/app.py +1359 -0
  63. darknet_toolkit-1.1.0/src/dark_net/cli/output.py +125 -0
  64. darknet_toolkit-1.1.0/src/dark_net/concurrent/__init__.py +84 -0
  65. darknet_toolkit-1.1.0/src/dark_net/concurrent/asyncio_utils.py +161 -0
  66. darknet_toolkit-1.1.0/src/dark_net/concurrent/batching.py +113 -0
  67. darknet_toolkit-1.1.0/src/dark_net/concurrent/parallel.py +278 -0
  68. darknet_toolkit-1.1.0/src/dark_net/concurrent/pipeline.py +125 -0
  69. darknet_toolkit-1.1.0/src/dark_net/concurrent/rate_limit.py +276 -0
  70. darknet_toolkit-1.1.0/src/dark_net/concurrent/resilience.py +177 -0
  71. darknet_toolkit-1.1.0/src/dark_net/concurrent/sync.py +398 -0
  72. darknet_toolkit-1.1.0/src/dark_net/concurrent/workers.py +173 -0
  73. darknet_toolkit-1.1.0/src/dark_net/core/__init__.py +107 -0
  74. darknet_toolkit-1.1.0/src/dark_net/core/config.py +428 -0
  75. darknet_toolkit-1.1.0/src/dark_net/core/constants.py +177 -0
  76. darknet_toolkit-1.1.0/src/dark_net/core/exceptions.py +286 -0
  77. darknet_toolkit-1.1.0/src/dark_net/core/validators.py +250 -0
  78. darknet_toolkit-1.1.0/src/dark_net/crypto/__init__.py +148 -0
  79. darknet_toolkit-1.1.0/src/dark_net/crypto/analysis.py +123 -0
  80. darknet_toolkit-1.1.0/src/dark_net/crypto/cipher.py +466 -0
  81. darknet_toolkit-1.1.0/src/dark_net/crypto/encoding.py +372 -0
  82. darknet_toolkit-1.1.0/src/dark_net/crypto/hashing.py +233 -0
  83. darknet_toolkit-1.1.0/src/dark_net/crypto/jwt.py +301 -0
  84. darknet_toolkit-1.1.0/src/dark_net/crypto/kdf.py +207 -0
  85. darknet_toolkit-1.1.0/src/dark_net/crypto/mac.py +137 -0
  86. darknet_toolkit-1.1.0/src/dark_net/crypto/randomness.py +93 -0
  87. darknet_toolkit-1.1.0/src/dark_net/data/__init__.py +79 -0
  88. darknet_toolkit-1.1.0/src/dark_net/data/collections.py +433 -0
  89. darknet_toolkit-1.1.0/src/dark_net/data/transform.py +310 -0
  90. darknet_toolkit-1.1.0/src/dark_net/datetime_utils/__init__.py +63 -0
  91. darknet_toolkit-1.1.0/src/dark_net/datetime_utils/core.py +616 -0
  92. darknet_toolkit-1.1.0/src/dark_net/developer/__init__.py +90 -0
  93. darknet_toolkit-1.1.0/src/dark_net/developer/async_utils.py +143 -0
  94. darknet_toolkit-1.1.0/src/dark_net/developer/cache.py +350 -0
  95. darknet_toolkit-1.1.0/src/dark_net/developer/debug.py +233 -0
  96. darknet_toolkit-1.1.0/src/dark_net/developer/logging.py +333 -0
  97. darknet_toolkit-1.1.0/src/dark_net/developer/retry.py +281 -0
  98. darknet_toolkit-1.1.0/src/dark_net/developer/serialization.py +260 -0
  99. darknet_toolkit-1.1.0/src/dark_net/developer/validation.py +242 -0
  100. darknet_toolkit-1.1.0/src/dark_net/files/__init__.py +157 -0
  101. darknet_toolkit-1.1.0/src/dark_net/files/archive.py +311 -0
  102. darknet_toolkit-1.1.0/src/dark_net/files/backup.py +349 -0
  103. darknet_toolkit-1.1.0/src/dark_net/files/formats.py +383 -0
  104. darknet_toolkit-1.1.0/src/dark_net/files/hashing.py +410 -0
  105. darknet_toolkit-1.1.0/src/dark_net/files/metadata.py +375 -0
  106. darknet_toolkit-1.1.0/src/dark_net/files/operations.py +582 -0
  107. darknet_toolkit-1.1.0/src/dark_net/integrations/__init__.py +38 -0
  108. darknet_toolkit-1.1.0/src/dark_net/integrations/dependency_audit.py +243 -0
  109. darknet_toolkit-1.1.0/src/dark_net/integrations/packages.py +101 -0
  110. darknet_toolkit-1.1.0/src/dark_net/main.py +29 -0
  111. darknet_toolkit-1.1.0/src/dark_net/network/__init__.py +144 -0
  112. darknet_toolkit-1.1.0/src/dark_net/network/connectivity.py +321 -0
  113. darknet_toolkit-1.1.0/src/dark_net/network/dns.py +287 -0
  114. darknet_toolkit-1.1.0/src/dark_net/network/http.py +625 -0
  115. darknet_toolkit-1.1.0/src/dark_net/network/interfaces.py +214 -0
  116. darknet_toolkit-1.1.0/src/dark_net/network/ip.py +352 -0
  117. darknet_toolkit-1.1.0/src/dark_net/network/public_ip.py +177 -0
  118. darknet_toolkit-1.1.0/src/dark_net/network/urls.py +392 -0
  119. darknet_toolkit-1.1.0/src/dark_net/py.typed +0 -0
  120. darknet_toolkit-1.1.0/src/dark_net/security/__init__.py +118 -0
  121. darknet_toolkit-1.1.0/src/dark_net/security/config_audit.py +366 -0
  122. darknet_toolkit-1.1.0/src/dark_net/security/hashing.py +234 -0
  123. darknet_toolkit-1.1.0/src/dark_net/security/integrity.py +163 -0
  124. darknet_toolkit-1.1.0/src/dark_net/security/passwords.py +359 -0
  125. darknet_toolkit-1.1.0/src/dark_net/security/redaction.py +255 -0
  126. darknet_toolkit-1.1.0/src/dark_net/security/tokens.py +440 -0
  127. darknet_toolkit-1.1.0/src/dark_net/storage/__init__.py +115 -0
  128. darknet_toolkit-1.1.0/src/dark_net/storage/jsonl.py +490 -0
  129. darknet_toolkit-1.1.0/src/dark_net/storage/migrations.py +207 -0
  130. darknet_toolkit-1.1.0/src/dark_net/storage/query.py +498 -0
  131. darknet_toolkit-1.1.0/src/dark_net/storage/sqlite.py +658 -0
  132. darknet_toolkit-1.1.0/src/dark_net/storage/tabular.py +253 -0
  133. darknet_toolkit-1.1.0/src/dark_net/system/__init__.py +97 -0
  134. darknet_toolkit-1.1.0/src/dark_net/system/diagnostics.py +297 -0
  135. darknet_toolkit-1.1.0/src/dark_net/system/environment.py +243 -0
  136. darknet_toolkit-1.1.0/src/dark_net/system/info.py +503 -0
  137. darknet_toolkit-1.1.0/src/dark_net/system/processes.py +265 -0
  138. darknet_toolkit-1.1.0/src/dark_net/text/__init__.py +107 -0
  139. darknet_toolkit-1.1.0/src/dark_net/text/regex_utils.py +201 -0
  140. darknet_toolkit-1.1.0/src/dark_net/text/statistics.py +507 -0
  141. darknet_toolkit-1.1.0/src/dark_net/text/transform.py +360 -0
  142. darknet_toolkit-1.1.0/src/dark_net/utils/__init__.py +57 -0
  143. darknet_toolkit-1.1.0/src/dark_net/utils/formatting.py +150 -0
  144. darknet_toolkit-1.1.0/src/dark_net/utils/paths.py +258 -0
  145. darknet_toolkit-1.1.0/src/dark_net/utils/subprocess_safe.py +176 -0
  146. darknet_toolkit-1.1.0/src/dark_net/web/__init__.py +71 -0
  147. darknet_toolkit-1.1.0/src/dark_net/web/client.py +332 -0
  148. darknet_toolkit-1.1.0/src/dark_net/web/responses.py +323 -0
  149. darknet_toolkit-1.1.0/src/dark_net/web/urls.py +327 -0
  150. darknet_toolkit-1.1.0/src/darknet_toolkit.egg-info/PKG-INFO +686 -0
  151. darknet_toolkit-1.1.0/src/darknet_toolkit.egg-info/SOURCES.txt +195 -0
  152. darknet_toolkit-1.1.0/src/darknet_toolkit.egg-info/dependency_links.txt +1 -0
  153. darknet_toolkit-1.1.0/src/darknet_toolkit.egg-info/entry_points.txt +2 -0
  154. darknet_toolkit-1.1.0/src/darknet_toolkit.egg-info/requires.txt +33 -0
  155. darknet_toolkit-1.1.0/src/darknet_toolkit.egg-info/top_level.txt +1 -0
  156. darknet_toolkit-1.1.0/tests/__init__.py +0 -0
  157. darknet_toolkit-1.1.0/tests/cli/__init__.py +0 -0
  158. darknet_toolkit-1.1.0/tests/cli/test_cli_end_to_end.py +272 -0
  159. darknet_toolkit-1.1.0/tests/cli/test_cli_handlers.py +485 -0
  160. darknet_toolkit-1.1.0/tests/conftest.py +145 -0
  161. darknet_toolkit-1.1.0/tests/integration/__init__.py +0 -0
  162. darknet_toolkit-1.1.0/tests/integration/test_http_integration.py +143 -0
  163. darknet_toolkit-1.1.0/tests/integration/test_integrations.py +100 -0
  164. darknet_toolkit-1.1.0/tests/integration/test_network_live.py +205 -0
  165. darknet_toolkit-1.1.0/tests/integration/test_system_files_integration.py +120 -0
  166. darknet_toolkit-1.1.0/tests/integration/test_web_client_integration.py +140 -0
  167. darknet_toolkit-1.1.0/tests/security/__init__.py +0 -0
  168. darknet_toolkit-1.1.0/tests/security/test_paths_and_archives.py +145 -0
  169. darknet_toolkit-1.1.0/tests/security/test_secrets_and_crypto.py +160 -0
  170. darknet_toolkit-1.1.0/tests/security/test_ssrf_protection.py +120 -0
  171. darknet_toolkit-1.1.0/tests/unit/__init__.py +0 -0
  172. darknet_toolkit-1.1.0/tests/unit/test_automation.py +1179 -0
  173. darknet_toolkit-1.1.0/tests/unit/test_cli.py +407 -0
  174. darknet_toolkit-1.1.0/tests/unit/test_concurrent.py +984 -0
  175. darknet_toolkit-1.1.0/tests/unit/test_core_config.py +207 -0
  176. darknet_toolkit-1.1.0/tests/unit/test_core_exceptions_validators.py +208 -0
  177. darknet_toolkit-1.1.0/tests/unit/test_crypto.py +890 -0
  178. darknet_toolkit-1.1.0/tests/unit/test_data.py +292 -0
  179. darknet_toolkit-1.1.0/tests/unit/test_datetime.py +290 -0
  180. darknet_toolkit-1.1.0/tests/unit/test_developer.py +465 -0
  181. darknet_toolkit-1.1.0/tests/unit/test_developer_cache_debug.py +236 -0
  182. darknet_toolkit-1.1.0/tests/unit/test_files.py +512 -0
  183. darknet_toolkit-1.1.0/tests/unit/test_files_branches.py +1047 -0
  184. darknet_toolkit-1.1.0/tests/unit/test_http_text_env_branches.py +800 -0
  185. darknet_toolkit-1.1.0/tests/unit/test_interfaces_metadata_audit_branches.py +771 -0
  186. darknet_toolkit-1.1.0/tests/unit/test_network.py +247 -0
  187. darknet_toolkit-1.1.0/tests/unit/test_public_api.py +119 -0
  188. darknet_toolkit-1.1.0/tests/unit/test_security.py +350 -0
  189. darknet_toolkit-1.1.0/tests/unit/test_storage.py +1102 -0
  190. darknet_toolkit-1.1.0/tests/unit/test_system.py +196 -0
  191. darknet_toolkit-1.1.0/tests/unit/test_system_fallbacks.py +151 -0
  192. darknet_toolkit-1.1.0/tests/unit/test_system_info_platform.py +533 -0
  193. darknet_toolkit-1.1.0/tests/unit/test_system_internals.py +179 -0
  194. darknet_toolkit-1.1.0/tests/unit/test_text.py +336 -0
  195. darknet_toolkit-1.1.0/tests/unit/test_utils.py +379 -0
  196. darknet_toolkit-1.1.0/tests/unit/test_web.py +219 -0
@@ -0,0 +1,222 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
6
+ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ _Nothing yet._
11
+
12
+ ## [1.1.0] — 2026-11-08
13
+
14
+ Second feature release: four new capability packages, a flat package-root
15
+ namespace, new CLI command groups and the analysis/storage extras. Still
16
+ zero runtime dependencies.
17
+
18
+ ### Added
19
+
20
+ **`dark_net.crypto`** (55 exports)
21
+
22
+ - Authenticated encryption: `encrypt`/`decrypt` (framed MAGIC+nonce+tag),
23
+ `encrypt_text`/`decrypt_text` (base64 armour), `encrypt_stream`/`decrypt_stream`
24
+ and `encrypt_file`/`decrypt_file` (per-chunk HMAC-derived nonces, EOF tag),
25
+ `generate_key`, `is_encrypted`.
26
+ - Hashing: `digest`, `stream_digest`, `shake_digest`, `digest_algorithms`,
27
+ `adler32`/`crc32`/`crc16`.
28
+ - MAC/KDF: `hmac_digest`, `keyed_hash`, `hkdf` (+ extract/expand),
29
+ `scrypt_derive`.
30
+ - JWT: `encode_jwt`, `decode_jwt`, `decode_jwt_unverified`, `build_claims`.
31
+ - Encodings: hex/base32/58/62/64/85, PEM, percent, rot13, UUID helpers.
32
+ - CSPRNG: `random_bytes`, `random_int`, `random_token`, `random_choice`,
33
+ `secure_shuffle`.
34
+ - Analysis: `shannon_entropy`, `byte_histogram`, `looks_random`.
35
+
36
+ **`dark_net.storage`** (41 exports)
37
+
38
+ - `SQLiteStore` (SAVEPOINT-nested `transaction()`, identifier policy,
39
+ `IntegrityError`/`DataError` mapping, `backup_to`), `open_db`, `db_info`,
40
+ `list_tables`, `table_exists`, `sql_explain`, `upsert`.
41
+ - JSONL: read/write/append/merge/split/filter/sample/validate/`tail_jsonl`.
42
+ - Query layer: `compile_filter`/`apply_filter` (quoted, type-aware grammar),
43
+ `select`, `top_n`, `inner_join`/`left_join`, `distinct_values`.
44
+ - Migrations: `Migration`, `MigrationRunner`, `run_migrations` (per-migration
45
+ transaction + journal).
46
+ - Tabular: sniff/clean/stats/convert/merge/transpose CSV/TSV helpers.
47
+
48
+ **`dark_net.concurrent`** (25 exports)
49
+
50
+ - `parallel_map`/`parallel_iter`/`parallel_starmap`/`process_map`,
51
+ `batched`/`window`/`round_robin`/`map_chunks`.
52
+ - `async_map`, `gather_first`, `TokenBucket`, `SlidingWindowLimiter`,
53
+ `Throttle`, `BackgroundTask`, `run_in_background`, `WorkerPool`.
54
+ - `AtomicCounter`, `Once`, `RWLock`, `ObjectPool`, `Deadline`, `SingleFlight`,
55
+ `CircuitBreaker`/`CircuitOpenError`, fluent `Pipeline`.
56
+
57
+ **`dark_net.automation`** (33 exports)
58
+
59
+ - Processes: `exec_command`, `start_process`, `ProcessHandle`/`ProcessResult`,
60
+ `terminate_process`, `is_pid_running` (zombie-aware), `wait_for_pid`,
61
+ `child_pids` — never `shell=True`.
62
+ - Schedules: `parse_cron` (5-field, POSIX OR day rules), `CronSpec`,
63
+ `Schedule`, `run_schedule`.
64
+ - Watching: `FileWatcher`, `tree_snapshot`/`diff_snapshots`,
65
+ `wait_for_change`/`wait_for_path`.
66
+ - `FileLock` (O_EXCL + stale steal), clipboard and desktop-notification
67
+ best-effort helpers, `capture_output`/`shell_quote`/`shell_join`/
68
+ `command_exists`, `working_directory` and `env_overlay` contexts.
69
+
70
+ **Flat namespace**
71
+
72
+ - Every public name from every package is re-exported at the package root
73
+ (620 names): `dark_net.decrypt(...)` is `dark_net.crypto.decrypt(...)`.
74
+
75
+ **CLI**
76
+
77
+ - New command groups: `crypto` (keygen/digest/encrypt/decrypt/entropy),
78
+ `storage` (tables/tail/filter/explain/upsert),
79
+ `automation` (exec/exists/cron/notify) and `batch` (parallel per-line
80
+ execution, `{}` placeholder, exit 11 on any failure).
81
+
82
+ **Docs & examples**
83
+
84
+ - `docs/api/{crypto,storage,concurrent,automation}.md`, expanded
85
+ `docs/cli.md`, new examples.
86
+
87
+ ### Changed
88
+
89
+ - Version bumped to **1.1.0**.
90
+
91
+
92
+ ## [1.0.0] — 2026-11-08
93
+
94
+ First stable release. Eleven feature packages plus `core`/`utils` foundations,
95
+ one hardened CLI, zero runtime dependencies.
96
+
97
+ ### Added
98
+
99
+ **Package layout**
100
+
101
+ - `dark_net.core` — `Config` (layered, immutable, validated), `CONFIG_FIELDS`
102
+ registry, the `DarkNetError` hierarchy (22 exception types, each with `code`,
103
+ `message`, `details`), `ExitCode`, constants and reusable validators.
104
+ - `dark_net.system` — platform/CPU/memory/disk/hardware introspection (stdlib
105
+ only, `/proc` and `sysctl` fallbacks), process listing with a `psutil` fast
106
+ path, `EnvManager` with redaction, and `run_diagnostics()` (`dark-net doctor`).
107
+ - `dark_net.network` — IP parsing/classification, CIDR helpers, DNS resolution,
108
+ URL parsing and SSRF validation, a hardened `HTTPClient`, interface
109
+ enumeration, TCP connectivity/latency probes, bounded port scanning and
110
+ opt-in public-IP lookup (`ipify`, `ifconfig.co`, `icanhazip`, `ipinfo`).
111
+ - `dark_net.files` — atomic read/write helpers, JSON/YAML/CSV formats, hashing
112
+ and duplicate detection, integrity manifests, safe ZIP archive handling
113
+ (zip-slip protection) and consent-gated backup/verify/restore/prune.
114
+ - `dark_net.security` — secret detection and redaction, password generation,
115
+ strength/entropy scoring and policy advice, token/passphrase/API-key
116
+ generation, HMAC signing, key derivation, checksums and configuration /
117
+ environment / file-permission audits.
118
+ - `dark_net.text` — slugify and case conversion, statistics and readability
119
+ scores, word/character frequencies, extraction helpers (URLs, emails,
120
+ mentions, hashtags), encoding detection, base64 helpers and unicode utilities.
121
+ - `dark_net.datetime_utils` — parsing, formatting, timezone conversion, date
122
+ arithmetic, business-day counts, ranges and human duration formatting.
123
+ - `dark_net.developer` — retry policies (sync + async), TTL/LRU/disk caches,
124
+ structured logging (JSON formatter, redaction filter), profiling and timing
125
+ helpers, serialization, schema validation and async utilities.
126
+ - `dark_net.web` — `JSONAPIClient` on top of `HTTPClient`, a stdlib-only
127
+ `AsyncHTTPClient`, response parsing (JSON/text/CSV), `extract_field` path
128
+ queries, pagination detection and URL manipulation helpers.
129
+ - `dark_net.data` — mapping/record transforms: deep merge, flatten, pick/omit,
130
+ pluck, group/sort, dedupe, chunk, type coercion and table orientation.
131
+ - `dark_net.integrations` — installed-package inventory, requirements
132
+ snapshots, `pip-audit` delegation and a PyPI "outdated" fallback.
133
+ - `dark_net.utils` — paths (`safe_join`, `resolve_within`, secure temp files),
134
+ formatting (`format_bytes`, `format_table`, `pluralize`) and an allow-listed
135
+ subprocess runner.
136
+ - `dark_net.cli` — the `dark-net` console script: `system`, `network`, `file`,
137
+ `security`, `text`, `datetime`, `config`, `doctor`, with `--json` output on
138
+ every command and semantic exit codes.
139
+ - Package-level re-exports now cover the full public surface, including
140
+ `network.is_always_blocked`, `network.iter_hosts`, `network.blocked_target`,
141
+ `files.hash_stream`, `files.load_manifest`/`dump_manifest`,
142
+ `files.file_exists`, `files.iter_directory`, `files.touch_file`,
143
+ `files.safe_join_path`, `files.load_yaml`/`dump_yaml`,
144
+ `files.iter_csv_rows` and `files.prune_backups`.
145
+ - `tests/unit/test_public_api.py`, a contract test asserting that every name in
146
+ each package's `__all__` resolves and is unique, so a dropped re-export fails
147
+ the suite instead of users' imports.
148
+ - `py.typed` marker; strict `mypy` configuration; ruff lint/format settings;
149
+ pytest markers (`integration`, `security`, `slow`, `cli`); coverage gate at
150
+ 90 %.
151
+
152
+ **Documentation, examples and packaging**
153
+
154
+ - `README.md` with install/CLI/library/security overviews; `docs/` with
155
+ `index`, `quickstart`, `cli`, `configuration`, `library`, `security`,
156
+ `architecture`, `faq`, `troubleshooting` and per-package API references.
157
+ - Seven runnable examples (`examples/01_system_report.py` …
158
+ `07_cli_extras.py`) and developer scripts (`scripts/check.sh`,
159
+ `scripts/smoke_test.sh`, `scripts/build_dist.sh`).
160
+ - `LICENSE` (MIT), `CHANGELOG.md`, `CONTRIBUTING.md`, `SECURITY.md`,
161
+ `CODE_OF_CONDUCT.md`, `MANIFEST.in`, `.gitignore` and a GitHub Actions
162
+ workflow running lint, types, tests with the 90 % coverage gate, and a
163
+ build/twine/venv-install verification.
164
+
165
+ **Safety features**
166
+
167
+ - Deny-by-default SSRF protection applied to every request *and* every redirect
168
+ hop; link-local and cloud metadata ranges stay blocked even when private
169
+ access is explicitly allowed.
170
+ - Manual redirect handling that strips `Authorization`, `Cookie` and
171
+ `Proxy-Authorization` on cross-origin hops.
172
+ - TLS verification on by default (TLS ≥ 1.2), disableable only by an explicit
173
+ argument.
174
+ - Consent gates (`consent=True` / `--yes`) on recursive deletes, backups,
175
+ restores, pruning and port probing.
176
+ - Secret redaction across CLI output, logs and environment dumps.
177
+ - Bounded work everywhere: response sizes, archive expansion, traversal depth,
178
+ file counts, port counts, retry budgets and timeouts.
179
+
180
+ ### Fixed
181
+
182
+ Defects found and corrected while writing the test suite:
183
+
184
+ - `dark-net network public-ip` exited with a usage error unless
185
+ `DARK_NET_PUBLIC_IP_PROVIDERS` was set; it now defaults to the `ipify`
186
+ provider (`--provider` and the environment variable still override it).
187
+ - `dark-net security redact` refused piped input ("provide text or --file");
188
+ it now reads stdin when nothing is passed and the stream is not a TTY, so
189
+ `echo 'password=…' | dark-net security redact` works.
190
+ - An invalid configuration value (for example `DARK_NET_TIMEOUT=abc`) escaped as
191
+ a raw traceback with exit code 1; configuration is now loaded inside the CLI's
192
+ error boundary, producing `error: timeout must be a number, got 'abc'` and
193
+ exit code 2 (`USAGE_ERROR`), including for `--json`.
194
+ - `dark-net security strength --stdin` was unusable because the positional
195
+ password argument was still required; `--stdin` now works on its own and
196
+ treats empty input as a usage error (exit 2).
197
+ - `dark-net system` crashed with `AttributeError: 'Namespace' object has no
198
+ attribute 'hardware'` when no subcommand was supplied.
199
+ - `security redact`/dependency findings printed the wrong severity for
200
+ informational entries, and duration output under `--json` returned an
201
+ unordered payload.
202
+ - macOS uptime parsing in `dark_net.system.info` matched the `usec` component
203
+ of `kern.boottime` and rewound the value to "unknown" whenever the microsecond
204
+ field failed to parse.
205
+ - `hash_file(..., algorithm="SHA-256")` and other dashed spellings were rejected
206
+ even though the validator advertised dash-insensitivity; aliases such as
207
+ `sha-256` and `sha3-256` now resolve to their `hashlib` names.
208
+ - `Console.secret()` was missing from the CLI output helper used by redaction
209
+ commands.
210
+ - IP/URL handling: `get_ip_info` keys now consistently report `is_private` /
211
+ `is_global`, and public-IP provider failures return a `PublicIPResult` with
212
+ `found=False` and the provider error instead of raising.
213
+
214
+ ### Security
215
+
216
+ - No credentials are logged; `sanitize_url_for_logging` strips queries and
217
+ userinfo, and redaction covers header, token and password shapes.
218
+ - Subprocesses use argv lists with `shell=False`, an executable allow-list and
219
+ explicit timeouts.
220
+
221
+ [Unreleased]: https://github.com/dark-net/dark-net/compare/v1.0.0...HEAD
222
+ [1.0.0]: https://github.com/dark-net/dark-net/releases/tag/v1.0.0
@@ -0,0 +1,101 @@
1
+ # Contributor Code of Conduct
2
+
3
+ ## Our pledge
4
+
5
+ We as members, contributors and maintainers pledge to make participation in the
6
+ `dark-net` project a harassment-free experience for everyone, regardless of age,
7
+ body size, visible or invisible disability, ethnicity, sex characteristics,
8
+ gender identity and expression, level of experience, education, socio-economic
9
+ status, nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive and healthy community.
14
+
15
+ ## Our standards
16
+
17
+ Examples of behaviour that contributes to a positive environment:
18
+
19
+ - Demonstrating empathy and kindness toward other people.
20
+ - Being respectful of differing opinions, viewpoints and experiences.
21
+ - Giving and gracefully accepting constructive feedback.
22
+ - Accepting responsibility and apologising to those affected by our mistakes,
23
+ and learning from the experience.
24
+ - Focusing on what is best for the community and the project, not just for us as
25
+ individuals.
26
+ - Assuming good faith in technical disagreements, and arguing about the code
27
+ rather than the person.
28
+
29
+ Examples of unacceptable behaviour:
30
+
31
+ - The use of sexualised language or imagery, and sexual attention or advances of
32
+ any kind.
33
+ - Trolling, insulting or derogatory comments, and personal or political attacks.
34
+ - Public or private harassment.
35
+ - Publishing others' private information, such as a physical or email address,
36
+ without their explicit permission.
37
+ - Deliberately submitting code intended to harm users (backdoors, data
38
+ exfiltration, credential harvesting, telemetry without consent), or
39
+ pressuring maintainers to weaken the security guarantees documented in
40
+ `SECURITY.md`.
41
+ - Other conduct which could reasonably be considered inappropriate in a
42
+ professional setting.
43
+
44
+ ## Enforcement responsibilities
45
+
46
+ Maintainers are responsible for clarifying and enforcing these standards and
47
+ will take appropriate and fair corrective action in response to any behaviour
48
+ they deem inappropriate, threatening, offensive or harmful.
49
+
50
+ Maintainers have the right and responsibility to remove, edit or reject
51
+ comments, commits, code, wiki edits, issues and other contributions that are
52
+ not aligned with this Code of Conduct, and will communicate reasons for
53
+ moderation decisions when appropriate.
54
+
55
+ ## Scope
56
+
57
+ This Code of Conduct applies within all project spaces (issues, pull requests,
58
+ discussions, chat, code review) and also applies when an individual is
59
+ officially representing the project in public spaces.
60
+
61
+ ## Reporting
62
+
63
+ Report abusive, harassing or otherwise unacceptable behaviour to
64
+ `conduct@dark-net.invalid`. All complaints will be reviewed and investigated
65
+ promptly and fairly. Maintainers are obligated to respect the privacy and
66
+ security of the reporter of any incident.
67
+
68
+ Reports about security vulnerabilities should follow [SECURITY.md](SECURITY.md)
69
+ instead.
70
+
71
+ ## Enforcement guidelines
72
+
73
+ Maintainers will follow these community impact guidelines when determining the
74
+ consequences of any action:
75
+
76
+ **1. Correction** — *Impact: inappropriate language or other behaviour deemed
77
+ unprofessional or unwelcome.* A private written warning from a maintainer,
78
+ providing clarity around the nature of the violation and an explanation of why
79
+ the behaviour was inappropriate. A public apology may be requested.
80
+
81
+ **2. Warning** — *Impact: a violation through a single incident or series of
82
+ actions.* A warning with consequences for continued behaviour. No interaction
83
+ with the people involved for a specified period. Violating these terms may lead
84
+ to a temporary or permanent ban.
85
+
86
+ **3. Temporary ban** — *Impact: a serious violation of community standards,
87
+ including sustained inappropriate behaviour.* A temporary ban from any sort of
88
+ interaction or public communication with the community for a specified period.
89
+ Violating these terms may lead to a permanent ban.
90
+
91
+ **4. Permanent ban** — *Impact: demonstrating a pattern of violation of community
92
+ standards, including sustained inappropriate behaviour, harassment of an
93
+ individual, or aggression toward or disparagement of classes of individuals.* A
94
+ permanent ban from any sort of public interaction within the community.
95
+
96
+ ## Attribution
97
+
98
+ This Code of Conduct is adapted from the
99
+ [Contributor Covenant](https://www.contributor-covenant.org), version 2.1,
100
+ available at
101
+ <https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
@@ -0,0 +1,88 @@
1
+ # Contributing to dark-net
2
+
3
+ Thanks for helping out. This project favours **small, well-tested, dependency-free
4
+ code** and a **security-first default posture**, so please keep those two
5
+ constraints in mind for every change.
6
+
7
+ ## Getting started
8
+
9
+ ```bash
10
+ git clone https://github.com/dark-net/dark-net.git
11
+ cd dark-net
12
+ python -m pip install -e ".[dev]"
13
+ python -m pytest -q # full suite (offline)
14
+ ```
15
+
16
+ Supported interpreters: CPython **3.10 – 3.13** on Linux, macOS and Windows.
17
+
18
+ ## Before you open a pull request
19
+
20
+ Run the same checks CI runs:
21
+
22
+ ```bash
23
+ python -m ruff check . # lint (must be clean)
24
+ python -m ruff format --check . # formatting (run `ruff format .` to fix)
25
+ python -m mypy src/ # strict typing, no ignores without a comment
26
+ python -m pytest -q # all tests
27
+ python -m pytest -q --cov=dark_net # coverage must stay >= 90 %
28
+ ```
29
+
30
+ Or just run the script that does all of it: `./scripts/check.sh --cov`.
31
+
32
+ ## Coding conventions
33
+
34
+ - **Standard library only** in `src/dark_net`. Optional third-party packages
35
+ (`psutil`, `PyYAML`, `httpx`, `pip-audit`) must be imported lazily inside the
36
+ function that needs them and raise `DependencyMissingError` with an install
37
+ hint when absent.
38
+ - **Public API is re-exported** from the package `__init__` and listed in
39
+ `__all__`. Add new names there, plus a docstring example where useful.
40
+ - **Raise `DarkNetError` subclasses**, never bare `Exception`. Include a
41
+ machine-readable `details` mapping; never put secrets in `details`.
42
+ - **Return typed results**, not tuples of loose values: prefer a frozen
43
+ dataclass with `to_dict()`.
44
+ - **Bound the work.** Any function that walks a tree, accepts a body, loops over
45
+ ports or retries must accept an explicit limit with a safe default.
46
+ - **Never add a destructive default.** Anything that deletes, overwrites or
47
+ restores data takes `consent=True` (or `--yes`) and raises
48
+ `ConsentRequiredError` otherwise.
49
+ - **Type annotations everywhere** — `mypy --strict` is enforced, including tests
50
+ that define helpers.
51
+ - Keep lines ≤ 120 characters, use `from __future__ import annotations`, and
52
+ prefer `pathlib` over string paths.
53
+
54
+ ## Tests
55
+
56
+ - Put unit tests in `tests/unit`, integration tests (loopback HTTP, filesystem,
57
+ environment) in `tests/integration`, security-focused tests in
58
+ `tests/security`, and CLI subprocess tests in `tests/cli`.
59
+ - Tests must not require network access. Use the `http_server` /
60
+ `local_client` fixtures from `tests/conftest.py` for HTTP.
61
+ - Monkeypatch rather than mock when possible; assert on observable behaviour
62
+ (return values, exceptions, exit codes, files) rather than call counts.
63
+ - Mark slow tests with `@pytest.mark.slow` and network/filesystem tests with
64
+ `@pytest.mark.integration`.
65
+ - Coverage is measured with `branch = true`; new code should be covered by
66
+ behaviour tests, not just executed.
67
+
68
+ ## Commits and pull requests
69
+
70
+ - One logical change per pull request; keep the diff reviewable.
71
+ - Write imperative commit subjects ("add IPv6 classification helper").
72
+ - Describe **what changed, why, and how it was verified** in the PR body.
73
+ - Update `CHANGELOG.md` under `[Unreleased]` for user-visible changes.
74
+ - Update the README and `docs/` when the public API or CLI changes.
75
+
76
+ ## Security issues
77
+
78
+ Do **not** open a public issue for a vulnerability. Follow
79
+ [SECURITY.md](SECURITY.md).
80
+
81
+ ## Code of conduct
82
+
83
+ Participation is governed by [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
84
+
85
+ ## License
86
+
87
+ By contributing you agree that your contribution is licensed under the MIT
88
+ License (see [LICENSE](LICENSE)).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dark-net contributors
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.
@@ -0,0 +1,16 @@
1
+ include LICENSE
2
+ include README.md
3
+ include CHANGELOG.md
4
+ include CONTRIBUTING.md
5
+ include SECURITY.md
6
+ include CODE_OF_CONDUCT.md
7
+ include pyproject.toml
8
+ include Makefile
9
+
10
+ recursive-include src/dark_net py.typed
11
+ recursive-include tests *.py
12
+ recursive-include docs *.md *.py
13
+ recursive-include examples *.py *.md
14
+ recursive-include scripts *.py *.sh
15
+
16
+ global-exclude __pycache__/* *.py[cod] *.egg-info .DS_Store .mypy_cache/* .pytest_cache/* .ruff_cache/* .coverage