codeaudit 1.4.1__tar.gz → 1.4.2__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 (164) hide show
  1. {codeaudit-1.4.1 → codeaudit-1.4.2}/CHANGELOG.md +16 -1
  2. {codeaudit-1.4.1 → codeaudit-1.4.2}/CONTRIBUTE.md +16 -15
  3. {codeaudit-1.4.1 → codeaudit-1.4.2}/PKG-INFO +5 -6
  4. {codeaudit-1.4.1 → codeaudit-1.4.2}/README.md +4 -5
  5. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/CONTRIBUTE.md +15 -1
  6. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/_toc.yml +2 -0
  7. codeaudit-1.4.2/docs/apidocs/api_intro.md +26 -0
  8. codeaudit-1.4.2/docs/codeauditcommands.md +230 -0
  9. codeaudit-1.4.2/docs/examples/ca_api_example_basic.ipynb +707 -0
  10. codeaudit-1.4.2/docs/examples/ca_api_example_checks.ipynb +395 -0
  11. codeaudit-1.4.2/docs/examples/ca_api_example_scanning.ipynb +195 -0
  12. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/examples/demoscan.json +2 -2
  13. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/intro.md +70 -3
  14. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/__about__.py +1 -1
  15. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/api_interfaces.py +143 -37
  16. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/codeaudit.py +11 -8
  17. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/reporting.py +121 -21
  18. codeaudit-1.4.1/docs/apidocs/api_intro.md +0 -19
  19. codeaudit-1.4.1/docs/codeauditcommands.md +0 -130
  20. codeaudit-1.4.1/docs/examples/ca_api_example_basic.ipynb +0 -191
  21. {codeaudit-1.4.1 → codeaudit-1.4.2}/.gitignore +0 -0
  22. {codeaudit-1.4.1 → codeaudit-1.4.2}/LICENSE.txt +0 -0
  23. {codeaudit-1.4.1 → codeaudit-1.4.2}/SECURITY.md +0 -0
  24. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/CLIcommands.ipynb +0 -0
  25. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/_config.yml +0 -0
  26. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/_static/nocxstyle.css +0 -0
  27. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/about.md +0 -0
  28. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/apidocs/codeaudit.rst +0 -0
  29. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/apidocs/modules.rst +0 -0
  30. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/astlines.md +0 -0
  31. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/astlines2.md +0 -0
  32. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/changelog.md +0 -0
  33. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/assert_check.md +0 -0
  34. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/base64_check.md +0 -0
  35. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/binding_check.md +0 -0
  36. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/builtinfunctions_check.md +0 -0
  37. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/chmod_check.md +0 -0
  38. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/directorycreation_check.md +0 -0
  39. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/dynamicimport_check.md +0 -0
  40. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/exception_check.md +0 -0
  41. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/hash_check.md +0 -0
  42. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/httpserver_check.md +0 -0
  43. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/input_check.md +0 -0
  44. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/loggingconf_check.md +0 -0
  45. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/marshal_check.md +0 -0
  46. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/mktemp_check.md +0 -0
  47. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/multiprocessing_check.md +0 -0
  48. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/pickle_check.md +0 -0
  49. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/random_check.md +0 -0
  50. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/shelve_check.md +0 -0
  51. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/shutil_check.md +0 -0
  52. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/subprocess_check.md +0 -0
  53. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/syscalls_check.md +0 -0
  54. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/systemcalls_check.md +0 -0
  55. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/tarfile_extract_check.md +0 -0
  56. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/xml_check.md +0 -0
  57. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checks/zipfile_check.md +0 -0
  58. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/checksinformation.md +0 -0
  59. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/codeauditchecks.md +0 -0
  60. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/codeauditoverview.md +0 -0
  61. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/complexitycheck.md +0 -0
  62. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/examples/ca_api_example_json.ipynb +0 -0
  63. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/examples/ca_api_example_overview.ipynb +0 -0
  64. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/examples/checks.html +0 -0
  65. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/examples/demofile.py +0 -0
  66. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/examples/directoryscan.html +0 -0
  67. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/examples/filescan.html +0 -0
  68. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/examples/modulescan.html +0 -0
  69. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/examples/overview.html +0 -0
  70. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/features.md +0 -0
  71. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/filescan.md +0 -0
  72. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/filescan.png +0 -0
  73. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/handling_errors.md +0 -0
  74. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/help.md +0 -0
  75. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/howtoscan.md +0 -0
  76. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/images/OO.png +0 -0
  77. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/images/ROI_logo.png +0 -0
  78. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/images/YourLogoHere.png +0 -0
  79. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/images/codeauditlogo.png +0 -0
  80. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/images/nocxbanner.png +0 -0
  81. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/images/overview_linkaudit.png +0 -0
  82. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/implementedvalidations.md +0 -0
  83. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/issues.md +0 -0
  84. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/license.md +0 -0
  85. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/makeitbetter.md +0 -0
  86. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/modulescan.md +0 -0
  87. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/overviewplot.png +0 -0
  88. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/pca_overview.png +0 -0
  89. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/project_philosophy.md +0 -0
  90. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/securecoding.md +0 -0
  91. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/sponsors.md +0 -0
  92. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/userguide.md +0 -0
  93. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/warnings.md +0 -0
  94. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/whatissast.md +0 -0
  95. {codeaudit-1.4.1 → codeaudit-1.4.2}/docs/whysast.md +0 -0
  96. {codeaudit-1.4.1 → codeaudit-1.4.2}/filescan.png +0 -0
  97. {codeaudit-1.4.1 → codeaudit-1.4.2}/pyproject.toml +0 -0
  98. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/__init__.py +0 -0
  99. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/altairplots.py +0 -0
  100. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/api_reporting.py +0 -0
  101. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/checkmodules.py +0 -0
  102. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/complexitycheck.py +0 -0
  103. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/data/sastchecks.csv +0 -0
  104. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/filehelpfunctions.py +0 -0
  105. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/htmlhelpfunctions.py +0 -0
  106. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/issuevalidations.py +0 -0
  107. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/pypi_package_scan.py +0 -0
  108. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/security_checks.py +0 -0
  109. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/simple.css +0 -0
  110. {codeaudit-1.4.1 → codeaudit-1.4.2}/src/codeaudit/totals.py +0 -0
  111. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/__init__.py +0 -0
  112. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/count_lines_file1.py +0 -0
  113. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_apicalls.py +0 -0
  114. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_basicpatterns.py +0 -0
  115. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_chmod.py +0 -0
  116. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_constructspart2.py +0 -0
  117. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_correctexceptionuse.py +0 -0
  118. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_count_commentlines.py +0 -0
  119. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_directorycreation.py +0 -0
  120. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_directorycreation2.py +0 -0
  121. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_hashstrenght.py +0 -0
  122. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_modulecheck.py +0 -0
  123. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_obfuscatingbuiltins.py +0 -0
  124. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_oschecks.py +0 -0
  125. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_pypiscan.py +0 -0
  126. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_random.py +0 -0
  127. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_standardlibconstructs.py +0 -0
  128. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_totalscheck.py +0 -0
  129. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/test_zstd.py +0 -0
  130. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/allshit.py +0 -0
  131. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/assert.py +0 -0
  132. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/base64.py +0 -0
  133. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/chmod_things.py +0 -0
  134. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/complexitycheck.py +0 -0
  135. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/correctcounts.py +0 -0
  136. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/directorycreation.py +0 -0
  137. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/directorycreation2.py +0 -0
  138. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/dunderexec_with_parsing_error.py +0 -0
  139. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/exception.py +0 -0
  140. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/file3.py +0 -0
  141. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/file_with_warnings.py +0 -0
  142. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/gzip.py +0 -0
  143. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/hashcheck.py +0 -0
  144. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/httpserver.py +0 -0
  145. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/inputstatement.py +0 -0
  146. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/marshal.py +0 -0
  147. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/modulecheck.py +0 -0
  148. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/multiprocessing.py +0 -0
  149. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/obfuscating.py +0 -0
  150. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/oschecks.py +0 -0
  151. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/pickle.py +0 -0
  152. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/python2_file_willnotwork.py +0 -0
  153. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/random.py +0 -0
  154. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/shelve.py +0 -0
  155. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/shutil.py +0 -0
  156. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/subprocess.py +0 -0
  157. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/syslibrary.py +0 -0
  158. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/tarfilevalidation.py +0 -0
  159. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/tempcheck.py +0 -0
  160. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/validation1.py +0 -0
  161. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/validation2.py +0 -0
  162. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/xml.py +0 -0
  163. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/zipfile.py +0 -0
  164. {codeaudit-1.4.1 → codeaudit-1.4.2}/tests/validationfiles/zstd.py +0 -0
