codeanalyzer-python 0.1.5__tar.gz → 0.1.7__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 (27) hide show
  1. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/PKG-INFO +3 -3
  2. codeanalyzer_python-0.1.7/codeanalyzer/__init__.py +5 -0
  3. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/__main__.py +3 -8
  4. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/core.py +2 -2
  5. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/syntactic_analysis/symbol_table_builder.py +3 -1
  6. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/pyproject.toml +4 -4
  7. codeanalyzer_python-0.1.5/codeanalyzer/syntactic_analysis/__init__.py +0 -0
  8. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/.gitignore +0 -0
  9. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/LICENSE +0 -0
  10. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/NOTICE +0 -0
  11. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/README.md +0 -0
  12. {codeanalyzer_python-0.1.5/codeanalyzer → codeanalyzer_python-0.1.7/codeanalyzer/jedi}/__init__.py +0 -0
  13. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/jedi/jedi.py +0 -0
  14. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/py.typed +0 -0
  15. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/schema/__init__.py +0 -0
  16. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/schema/py_schema.py +0 -0
  17. {codeanalyzer_python-0.1.5/codeanalyzer/jedi → codeanalyzer_python-0.1.7/codeanalyzer/semantic_analysis}/__init__.py +0 -0
  18. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/semantic_analysis/codeql/__init__.py +0 -0
  19. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/semantic_analysis/codeql/codeql_analysis.py +0 -0
  20. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/semantic_analysis/codeql/codeql_exceptions.py +0 -0
  21. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/semantic_analysis/codeql/codeql_loader.py +0 -0
  22. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/semantic_analysis/codeql/codeql_query_runner.py +0 -0
  23. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/semantic_analysis/wala/__init__.py +0 -0
  24. {codeanalyzer_python-0.1.5/codeanalyzer/semantic_analysis → codeanalyzer_python-0.1.7/codeanalyzer/syntactic_analysis}/__init__.py +0 -0
  25. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/utils/__init__.py +0 -0
  26. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/utils/logging.py +0 -0
  27. {codeanalyzer_python-0.1.5 → codeanalyzer_python-0.1.7}/codeanalyzer/utils/progress_bar.py +0 -0
@@ -1,15 +1,15 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeanalyzer-python
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: Static Analysis on Python source code using Jedi, CodeQL and Treesitter.
5
5
  Author-email: Rahul Krishna <i.m.ralk@gmail.com>
6
6
  License-File: LICENSE
7
7
  License-File: NOTICE
8
- Requires-Python: >=3.12
8
+ Requires-Python: >=3.10
9
9
  Requires-Dist: jedi>=0.19.2
10
10
  Requires-Dist: loguru>=0.7.3
11
11
  Requires-Dist: msgpack>=1.1.1
12
- Requires-Dist: networkx>=3.5
12
+ Requires-Dist: networkx>=3.4.2
13
13
  Requires-Dist: pandas>=2.3.1
14
14
  Requires-Dist: pydantic>=2.11.7
15
15
  Requires-Dist: requests>=2.32.4
@@ -0,0 +1,5 @@
1
+ """Python code analyzer library."""
2
+
3
+ from codeanalyzer.core import Codeanalyzer
4
+
5
+ __all__ = ["Codeanalyzer"]
@@ -1,16 +1,11 @@
1
1
  from pathlib import Path
2
2
  from typing import Annotated, Optional
3
- from enum import Enum
4
3
 
5
4
  import typer
6
5
 
7
- from codeanalyzer.core import AnalyzerCore
6
+ from codeanalyzer.core import Codeanalyzer
8
7
  from codeanalyzer.utils import _set_log_level, logger
9
-
10
-
11
- class OutputFormat(str, Enum):
12
- JSON = "json"
13
- MSGPACK = "msgpack"
8
+ from codeanalyzer.config import OutputFormat
14
9
 
15
10
 
16
11
  def main(
@@ -67,7 +62,7 @@ def main(
67
62
  logger.error(f"Input path '{input}' does not exist.")
68
63
  raise typer.Exit(code=1)
69
64
 
70
- with AnalyzerCore(
65
+ with Codeanalyzer(
71
66
  input, analysis_level, using_codeql, rebuild_analysis, cache_dir, clear_cache
72
67
  ) as analyzer:
73
68
  artifacts = analyzer.analyze()
@@ -13,7 +13,7 @@ from codeanalyzer.syntactic_analysis.symbol_table_builder import SymbolTableBuil
13
13
  from codeanalyzer.utils import logger
14
14
 
15
15
 
16
- class AnalyzerCore:
16
+ class Codeanalyzer:
17
17
  """Core functionality for CodeQL analysis.
18
18
 
19
19
  Args:
@@ -196,7 +196,7 @@ class AnalyzerCore:
196
196
  f"a working Python interpreter that can create virtual environments."
197
197
  )
198
198
 
199
- def __enter__(self) -> "AnalyzerCore":
199
+ def __enter__(self) -> "Codeanalyzer":
200
200
  # If no virtualenv is provided, try to create one using requirements.txt or pyproject.toml
201
201
  venv_path = self.cache_dir / self.project_dir.name / "virtualenv"
202
202
  # Ensure the cache directory exists for this project
@@ -503,7 +503,9 @@ class SymbolTableBuilder:
503
503
 
504
504
  return params
505
505
 
506
- def _accessed_symbols(self, fn_node: ast.FunctionDef, script: Script) -> List[str]:
506
+ def _accessed_symbols(
507
+ self, fn_node: ast.FunctionDef, script: Script
508
+ ) -> List[PySymbol]:
507
509
  """Analyzes the function body to extract all accessed symbols."""
508
510
  symbols = []
509
511
  for node in ast.walk(fn_node):
@@ -1,18 +1,18 @@
1
1
  [project]
2
2
  name = "codeanalyzer-python"
3
- version = "0.1.5"
3
+ version = "0.1.7"
4
4
  description = "Static Analysis on Python source code using Jedi, CodeQL and Treesitter."
5
5
  readme = "README.md"
6
6
  authors = [
7
7
  { name = "Rahul Krishna", email = "i.m.ralk@gmail.com" }
8
8
  ]
9
- requires-python = ">=3.12"
9
+ requires-python = ">=3.10"
10
10
 
11
11
  dependencies = [
12
12
  "jedi>=0.19.2",
13
13
  "loguru>=0.7.3",
14
14
  "msgpack>=1.1.1",
15
- "networkx>=3.5",
15
+ "networkx>=3.4.2",
16
16
  "pandas>=2.3.1",
17
17
  "pydantic>=2.11.7",
18
18
  "requests>=2.32.4",
@@ -86,4 +86,4 @@ exclude_lines = [
86
86
  ]
87
87
 
88
88
  [tool.coverage.html]
89
- directory = "htmlcov"
89
+ directory = "htmlcov"