archivey 0.0.1a1__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 (248) hide show
  1. archivey-0.0.1a1/.github/workflows/deploy-docs.yml +50 -0
  2. archivey-0.0.1a1/.github/workflows/deploy-pypi.yml +62 -0
  3. archivey-0.0.1a1/.github/workflows/lint.yml +43 -0
  4. archivey-0.0.1a1/.github/workflows/tox-tests.yml +70 -0
  5. archivey-0.0.1a1/.gitignore +176 -0
  6. archivey-0.0.1a1/AGENTS.md +74 -0
  7. archivey-0.0.1a1/CONTRIBUTING.md +21 -0
  8. archivey-0.0.1a1/LICENSE +21 -0
  9. archivey-0.0.1a1/PKG-INFO +87 -0
  10. archivey-0.0.1a1/README.md +54 -0
  11. archivey-0.0.1a1/docs/api.md +12 -0
  12. archivey-0.0.1a1/docs/developer_guide.md +207 -0
  13. archivey-0.0.1a1/docs/generate_api_docs.sh +5 -0
  14. archivey-0.0.1a1/docs/index.md +156 -0
  15. archivey-0.0.1a1/docs/user_guide.md +204 -0
  16. archivey-0.0.1a1/mkdocs.yml +37 -0
  17. archivey-0.0.1a1/pyproject.toml +135 -0
  18. archivey-0.0.1a1/pyrightconfig.json +6 -0
  19. archivey-0.0.1a1/scripts/griffe_extensions.py +55 -0
  20. archivey-0.0.1a1/src/archivey/__init__.py +38 -0
  21. archivey-0.0.1a1/src/archivey/__main__.py +12 -0
  22. archivey-0.0.1a1/src/archivey/archive_reader.py +306 -0
  23. archivey-0.0.1a1/src/archivey/config.py +154 -0
  24. archivey-0.0.1a1/src/archivey/core.py +243 -0
  25. archivey-0.0.1a1/src/archivey/exceptions.py +117 -0
  26. archivey-0.0.1a1/src/archivey/filters.py +193 -0
  27. archivey-0.0.1a1/src/archivey/formats/__init__.py +0 -0
  28. archivey-0.0.1a1/src/archivey/formats/compressed_streams.py +370 -0
  29. archivey-0.0.1a1/src/archivey/formats/folder_reader.py +201 -0
  30. archivey-0.0.1a1/src/archivey/formats/format_detection.py +239 -0
  31. archivey-0.0.1a1/src/archivey/formats/rar_reader.py +839 -0
  32. archivey-0.0.1a1/src/archivey/formats/sevenzip_reader.py +810 -0
  33. archivey-0.0.1a1/src/archivey/formats/single_file_reader.py +318 -0
  34. archivey-0.0.1a1/src/archivey/formats/tar_reader.py +316 -0
  35. archivey-0.0.1a1/src/archivey/formats/zip_reader.py +259 -0
  36. archivey-0.0.1a1/src/archivey/internal/__init__.py +0 -0
  37. archivey-0.0.1a1/src/archivey/internal/base_reader.py +894 -0
  38. archivey-0.0.1a1/src/archivey/internal/cli.py +341 -0
  39. archivey-0.0.1a1/src/archivey/internal/dependency_checker.py +103 -0
  40. archivey-0.0.1a1/src/archivey/internal/extraction_helper.py +396 -0
  41. archivey-0.0.1a1/src/archivey/internal/io_helpers.py +1017 -0
  42. archivey-0.0.1a1/src/archivey/internal/utils.py +76 -0
  43. archivey-0.0.1a1/src/archivey/types.py +335 -0
  44. archivey-0.0.1a1/tests/archivey/conftest.py +48 -0
  45. archivey-0.0.1a1/tests/archivey/create_archives.py +898 -0
  46. archivey-0.0.1a1/tests/archivey/sample_archives.py +1214 -0
  47. archivey-0.0.1a1/tests/archivey/test_cli.py +45 -0
  48. archivey-0.0.1a1/tests/archivey/test_config.py +49 -0
  49. archivey-0.0.1a1/tests/archivey/test_corrupted_archives.py +246 -0
  50. archivey-0.0.1a1/tests/archivey/test_encrypted_archives.py +363 -0
  51. archivey-0.0.1a1/tests/archivey/test_extractall.py +130 -0
  52. archivey-0.0.1a1/tests/archivey/test_filters.py +375 -0
  53. archivey-0.0.1a1/tests/archivey/test_input_stream_buffering.py +84 -0
  54. archivey-0.0.1a1/tests/archivey/test_io_helpers.py +480 -0
  55. archivey-0.0.1a1/tests/archivey/test_missing_packages.py +137 -0
  56. archivey-0.0.1a1/tests/archivey/test_open_compressed_stream.py +120 -0
  57. archivey-0.0.1a1/tests/archivey/test_open_nonseekable.py +149 -0
  58. archivey-0.0.1a1/tests/archivey/test_open_stream.py +39 -0
  59. archivey-0.0.1a1/tests/archivey/test_path_traversal.py +41 -0
  60. archivey-0.0.1a1/tests/archivey/test_read_archives.py +590 -0
  61. archivey-0.0.1a1/tests/archivey/test_statsio.py +384 -0
  62. archivey-0.0.1a1/tests/archivey/test_streaming_modes.py +332 -0
  63. archivey-0.0.1a1/tests/archivey/test_usage_errors.py +90 -0
  64. archivey-0.0.1a1/tests/archivey/test_zip_extra_fields.py +21 -0
  65. archivey-0.0.1a1/tests/archivey/testing_utils.py +132 -0
  66. archivey-0.0.1a1/tests/create_corrupted_archives.py +77 -0
  67. archivey-0.0.1a1/tests/test_archives/basic_nonsolid__.rar +0 -0
  68. archivey-0.0.1a1/tests/test_archives/basic_nonsolid__7zcmd.7z +0 -0
  69. archivey-0.0.1a1/tests/test_archives/basic_nonsolid__infozip.zip +0 -0
  70. archivey-0.0.1a1/tests/test_archives/basic_nonsolid__py7zr.7z +0 -0
  71. archivey-0.0.1a1/tests/test_archives/basic_nonsolid__rar4.rar +0 -0
  72. archivey-0.0.1a1/tests/test_archives/basic_nonsolid__zipfile_deflate.zip +0 -0
  73. archivey-0.0.1a1/tests/test_archives/basic_nonsolid__zipfile_store.zip +0 -0
  74. archivey-0.0.1a1/tests/test_archives/basic_solid__.rar +0 -0
  75. archivey-0.0.1a1/tests/test_archives/basic_solid__.tar.bz2 +0 -0
  76. archivey-0.0.1a1/tests/test_archives/basic_solid__.tar.lz4 +0 -0
  77. archivey-0.0.1a1/tests/test_archives/basic_solid__.tar.xz +0 -0
  78. archivey-0.0.1a1/tests/test_archives/basic_solid__7zcmd.7z +0 -0
  79. archivey-0.0.1a1/tests/test_archives/basic_solid__py7zr.7z +0 -0
  80. archivey-0.0.1a1/tests/test_archives/basic_solid__rar4.rar +0 -0
  81. archivey-0.0.1a1/tests/test_archives/basic_solid__tarcmd.tar +0 -0
  82. archivey-0.0.1a1/tests/test_archives/basic_solid__tarcmd.tar.gz +0 -0
  83. archivey-0.0.1a1/tests/test_archives/basic_solid__tarcmd.tar.zst +0 -0
  84. archivey-0.0.1a1/tests/test_archives/basic_solid__tarfile.tar +0 -0
  85. archivey-0.0.1a1/tests/test_archives/basic_solid__tarfile.tar.gz +0 -0
  86. archivey-0.0.1a1/tests/test_archives/basic_solid__tarfile.tar.zst +0 -0
  87. archivey-0.0.1a1/tests/test_archives/comment__.rar +0 -0
  88. archivey-0.0.1a1/tests/test_archives/comment__infozip.zip +0 -0
  89. archivey-0.0.1a1/tests/test_archives/comment__rar4.rar +0 -0
  90. archivey-0.0.1a1/tests/test_archives/comment__zipfile_deflate.zip +0 -0
  91. archivey-0.0.1a1/tests/test_archives/comment__zipfile_store.zip +0 -0
  92. archivey-0.0.1a1/tests/test_archives/compression_methods__infozip.zip +0 -0
  93. archivey-0.0.1a1/tests/test_archives/compression_methods__zipfile_deflate.zip +0 -0
  94. archivey-0.0.1a1/tests/test_archives/compression_methods__zipfile_store.zip +0 -0
  95. archivey-0.0.1a1/tests/test_archives/compression_methods_lzma__zipfile_store.zip +0 -0
  96. archivey-0.0.1a1/tests/test_archives/duplicate_files__.rar +0 -0
  97. archivey-0.0.1a1/tests/test_archives/duplicate_files__7zcmd.7z +0 -0
  98. archivey-0.0.1a1/tests/test_archives/duplicate_files__infozip.zip +0 -0
  99. archivey-0.0.1a1/tests/test_archives/duplicate_files__py7zr.7z +0 -0
  100. archivey-0.0.1a1/tests/test_archives/duplicate_files__rar4.rar +0 -0
  101. archivey-0.0.1a1/tests/test_archives/duplicate_files__tarfile.tar +0 -0
  102. archivey-0.0.1a1/tests/test_archives/duplicate_files__tarfile.tar.gz +0 -0
  103. archivey-0.0.1a1/tests/test_archives/duplicate_files__zipfile_deflate.zip +0 -0
  104. archivey-0.0.1a1/tests/test_archives/duplicate_files__zipfile_store.zip +0 -0
  105. archivey-0.0.1a1/tests/test_archives/encoding__.rar +0 -0
  106. archivey-0.0.1a1/tests/test_archives/encoding__7zcmd.7z +0 -0
  107. archivey-0.0.1a1/tests/test_archives/encoding__infozip.zip +0 -0
  108. archivey-0.0.1a1/tests/test_archives/encoding__py7zr.7z +0 -0
  109. archivey-0.0.1a1/tests/test_archives/encoding__rar4.rar +0 -0
  110. archivey-0.0.1a1/tests/test_archives/encoding__tarcmd.tar +0 -0
  111. archivey-0.0.1a1/tests/test_archives/encoding__tarcmd.tar.gz +0 -0
  112. archivey-0.0.1a1/tests/test_archives/encoding__tarcmd.tar.zst +0 -0
  113. archivey-0.0.1a1/tests/test_archives/encoding__tarfile.tar +0 -0
  114. archivey-0.0.1a1/tests/test_archives/encoding__tarfile.tar.gz +0 -0
  115. archivey-0.0.1a1/tests/test_archives/encoding__tarfile.tar.zst +0 -0
  116. archivey-0.0.1a1/tests/test_archives/encoding__zipfile_deflate.zip +0 -0
  117. archivey-0.0.1a1/tests/test_archives/encoding__zipfile_store.zip +0 -0
  118. archivey-0.0.1a1/tests/test_archives/encoding_comment__.rar +0 -0
  119. archivey-0.0.1a1/tests/test_archives/encoding_comment__infozip.zip +0 -0
  120. archivey-0.0.1a1/tests/test_archives/encoding_comment__rar4.rar +0 -0
  121. archivey-0.0.1a1/tests/test_archives/encoding_comment__zipfile_deflate.zip +0 -0
  122. archivey-0.0.1a1/tests/test_archives/encoding_comment__zipfile_store.zip +0 -0
  123. archivey-0.0.1a1/tests/test_archives/encrypted_header__.rar +0 -0
  124. archivey-0.0.1a1/tests/test_archives/encrypted_header__7zcmd.7z +0 -0
  125. archivey-0.0.1a1/tests/test_archives/encrypted_header__py7zr.7z +0 -0
  126. archivey-0.0.1a1/tests/test_archives/encrypted_header__rar4.rar +0 -0
  127. archivey-0.0.1a1/tests/test_archives/encrypted_header_solid__.rar +0 -0
  128. archivey-0.0.1a1/tests/test_archives/encrypted_header_solid__7zcmd.7z +0 -0
  129. archivey-0.0.1a1/tests/test_archives/encrypted_header_solid__py7zr.7z +0 -0
  130. archivey-0.0.1a1/tests/test_archives/encrypted_header_solid__rar4.rar +0 -0
  131. archivey-0.0.1a1/tests/test_archives/encryption__.rar +0 -0
  132. archivey-0.0.1a1/tests/test_archives/encryption__7zcmd.7z +0 -0
  133. archivey-0.0.1a1/tests/test_archives/encryption__infozip.zip +0 -0
  134. archivey-0.0.1a1/tests/test_archives/encryption__py7zr.7z +0 -0
  135. archivey-0.0.1a1/tests/test_archives/encryption__rar4.rar +0 -0
  136. archivey-0.0.1a1/tests/test_archives/encryption_several_passwords__.rar +0 -0
  137. archivey-0.0.1a1/tests/test_archives/encryption_several_passwords__7zcmd.7z +0 -0
  138. archivey-0.0.1a1/tests/test_archives/encryption_several_passwords__infozip.zip +0 -0
  139. archivey-0.0.1a1/tests/test_archives/encryption_several_passwords__py7zr.7z +0 -0
  140. archivey-0.0.1a1/tests/test_archives/encryption_several_passwords__rar4.rar +0 -0
  141. archivey-0.0.1a1/tests/test_archives/encryption_solid__.rar +0 -0
  142. archivey-0.0.1a1/tests/test_archives/encryption_solid__7zcmd.7z +0 -0
  143. archivey-0.0.1a1/tests/test_archives/encryption_solid__py7zr.7z +0 -0
  144. archivey-0.0.1a1/tests/test_archives/encryption_solid__rar4.rar +0 -0
  145. archivey-0.0.1a1/tests/test_archives/encryption_with_plain__.rar +0 -0
  146. archivey-0.0.1a1/tests/test_archives/encryption_with_plain__7zcmd.7z +0 -0
  147. archivey-0.0.1a1/tests/test_archives/encryption_with_plain__infozip.zip +0 -0
  148. archivey-0.0.1a1/tests/test_archives/encryption_with_plain__py7zr.7z +0 -0
  149. archivey-0.0.1a1/tests/test_archives/encryption_with_plain__rar4.rar +0 -0
  150. archivey-0.0.1a1/tests/test_archives/encryption_with_symlinks__.rar +0 -0
  151. archivey-0.0.1a1/tests/test_archives/encryption_with_symlinks__7zcmd.7z +0 -0
  152. archivey-0.0.1a1/tests/test_archives/encryption_with_symlinks__rar4.rar +0 -0
  153. archivey-0.0.1a1/tests/test_archives/hardlinks_nonsolid__.rar +0 -0
  154. archivey-0.0.1a1/tests/test_archives/hardlinks_recursive_and_broken__tarfile.tar +0 -0
  155. archivey-0.0.1a1/tests/test_archives/hardlinks_recursive_and_broken__tarfile.tar.gz +0 -0
  156. archivey-0.0.1a1/tests/test_archives/hardlinks_solid__.rar +0 -0
  157. archivey-0.0.1a1/tests/test_archives/hardlinks_solid__tarcmd.tar +0 -0
  158. archivey-0.0.1a1/tests/test_archives/hardlinks_solid__tarcmd.tar.gz +0 -0
  159. archivey-0.0.1a1/tests/test_archives/hardlinks_solid__tarcmd.tar.zst +0 -0
  160. archivey-0.0.1a1/tests/test_archives/hardlinks_solid__tarfile.tar +0 -0
  161. archivey-0.0.1a1/tests/test_archives/hardlinks_solid__tarfile.tar.gz +0 -0
  162. archivey-0.0.1a1/tests/test_archives/hardlinks_solid__tarfile.tar.zst +0 -0
  163. archivey-0.0.1a1/tests/test_archives/hardlinks_with_duplicate_files__tarfile.tar +0 -0
  164. archivey-0.0.1a1/tests/test_archives/large_files_nonsolid__.rar +0 -0
  165. archivey-0.0.1a1/tests/test_archives/large_files_nonsolid__7zcmd.7z +0 -0
  166. archivey-0.0.1a1/tests/test_archives/large_files_nonsolid__infozip.zip +0 -0
  167. archivey-0.0.1a1/tests/test_archives/large_files_nonsolid__py7zr.7z +0 -0
  168. archivey-0.0.1a1/tests/test_archives/large_files_nonsolid__rar4.rar +0 -0
  169. archivey-0.0.1a1/tests/test_archives/large_files_nonsolid__zipfile_deflate.zip +0 -0
  170. archivey-0.0.1a1/tests/test_archives/large_files_nonsolid__zipfile_store.zip +0 -0
  171. archivey-0.0.1a1/tests/test_archives/large_files_solid__.rar +0 -0
  172. archivey-0.0.1a1/tests/test_archives/large_files_solid__.tar.bz2 +0 -0
  173. archivey-0.0.1a1/tests/test_archives/large_files_solid__.tar.lz4 +0 -0
  174. archivey-0.0.1a1/tests/test_archives/large_files_solid__.tar.xz +0 -0
  175. archivey-0.0.1a1/tests/test_archives/large_files_solid__7zcmd.7z +0 -0
  176. archivey-0.0.1a1/tests/test_archives/large_files_solid__py7zr.7z +0 -0
  177. archivey-0.0.1a1/tests/test_archives/large_files_solid__rar4.rar +0 -0
  178. archivey-0.0.1a1/tests/test_archives/large_files_solid__tarcmd.tar +0 -0
  179. archivey-0.0.1a1/tests/test_archives/large_files_solid__tarcmd.tar.gz +0 -0
  180. archivey-0.0.1a1/tests/test_archives/large_files_solid__tarcmd.tar.zst +0 -0
  181. archivey-0.0.1a1/tests/test_archives/large_files_solid__tarfile.tar +0 -0
  182. archivey-0.0.1a1/tests/test_archives/large_files_solid__tarfile.tar.gz +0 -0
  183. archivey-0.0.1a1/tests/test_archives/large_files_solid__tarfile.tar.zst +0 -0
  184. archivey-0.0.1a1/tests/test_archives/large_single_file__cmd.bz2 +0 -0
  185. archivey-0.0.1a1/tests/test_archives/large_single_file__cmd.gz +0 -0
  186. archivey-0.0.1a1/tests/test_archives/large_single_file__cmd.lz4 +0 -0
  187. archivey-0.0.1a1/tests/test_archives/large_single_file__cmd.xz +0 -0
  188. archivey-0.0.1a1/tests/test_archives/large_single_file__cmd.zst +0 -0
  189. archivey-0.0.1a1/tests/test_archives/large_single_file__lib.bz2 +0 -0
  190. archivey-0.0.1a1/tests/test_archives/large_single_file__lib.gz +0 -0
  191. archivey-0.0.1a1/tests/test_archives/large_single_file__lib.lz4 +0 -0
  192. archivey-0.0.1a1/tests/test_archives/large_single_file__lib.xz +0 -0
  193. archivey-0.0.1a1/tests/test_archives/large_single_file__lib.zst +0 -0
  194. archivey-0.0.1a1/tests/test_archives/permissions__.rar +0 -0
  195. archivey-0.0.1a1/tests/test_archives/permissions__7zcmd.7z +0 -0
  196. archivey-0.0.1a1/tests/test_archives/permissions__infozip.zip +0 -0
  197. archivey-0.0.1a1/tests/test_archives/permissions__py7zr.7z +0 -0
  198. archivey-0.0.1a1/tests/test_archives/permissions__rar4.rar +0 -0
  199. archivey-0.0.1a1/tests/test_archives/permissions__tarcmd.tar +0 -0
  200. archivey-0.0.1a1/tests/test_archives/permissions__tarcmd.tar.gz +0 -0
  201. archivey-0.0.1a1/tests/test_archives/permissions__tarcmd.tar.zst +0 -0
  202. archivey-0.0.1a1/tests/test_archives/permissions__tarfile.tar +0 -0
  203. archivey-0.0.1a1/tests/test_archives/permissions__tarfile.tar.gz +0 -0
  204. archivey-0.0.1a1/tests/test_archives/permissions__tarfile.tar.zst +0 -0
  205. archivey-0.0.1a1/tests/test_archives/permissions__zipfile_deflate.zip +0 -0
  206. archivey-0.0.1a1/tests/test_archives/permissions__zipfile_store.zip +0 -0
  207. archivey-0.0.1a1/tests/test_archives/sanitize__.rar +0 -0
  208. archivey-0.0.1a1/tests/test_archives/sanitize__7zcmd.7z +0 -0
  209. archivey-0.0.1a1/tests/test_archives/sanitize__rar4.rar +0 -0
  210. archivey-0.0.1a1/tests/test_archives/sanitize__tarfile.tar +0 -0
  211. archivey-0.0.1a1/tests/test_archives/sanitize__tarfile.tar.gz +0 -0
  212. archivey-0.0.1a1/tests/test_archives/sanitize__zipfile_store.zip +0 -0
  213. archivey-0.0.1a1/tests/test_archives/single_file__cmd.bz2 +0 -0
  214. archivey-0.0.1a1/tests/test_archives/single_file__cmd.gz +0 -0
  215. archivey-0.0.1a1/tests/test_archives/single_file__cmd.lz4 +0 -0
  216. archivey-0.0.1a1/tests/test_archives/single_file__cmd.xz +0 -0
  217. archivey-0.0.1a1/tests/test_archives/single_file__cmd.zst +0 -0
  218. archivey-0.0.1a1/tests/test_archives/single_file__lib.bz2 +0 -0
  219. archivey-0.0.1a1/tests/test_archives/single_file__lib.gz +0 -0
  220. archivey-0.0.1a1/tests/test_archives/single_file__lib.lz4 +0 -0
  221. archivey-0.0.1a1/tests/test_archives/single_file__lib.xz +0 -0
  222. archivey-0.0.1a1/tests/test_archives/single_file__lib.zst +0 -0
  223. archivey-0.0.1a1/tests/test_archives/single_file_with_metadata__cmd.gz +0 -0
  224. archivey-0.0.1a1/tests/test_archives/symlink_loop__infozip.zip +0 -0
  225. archivey-0.0.1a1/tests/test_archives/symlink_loop__tarfile.tar +0 -0
  226. archivey-0.0.1a1/tests/test_archives/symlinks__.rar +0 -0
  227. archivey-0.0.1a1/tests/test_archives/symlinks__7zcmd.7z +0 -0
  228. archivey-0.0.1a1/tests/test_archives/symlinks__infozip.zip +0 -0
  229. archivey-0.0.1a1/tests/test_archives/symlinks__py7zr.7z +0 -0
  230. archivey-0.0.1a1/tests/test_archives/symlinks__rar4.rar +0 -0
  231. archivey-0.0.1a1/tests/test_archives/symlinks__zipfile_deflate.zip +0 -0
  232. archivey-0.0.1a1/tests/test_archives/symlinks__zipfile_store.zip +0 -0
  233. archivey-0.0.1a1/tests/test_archives/symlinks_solid__.rar +0 -0
  234. archivey-0.0.1a1/tests/test_archives/symlinks_solid__.tar.bz2 +0 -0
  235. archivey-0.0.1a1/tests/test_archives/symlinks_solid__.tar.lz4 +0 -0
  236. archivey-0.0.1a1/tests/test_archives/symlinks_solid__.tar.xz +0 -0
  237. archivey-0.0.1a1/tests/test_archives/symlinks_solid__7zcmd.7z +0 -0
  238. archivey-0.0.1a1/tests/test_archives/symlinks_solid__py7zr.7z +0 -0
  239. archivey-0.0.1a1/tests/test_archives/symlinks_solid__rar4.rar +0 -0
  240. archivey-0.0.1a1/tests/test_archives/symlinks_solid__tarcmd.tar +0 -0
  241. archivey-0.0.1a1/tests/test_archives/symlinks_solid__tarcmd.tar.gz +0 -0
  242. archivey-0.0.1a1/tests/test_archives/symlinks_solid__tarcmd.tar.zst +0 -0
  243. archivey-0.0.1a1/tests/test_archives/symlinks_solid__tarfile.tar +0 -0
  244. archivey-0.0.1a1/tests/test_archives/symlinks_solid__tarfile.tar.gz +0 -0
  245. archivey-0.0.1a1/tests/test_archives/symlinks_solid__tarfile.tar.zst +0 -0
  246. archivey-0.0.1a1/tests/test_archives_before_refactor/basic.rar +0 -0
  247. archivey-0.0.1a1/tests/test_archives_external/encoding_infozip_jules.zip +0 -0
  248. archivey-0.0.1a1/tox.ini +78 -0