@@ -1,9 +1,24 @@
1
1
  # Change Log
2
2
 
3
+ ## Version 1.4.2: API updates and fixes
4
+
5
+ Added:
6
+ * Remote Package Scanning: The codeaudit.api_interfaces.filescan(input_path) function now supports PyPI.org packages directly. Users can scan packages by name without needing to clone the repository locally first.
7
+
8
+ Changed:
9
+ * CLI Improvements: Refined the command-line interface (CLI) help text for better clarity and updated information.
10
+
11
+ Fixed:
12
+ * Help Command Shortcut: Fixed an issue where the -? flag did not correctly trigger the help text. Running codeaudit [command] -? now displays the expected documentation.
13
+
14
+ Documentation:
15
+ * Performed a manual updates to improve readability and technical accuracy.
16
+
17
+
3
18
  ## Version 1.4.1: Bug fixes
4
19
 
5
20
  🚀 New Features & Enhancements
6
- * Remote PyPI Auditing: The codeaudit overview command now supports packages hosted directly on PyPI.org.
21
+ * Remote PyPI Auditing: The `codeaudit overview <directory|package>` command now supports creating an overview from packages hosted on PyPI.org. Consequently, local cloning is no longer required!
7
22
 
8
23
 
9
24
  🛠 Bug Fixes