@@ -0,0 +1,50 @@
1
+ name: Deploy docs
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+
7
+ permissions:
8
+ contents: read
9
+ pages: write
10
+ id-token: write
11
+
12
+ concurrency:
13
+ group: "pages"
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ build:
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Setup Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.13"
28
+
29
+ - name: Install dependencies
30
+ run: |
31
+ pip install mkdocs mkdocstrings[python] mkdocs-material griffe griffe-fieldz
32
+
33
+ - name: Build MkDocs
34
+ run: mkdocs build
35
+
36
+ - name: Upload artifact
37
+ uses: actions/upload-pages-artifact@v3
38
+ with:
39
+ path: ./site
40
+
41
+ deploy:
42
+ needs: build
43
+ runs-on: ubuntu-latest
44
+ environment:
45
+ name: github-pages
46
+ url: ${{ steps.deployment.outputs.page_url }}
47
+ steps:
48
+ - name: Deploy to GitHub Pages
49
+ id: deployment
50
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,62 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: '3.13'
22
+
23
+ - name: Install Hatch
24
+ run: pip install hatch
25
+
26
+ - name: Build package
27
+ run: hatch build
28
+
29
+ - uses: actions/upload-artifact@v4
30
+ with:
31
+ path: ./dist
32
+
33
+ pypi-publish:
34
+ needs: ['build']
35
+ environment: 'publish'
36
+ name: upload release to PyPI
37
+ runs-on: ubuntu-latest
38
+ permissions:
39
+ id-token: write
40
+ steps:
41
+ - uses: actions/download-artifact@v4
42
+
43
+ - name: Publish package distributions to PyPI
44
+ if: github.repository == 'davitf/archivey'
45
+ uses: pypa/gh-action-pypi-publish@release/v1
46
+ with:
47
+ packages_dir: artifact
48
+ password: ${{ secrets.PYPI_API_TOKEN }}
49
+
50
+ - name: Publish package distributions to TestPyPI
51
+ if: github.repository == 'davitf/archivey-dev'
52
+ uses: pypa/gh-action-pypi-publish@release/v1
53
+ with:
54
+ packages_dir: artifact
55
+ password: ${{ secrets.TEST_PYPI_API_TOKEN }}
56
+ repository-url: https://test.pypi.org/legacy/
57
+
58
+ - name: Fail on unexpected repository
59
+ if: github.repository != 'davitf/archivey' && github.repository != 'davitf/archivey-dev'
60
+ run: |
61
+ echo "Repository ${{ github.repository }} is not allowed to publish" >&2
62
+ exit 1
@@ -0,0 +1,43 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ lint:
11
+ name: Run Ruff and Pyright
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Check out code
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.13"
21
+
22
+ - name: Install Node.js
23
+ uses: actions/setup-node@v4
24
+ with:
25
+ node-version: "20"
26
+
27
+ - name: Install uv
28
+ run: |
29
+ curl -LsSf https://astral.sh/uv/install.sh | sh
30
+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
31
+
32
+ - name: Install dependencies
33
+ run: |
34
+ uv run --extra optional python --version
35
+
36
+ - name: Run Ruff checks
37
+ run: |
38
+ uv run --extra optional ruff check --fix .
39
+ uv run --extra optional ruff format .
40
+
41
+ - name: Run Pyright
42
+ run: |
43
+ npx pyright .
@@ -0,0 +1,70 @@
1
+ name: Run Tox Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ all-deps-tests:
11
+ name: Tox - py${{ matrix.python-version }}-alldeps
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.13t", "3.14-dev", "3.14t-dev"]
17
+
18
+ steps:
19
+ - name: Check out code
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Install tox
28
+ run: pip install tox
29
+
30
+ - name: Install unrar (for rarfile tests)
31
+ run: sudo apt-get update && sudo apt-get install -y unrar
32
+
33
+ - name: Run tox environment
34
+ run: |
35
+ if [[ "${{ matrix.python-version }}" == "3.14-dev" ]]; then
36
+ tox -e py3.14-alldeps
37
+ elif [[ "${{ matrix.python-version }}" == "3.14t-dev" ]]; then
38
+ tox -e py3.14t-freethreaded
39
+ elif [[ "${{ matrix.python-version }}" == "3.13t" ]]; then
40
+ tox -e py3.13t-freethreaded
41
+ else
42
+ tox -e py${{ matrix.python-version }}-alldeps
43
+ fi
44
+
45
+ dependency-version-tests:
46
+ name: Tox - py${{ matrix.python-version }}-${{ matrix.tox_env }}
47
+ runs-on: ubuntu-latest
48
+ strategy:
49
+ fail-fast: false
50
+ matrix:
51
+ python-version: ["3.10", "3.13"]
52
+ tox_env: ["newlibs", "oldlibs", "nolibs", "rarfile_no_crypto"]
53
+
54
+ steps:
55
+ - name: Check out code
56
+ uses: actions/checkout@v4
57
+
58
+ - name: Set up Python ${{ matrix.python-version }}
59
+ uses: actions/setup-python@v5
60
+ with:
61
+ python-version: ${{ matrix.python-version }}
62
+
63
+ - name: Install tox
64
+ run: pip install tox
65
+
66
+ - name: Install unrar (for rarfile tests)
67
+ run: sudo apt-get update && sudo apt-get install -y unrar
68
+
69
+ - name: Run tox environment
70
+ run: tox -e py${{ matrix.python-version }}-${{ matrix.tox_env }}
@@ -0,0 +1,176 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+ tests/test_corrupted_archives/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # UV
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ #poetry.lock
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ #pdm.lock
114
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
115
+ # in version control.
116
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
117
+ .pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
122
+ __pypackages__/
123
+
124
+ # Celery stuff
125
+ celerybeat-schedule
126
+ celerybeat.pid
127
+
128
+ # SageMath parsed files
129
+ *.sage.py
130
+
131
+ # Environments
132
+ .env
133
+ .venv
134
+ env/
135
+ venv/
136
+ ENV/
137
+ env.bak/
138
+ venv.bak/
139
+
140
+ # Spyder project settings
141
+ .spyderproject
142
+ .spyproject
143
+
144
+ # Rope project settings
145
+ .ropeproject
146
+
147
+ # mkdocs documentation
148
+ site/
149
+
150
+ # mypy
151
+ .mypy_cache/
152
+ .dmypy.json
153
+ dmypy.json
154
+
155
+ # Pyre type checker
156
+ .pyre/
157
+
158
+ # pytype static type analyzer
159
+ .pytype/
160
+
161
+ # Cython debug symbols
162
+ cython_debug/
163
+
164
+ # PyCharm
165
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
166
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
167
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
168
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
169
+ #.idea/
170
+
171
+ # Ruff stuff:
172
+ .ruff_cache/
173
+
174
+ # PyPI configuration file
175
+ .pypirc
176
+ docs/api/
@@ -0,0 +1,74 @@
1
+ # Developer Notes
2
+
3
+ This project follows a **src layout**. The Python package lives in
4
+ `src/archivey` and tests are under the `tests` directory. Test archives live in
5
+ `tests/test_archives` and helper scripts are in `tests/archivey/create_archives.py`.
6
+
7
+ Tox configurations are provided to run the suite against multiple Python
8
+ versions and dependency sets (`tox -e <env>`). Continuous integration executes
9
+ these tox environments via the workflow in `.github/workflows/tox-tests.yml`.
10
+
11
+ To help development, install **uv** and **hatch**. Also install the **unrar** tool:
12
+
13
+ ```bash
14
+ pip install uv hatch
15
+ sudo apt-get install -y unrar
16
+ ```
17
+
18
+ If you can't install unrar, the RAR-related tests may fail; just ignore them.
19
+
20
+ ## Running the tests
21
+
22
+ To run the tests:
23
+
24
+ ```bash
25
+ uv run --extra optional pytest
26
+ ```
27
+
28
+ To run a specific test or a subset of tests, pass `-k` with a pattern. For
29
+ example, to run only tests related to zip archives:
30
+
31
+ ```bash
32
+ uv run --extra optional pytest -k .zip
33
+ ```
34
+
35
+ ## Updating test files
36
+
37
+ ```bash
38
+ uv run --extra optional python -m tests.archivey.create_archives [file_pattern]
39
+ ```
40
+
41
+ E.g. to update only zip archives:
42
+
43
+ ```bash
44
+ uv run --extra optional python -m tests.archivey.create_archives "*.zip"
45
+ ```
46
+
47
+ If no file_pattern is specified, all the files will be created.
48
+
49
+
50
+ ## Repository layout
51
+
52
+ - `src/archivey` – implementation modules (readers, CLI, helpers).
53
+ - `tests` – pytest suite.
54
+ - `archivey` – conftest, test utilities and main test modules.
55
+ - `test_archives` – sample archives used by the tests.
56
+ - `test_archives_external` – external archives for specific scenarios.
57
+ - `pyproject.toml` – project metadata and tooling configuration.
58
+ - `tox.ini` – defines tox environments used in CI.
59
+ - `.github/workflows/tox-tests.yml` - defines Github actions for running the tox tests.
60
+
61
+ A command line script that can be used to test if the modules are working is:
62
+
63
+ ```bash
64
+ uv run --extra optional python -m archivey.cli [archive_files]
65
+ ```
66
+
67
+ It will print the contents of the archive, as read by the corresponding ArchiveReader,
68
+ along with the file hashes (computed by reading the archive members).
69
+
70
+
71
+ ## Best practices
72
+
73
+ - All exceptions raised by libraries should be wrapped in an exception defined in
74
+ `src/archivey/exceptions.py`.
@@ -0,0 +1,21 @@
1
+ # Contributing to Archivey
2
+
3
+ Thanks for your interest in improving Archivey!
4
+
5
+ See the [Developer Guide](docs/developer_guide.md) for details on the package layout and how to implement new readers.
6
+
7
+ ## Getting started
8
+
9
+ 1. Install Python 3.10 or newer and clone the repository.
10
+ 2. Install optional dependencies and tools:
11
+ ```bash
12
+ pip install uv hatch
13
+ sudo apt-get install -y unrar # optional, for RAR tests
14
+ ```
15
+ 3. Run the tests with:
16
+ ```bash
17
+ uv run --extra optional pytest
18
+ ```
19
+ Use `-k` to run a subset of tests.
20
+
21
+ Pull requests are welcome. Please follow the guidelines in `AGENTS.md` and keep the code simple and well typed.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 davitf
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,87 @@
1
+ Metadata-Version: 2.4
2
+ Name: archivey
3
+ Version: 0.0.1a1
4
+ Summary: Python library for reading zip, tar, rar, 7z and other archives
5
+ Author-email: Davi Figueiredo <gh@davitf.com>
6
+ License: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.10
9
+ Requires-Dist: backports-strenum>=1.3.1; python_full_version < '3.11'
10
+ Requires-Dist: tqdm>=4.67.1
11
+ Requires-Dist: typing-extensions>=4.0.0
12
+ Provides-Extra: optional
13
+ Requires-Dist: cryptography>=45.0.3; extra == 'optional'
14
+ Requires-Dist: indexed-bzip2>=1.6.0; extra == 'optional'
15
+ Requires-Dist: lz4>=4.4.4; (python_full_version < '3.14') and extra == 'optional'
16
+ Requires-Dist: py7zr>=1.0.0; extra == 'optional'
17
+ Requires-Dist: pycdlib>=1.14.0; extra == 'optional'
18
+ Requires-Dist: python-xz>=0.5.0; extra == 'optional'
19
+ Requires-Dist: pyzstd>=0.17.0; extra == 'optional'
20
+ Requires-Dist: rapidgzip>=0.14.4; extra == 'optional'
21
+ Requires-Dist: rarfile>=4.2; extra == 'optional'
22
+ Requires-Dist: zstandard>=0.23.0; (python_full_version < '3.14') and extra == 'optional'
23
+ Provides-Extra: optional-freethreaded
24
+ Requires-Dist: indexed-bzip2>=1.6.0; extra == 'optional-freethreaded'
25
+ Requires-Dist: lz4>=4.4.4; (python_full_version < '3.14') and extra == 'optional-freethreaded'
26
+ Requires-Dist: py7zr>=1.0.0; extra == 'optional-freethreaded'
27
+ Requires-Dist: pycdlib>=1.14.0; extra == 'optional-freethreaded'
28
+ Requires-Dist: pycryptodome>=3.23.0; extra == 'optional-freethreaded'
29
+ Requires-Dist: python-xz>=0.5.0; extra == 'optional-freethreaded'
30
+ Requires-Dist: pyzstd>=0.17.0; extra == 'optional-freethreaded'
31
+ Requires-Dist: rarfile>=4.2; extra == 'optional-freethreaded'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # Archivey
35
+
36
+ **Archivey** is a Python library that provides a unified interface for reading several archive and compression formats, wrapping built-in Python modules and optional external packages.
37
+
38
+ 👉 **Full documentation is published [here](https://davitf.github.io/archivey/)**.
39
+
40
+ ---
41
+
42
+ ## Quick start
43
+
44
+ Install with third-party libraries:
45
+
46
+ ```bash
47
+ pip install archivey[optional]
48
+ ```
49
+
50
+ Or manage dependencies yourself for only the formats you need. RAR support requires `unrar` to be installed separately.
51
+
52
+ ### Usage example
53
+
54
+ ```python
55
+ from archivey import open_archive
56
+
57
+ with open_archive("example.zip") as archive:
58
+ # Extract all files
59
+ archive.extractall("output_dir/")
60
+
61
+ # Or process each file inside the archive
62
+ for member, stream in archive.iter_members_with_io():
63
+ print(member.filename, member.type, member.file_size)
64
+ if stream is not None: # skip directories and links
65
+ data = stream.read()
66
+ print(" ", data[:50])
67
+ ```
68
+
69
+ See more details in the [User guide](https://davitf.github.io/archivey/user_guide/).
70
+
71
+ ---
72
+
73
+ ## Why use this?
74
+
75
+ - Automatic archive format detection
76
+ - Consistent interface across multiple archive types
77
+ - Optimized for random access and streaming
78
+ - Sensible, secure defaults for file extraction
79
+
80
+ ---
81
+
82
+ ## Resources
83
+
84
+ - [User guide](https://davitf.github.io/archivey/user_guide/)
85
+ - [API Reference](https://davitf.github.io/archivey/reference/)
86
+ - [GitHub repository](https://github.com/davitf/archivey) (or the [development repository](https://github.com/davitf/archivey-dev) with messier commits and AI-generated pull requests)
87
+ - [Developer guide](https://davitf.github.io/archivey/developer_guide/), if you'd like to contribute
@@ -0,0 +1,54 @@
1
+ # Archivey
2
+
3
+ **Archivey** is a Python library that provides a unified interface for reading several archive and compression formats, wrapping built-in Python modules and optional external packages.
4
+
5
+ 👉 **Full documentation is published [here](https://davitf.github.io/archivey/)**.
6
+
7
+ ---
8
+
9
+ ## Quick start
10
+
11
+ Install with third-party libraries:
12
+
13
+ ```bash
14
+ pip install archivey[optional]
15
+ ```
16
+
17
+ Or manage dependencies yourself for only the formats you need. RAR support requires `unrar` to be installed separately.
18
+
19
+ ### Usage example
20
+
21
+ ```python
22
+ from archivey import open_archive
23
+
24
+ with open_archive("example.zip") as archive:
25
+ # Extract all files
26
+ archive.extractall("output_dir/")
27
+
28
+ # Or process each file inside the archive
29
+ for member, stream in archive.iter_members_with_io():
30
+ print(member.filename, member.type, member.file_size)
31
+ if stream is not None: # skip directories and links
32
+ data = stream.read()
33
+ print(" ", data[:50])
34
+ ```
35
+
36
+ See more details in the [User guide](https://davitf.github.io/archivey/user_guide/).
37
+
38
+ ---
39
+
40
+ ## Why use this?
41
+
42
+ - Automatic archive format detection
43
+ - Consistent interface across multiple archive types
44
+ - Optimized for random access and streaming
45
+ - Sensible, secure defaults for file extraction
46
+
47
+ ---
48
+
49
+ ## Resources
50
+
51
+ - [User guide](https://davitf.github.io/archivey/user_guide/)
52
+ - [API Reference](https://davitf.github.io/archivey/reference/)
53
+ - [GitHub repository](https://github.com/davitf/archivey) (or the [development repository](https://github.com/davitf/archivey-dev) with messier commits and AI-generated pull requests)
54
+ - [Developer guide](https://davitf.github.io/archivey/developer_guide/), if you'd like to contribute
@@ -0,0 +1,12 @@
1
+ # API Reference
2
+
3
+ ::: archivey
4
+
5
+ :::archivey.types
6
+ options:
7
+ show_source: true
8
+
9
+ :::archivey.exceptions
10
+
11
+ :::archivey.filters
12
+