@@ -2,12 +2,13 @@
2
2
 
3
3
  Great that you see this page and want to contribute!
4
4
 
5
- :::{tip}
6
- All contributions are welcome!
7
- Think of corrections on the manual, code and more or better tests.
8
- :::
5
+ > [!TIP]
6
+ >
7
+ > All contributions are welcome!
8
+ > Think of corrections on the manual, code and more or better tests.
9
9
 
10
- The **Codeaudit** code repository is hosted at [Github](github.com/nocomplexity/codeaudit).
10
+
11
+ The **Python Code Audit** code repository is hosted at [Github](github.com/nocomplexity/codeaudit).
11
12
 
12
13
  Simple Guidelines:
13
14
 
@@ -16,25 +17,25 @@ Simple Guidelines:
16
17
 
17
18
  This codeaudit tool is designed by applying [Zero Complexity By Design principles](https://nocomplexity.com/documents/0complexity/abstract.html). So the goal is to keep the tool simple to use and the code simple to adjust or to extend.
18
19
 
19
- :::{warning}
20
- This simple tool is designed to be simple to use and maintain.
21
- :::
20
+
21
+ > [!IMPORTANT]
22
+ > This simple tool is designed to be simple to use and maintain.
23
+
22
24
 
23
25
  **Pull Requests are welcome!**
24
26
 
25
- When you contribute to Codeaudit, your contributions are made under the same license as the file you are working on.
27
+ When you contribute to **Python Code Audit**, your contributions are made under the same license as the file you are working on.
26
28
 
27
29
 
28
30
  We adopt the [Collective Code Construction Contract(C4)](https://rfc.zeromq.org/spec/42/) to streamline collaboration. C4 is meant to provide a reusable optimal collaboration model for open source software projects.
29
31
 
30
- :::{attention}
31
- This project values respect and inclusiveness, and enforces a [Code of Conduct](CoC-label) in all interactions.
32
- :::
32
+ > [!IMPORTANT]
33
+ > This project values respect and inclusiveness, and enforces a [Code of Conduct](CoC-label) in all interactions.
34
+
33
35
 
36
+ > [!NOTE]
37
+ > This is an open community driven project. Contributors will be mentioned in the documentation.
34
38
 
35
- :::{note}
36
- This is an open community driven project. Contributors will be mentioned in the documentation.
37
- :::
38
39
 
39
40
  (CoC-label)=
40
41
  ## Code of Conduct
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeaudit
3
- Version: 1.4.1
3
+ Version: 1.4.2
4
4
  Summary: Simplified static security checks for Python
5
5
  Project-URL: Documentation, https://github.com/nocomplexity/codeaudit#readme
6
6
  Project-URL: Issues, https://github.com/nocomplexity/codeaudit/issues
@@ -106,14 +106,13 @@ Usage: codeaudit COMMAND <directory|package> [report.html]
106
106
  Depending on the command, you must specify a local directory, a Python file, or a package name hosted on PyPI.org.Reporting: The results are generated as a static HTML report for viewing in a web browser.
107
107
 
108
108
  Commands:
109
- overview Reports complexity and security statistics of a Python project or package on PyPI.org.
110
- filescan Scans Python code or packages on PyPI.org for security weaknesses.
111
- modulescan Reports module vulnerability information.
109
+ overview Generates an overview report of code complexity and security indicators.
110
+ filescan Scans Python source code or PyPI packages for security weaknesses.
111
+ modulescan Generates a vulnerability report for imported Python modules.
112
112
  checks Creates an HTML report of all implemented security checks.
113
113
  version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
114
114
 
115
- Use the Codeaudit documentation to check the security of Python programs and make your Python programs more secure!
116
- Check https://simplifysecurity.nocomplexity.com/
115
+ Use the Python Code Audit documentation (https://codeaudit.nocomplexity.com) to audit and secure your Python programmes. Explore further essential open-source security tools at https://simplifysecurity.nocomplexity.com/
117
116
  ```
118
117
 
119
118
  ## Example
@@ -78,14 +78,13 @@ Usage: codeaudit COMMAND <directory|package> [report.html]
78
78
  Depending on the command, you must specify a local directory, a Python file, or a package name hosted on PyPI.org.Reporting: The results are generated as a static HTML report for viewing in a web browser.
79
79
 
80
80
  Commands:
81
- overview Reports complexity and security statistics of a Python project or package on PyPI.org.
82
- filescan Scans Python code or packages on PyPI.org for security weaknesses.
83
- modulescan Reports module vulnerability information.
81
+ overview Generates an overview report of code complexity and security indicators.
82
+ filescan Scans Python source code or PyPI packages for security weaknesses.
83
+ modulescan Generates a vulnerability report for imported Python modules.
84
84
  checks Creates an HTML report of all implemented security checks.
85
85
  version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
86
86
 
87
- Use the Codeaudit documentation to check the security of Python programs and make your Python programs more secure!
88
- Check https://simplifysecurity.nocomplexity.com/
87
+ Use the Python Code Audit documentation (https://codeaudit.nocomplexity.com) to audit and secure your Python programmes. Explore further essential open-source security tools at https://simplifysecurity.nocomplexity.com/
89
88
  ```
90
89
 
91
90
  ## Example
@@ -4,8 +4,22 @@ Great that you want to contribute!
4
4
 
5
5
  :::{tip}
6
6
  All contributions are welcome!
7
-
8
7
  Think of corrections on the manual, code and more or better tests.
8
+
9
+ +++
10
+
11
+ Not a coder? Not a problem! **Python Code Audit** is multifaceted, so I always can use help.
12
+ These are all activities we’d like to get help with :
13
+ - Writing and improving the documentation
14
+ - Code maintenance and development
15
+ - Community coordination
16
+ - Advocating Python secure programming
17
+ - Developing educational content
18
+ - Fundraising
19
+ - Marketing
20
+ - Project management
21
+ - Translating content
22
+ - Website design and development
9
23
  :::
10
24
 
11
25
  The **Codeaudit** code repository is hosted at [Github](https://github.com/nocomplexity/codeaudit).
@@ -67,6 +67,8 @@ parts:
67
67
  - file: apidocs/api_intro
68
68
  sections:
69
69
  - file: examples/ca_api_example_overview
70
+ - file: examples/ca_api_example_checks
71
+ - file: examples/ca_api_example_scanning
70
72
  - file: examples/ca_api_example_json
71
73
  - file: examples/ca_api_example_basic
72
74
  - file: apidocs/modules
@@ -0,0 +1,26 @@
1
+ # APIs and Examples
2
+
3
+ The Python Code Audit APIs empower you to build your own Python security tools or create seamless integrations you need! Leverage our standardized JSON output to enhance your development workflow in the following ways:
4
+
5
+ * **Automated Scanning**: Perform deep security analysis on local files, directories, or PyPI.org packages. Use the structured JSON output to trigger custom logic or automated remediation.
6
+
7
+ +++
8
+
9
+ * **Custom Reporting & Dashboards**: Transform audit results into visual insights. The human-readable JSON export makes it easy to feed data into custom monitoring dashboards or BI tools.
10
+
11
+ +++
12
+
13
+
14
+ * **Security Statistical Analysis**: Identify trends and recurring vulnerabilities. Use the APIs to study security weaknesses across your organization’s entire Python ecosystem to improve coding standards.
15
+
16
+ +++
17
+
18
+
19
+ * **Seamless CI/CD Integration**: Embed security audits directly into your deployment pipelines. The APIs fully support remote source control systems, including GitHub, GitLab, [Codeberg](https://codeberg.org/), [NotABug](https://notabug.org/), and other Git-based platforms.
20
+
21
+ ## Getting Started
22
+ We have provided several practical examples to help you implement these APIs effectively and secure your codebase with minimal friction.
23
+
24
+
25
+ ```{tableofcontents}
26
+ ```
@@ -0,0 +1,230 @@
1
+ % THIS FILE IS GENERATED! - Use CLIcommands.ipynb to make it better!
2
+ # Commands Overview
3
+ Python Code Audit commands for: version: 1.4.2
4
+ ```
5
+ ----------------------------------------------------
6
+ _ __ _
7
+ |_) \/_|_|_ _ __ / _ _| _ |_| _| o _|_
8
+ | / |_| |(_)| | \__(_)(_|(/_ | ||_|(_| | |_
9
+ ----------------------------------------------------
10
+
11
+ Python Code Audit - A modern Python security source code analyzer based on distrust.
12
+
13
+ Commands to evaluate Python source code:
14
+ Usage: codeaudit COMMAND <directory|package> [report.html]
15
+
16
+ Depending on the command, you must specify a local directory, a Python file, or a package name hosted on PyPI.org.Reporting: The results are generated as a static HTML report for viewing in a web browser.
17
+
18
+ Commands:
19
+ overview Generates an overview report of code complexity and security indicators.
20
+ filescan Scans Python source code or PyPI packages for security weaknesses.
21
+ modulescan Generates a vulnerability report for imported Python modules.
22
+ checks Creates an HTML report of all implemented security checks.
23
+ version Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].
24
+
25
+ Use the Python Code Audit documentation (https://codeaudit.nocomplexity.com) to audit and secure your Python programmes. Explore further essential open-source security tools at https://simplifysecurity.nocomplexity.com/
26
+
27
+ ```
28
+ ## codeaudit overview
29
+ ```text
30
+ Generates an overview report of code complexity and security indicators.
31
+
32
+ This function analyzes a Python project to produce a high-level overview of
33
+ complexity and security-related metrics. The input may be either:
34
+
35
+ - A local directory containing Python source files
36
+ - The name of a package hosted on PyPI.org
37
+
38
+ For PyPI packages, the source distribution (sdist) is downloaded,
39
+ extracted to a temporary directory, scanned, and removed after the report
40
+ is generated.
41
+
42
+ The report includes summary statistics, security risk indicators based on
43
+ complexity and total lines of code, a list of discovered modules, per-file
44
+ metrics, and a visual overview. Results are written to a static HTML file.
45
+
46
+ Examples:
47
+ Generate an overview report for a local project directory::
48
+
49
+ codeaudit overview /projects/mycolleaguesproject
50
+
51
+ Generate an overview report for a PyPI package::
52
+
53
+ codeaudit overview linkaudit #A nice project on PyPI.org
54
+
55
+ codeaudit overview pydantic #A complex project on PyPI.org from a security perspective?
56
+
57
+ Args:
58
+ directory (str): Path to a local directory containing Python source files
59
+ or the name of a package available on PyPI.org.
60
+ filename (str, optional): Name (and optional path) of the HTML file to
61
+ write the overview report to. The filename should use the ``.html``
62
+ extension. Defaults to ``DEFAULT_OUTPUT_FILE``.
63
+
64
+ Returns:
65
+ None. The function writes a static HTML overview report to disk.
66
+
67
+ Raises:
68
+ SystemExit: If the provided path is not a directory, contains no Python
69
+ files, or is neither a valid local directory nor a valid PyPI
70
+ package name.
71
+ str(object='') -> str
72
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
73
+
74
+ Create a new string object from the given object. If encoding or
75
+ errors is specified, then the object must expose a data buffer
76
+ that will be decoded using the given encoding and error handler.
77
+ Otherwise, returns the result of object.__str__() (if defined)
78
+ or repr(object).
79
+ encoding defaults to 'utf-8'.
80
+ errors defaults to 'strict'.
81
+ ```
82
+ ## codeaudit modulescan
83
+ ```text
84
+ Generates a vulnerability report for imported Python modules.
85
+
86
+ This function analyzes a single Python source file to identify imported
87
+ modules and checks externally imported modules against the OSV vulnerability
88
+ database. The results are compiled into a static HTML report.
89
+
90
+ For each detected external module, the report indicates whether known
91
+ vulnerability information exists and, if available, includes detailed
92
+ vulnerability data.
93
+
94
+ Progress information is printed to stdout while processing modules.
95
+
96
+ Example:
97
+ Generate a module vulnerability report for a Python file::
98
+
99
+ codeaudit modulescan mypythonfile.py
100
+
101
+ Args:
102
+ inputfile (str): Path to the Python source file to analyze.
103
+ reportname (str, optional): Name (and optional path) of the HTML file
104
+ to write the module vulnerability report to. The filename should
105
+ use the ``.html`` extension. Defaults to ``DEFAULT_OUTPUT_FILE``.
106
+
107
+ Returns:
108
+ None. The function writes a static HTML report to disk.
109
+
110
+ Raises:
111
+ None explicitly. File reading errors or invalid input are reported
112
+ via standard output.
113
+
114
+ str(object='') -> str
115
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
116
+
117
+ Create a new string object from the given object. If encoding or
118
+ errors is specified, then the object must expose a data buffer
119
+ that will be decoded using the given encoding and error handler.
120
+ Otherwise, returns the result of object.__str__() (if defined)
121
+ or repr(object).
122
+ encoding defaults to 'utf-8'.
123
+ errors defaults to 'strict'.
124
+ ```
125
+ ## codeaudit filescan
126
+ ```text
127
+ Scans Python source code or PyPI packages for security weaknesses.
128
+
129
+ This function performs static application security testing (SAST) on a
130
+ given input, which can be:
131
+
132
+ - A local directory containing Python source code
133
+ - A single local Python file
134
+ - A package name hosted on PyPI.org
135
+
136
+ Depending on the input type, the function analyzes the source code for
137
+ potential security issues, generates an HTML report summarizing the
138
+ findings, and writes the report to a static HTML file.
139
+
140
+ If a PyPI package name is provided, the function downloads the source
141
+ distribution (sdist), scans the extracted source code, and removes all
142
+ temporary files after the scan completes.
143
+
144
+ Example:
145
+ Scan a local directory and write the report to ``report.html``::
146
+
147
+ codeaudit filescan_/shitwork/custompythonmodule/
148
+
149
+ Scan a single Python file::
150
+
151
+ codeaudit filescan myexample.py
152
+
153
+ Scan a package hosted on PyPI::
154
+
155
+ codeaudit filescan linkaudit #A nice project to check broken links in markdown files
156
+
157
+ codeaudit filescan requests
158
+
159
+ Args:
160
+ input_path (str): Path to a local Python file or directory, or the name
161
+ of a package available on PyPI.org.
162
+ filename (str, optional): Name (and optional path) of the HTML file to
163
+ write the scan report to. The filename should use the ``.html``
164
+ extension. Defaults to ``DEFAULT_OUTPUT_FILE``.
165
+
166
+ Returns:
167
+ None. The function writes a static HTML security report to disk.
168
+
169
+ Raises:
170
+ None explicitly. Errors and invalid inputs are reported to stdout.
171
+ str(object='') -> str
172
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
173
+
174
+ Create a new string object from the given object. If encoding or
175
+ errors is specified, then the object must expose a data buffer
176
+ that will be decoded using the given encoding and error handler.
177
+ Otherwise, returns the result of object.__str__() (if defined)
178
+ or repr(object).
179
+ encoding defaults to 'utf-8'.
180
+ errors defaults to 'strict'.
181
+ ```
182
+ ## codeaudit checks
183
+ ```text
184
+
185
+ Creates an HTML report of all implemented security checks.
186
+
187
+ This report provides a user-friendly overview of the static security checks
188
+ currently supported by Python Code Audit. It is intended to make it easier to review
189
+ the available validations without digging through the codebase.
190
+
191
+ The generated HTML includes:
192
+ - A table of all implemented checks
193
+ - The number of validations
194
+ - The version of Python Code Audit (codeaudit) used
195
+ - A disclaimer about version-specific reporting
196
+
197
+ The report is saved to the specified filename and is formatted to be
198
+ embeddable in larger multi-report documents.
199
+
200
+ Help me continue developing Python Code Audit as free and open-source software.
201
+ Join the community to contribute to the most complete, local first , Python Security Static scanner.
202
+ Help!! Join the journey, check: https://github.com/nocomplexity/codeaudit#contributing
203
+
204
+
205
+ Parameters:
206
+ filename (str): The output HTML filename. Defaults to 'codeaudit_checks.html'.
207
+ str(object='') -> str
208
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
209
+
210
+ Create a new string object from the given object. If encoding or
211
+ errors is specified, then the object must expose a data buffer
212
+ that will be decoded using the given encoding and error handler.
213
+ Otherwise, returns the result of object.__str__() (if defined)
214
+ or repr(object).
215
+ encoding defaults to 'utf-8'.
216
+ errors defaults to 'strict'.
217
+ ```
218
+ ## codeaudit version
219
+ ```text
220
+ Prints the module version. Or use codeaudit [-v] [--v] [-version] or [--version].str(object='') -> str
221
+ str(bytes_or_buffer[, encoding[, errors]]) -> str
222
+
223
+ Create a new string object from the given object. If encoding or
224
+ errors is specified, then the object must expose a data buffer
225
+ that will be decoded using the given encoding and error handler.
226
+ Otherwise, returns the result of object.__str__() (if defined)
227
+ or repr(object).
228
+ encoding defaults to 'utf-8'.
229
+ errors defaults to 'strict'.
230
+ ```