codeanalyzer-python 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl

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.
@@ -1,42 +1,38 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeanalyzer-python
3
- Version: 0.1.2
3
+ Version: 0.1.4
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
8
  Requires-Python: >=3.12
9
- Requires-Dist: asteroid>=0.7.0
10
9
  Requires-Dist: astor>=0.8.1
11
10
  Requires-Dist: jedi>=0.19.2
12
11
  Requires-Dist: loguru>=0.7.3
12
+ Requires-Dist: msgpack>=1.1.1
13
13
  Requires-Dist: networkx>=3.5
14
- Requires-Dist: pandas>=2.3.0
14
+ Requires-Dist: pandas>=2.3.1
15
15
  Requires-Dist: pydantic>=2.11.7
16
16
  Requires-Dist: requests>=2.32.4
17
17
  Requires-Dist: rich>=14.0.0
18
- Requires-Dist: ruff>=0.12.2
19
- Requires-Dist: toml>=0.10.2
20
18
  Requires-Dist: typer>=0.16.0
21
19
  Description-Content-Type: text/markdown
22
20
 
23
- ![logo](./docs/assets/logo.png)
21
+ ![logo](https://github.com/codellm-devkit/codeanalyzer-python/blob/main/docs/assets/logo.png?raw=true)
24
22
 
25
- Python Static Analysis Backend for CLDK
23
+ # A Python Static Analysis Toolkit (and Library)
26
24
 
27
25
  A comprehensive static analysis tool for Python source code that provides symbol table generation, call graph analysis, and semantic analysis using Jedi, CodeQL, and Tree-sitter.
28
26
 
29
27
  ## Installation
30
28
 
31
- This project uses [uv](https://docs.astral.sh/uv/) for dependency management.
29
+ ```bash
30
+ pip install codeanalyzer-python
31
+ ```
32
32
 
33
33
  ### Prerequisites
34
34
 
35
- - [uv](https://docs.astral.sh/uv/getting-started/installation/) installed
36
- - Python 3.12 or higher. You can use `uv` to install Python if it's not already installed:
37
- ```bash
38
- uv python install 3.12
39
- ```
35
+ - Python 3.12 or higher
40
36
 
41
37
  #### System Package Requirements
42
38
 
@@ -78,20 +74,6 @@ pyenv global 3.12.0 # or pyenv local 3.12.0 for project-specific
78
74
 
79
75
  > **Note:** These packages are required as the tool uses Python's built-in `venv` module to create isolated environments for analysis.
80
76
 
81
- ### Setup
82
-
83
- 1. Clone the repository:
84
- ```bash
85
- git clone https://github.com/codellm-devkit/codeanalyzer-python
86
- cd codeanalyzer-python
87
- ```
88
-
89
- 2. Install dependencies using uv:
90
- ```bash
91
- uv sync --all-groups
92
- ```
93
- This will install all dependencies including development and test dependencies.
94
-
95
77
  ## Usage
96
78
 
97
79
  The codeanalyzer provides a command-line interface for performing static analysis on Python projects.
@@ -99,15 +81,15 @@ The codeanalyzer provides a command-line interface for performing static analysi
99
81
  ### Basic Usage
100
82
 
101
83
  ```bash
102
- uv run codeanalyzer --input /path/to/python/project
84
+ codeanalyzer --input /path/to/python/project
103
85
  ```
104
86
 
105
87
  ### Command Line Options
106
88
 
107
- To view the available options and commands, run `uv run codeanalyzer --help`. You should see output similar to the following:
89
+ To view the available options and commands, run `codeanalyzer --help`. You should see output similar to the following:
108
90
 
109
91
  ```bash
110
- uv run codeanalyzer --help
92
+ ❯ codeanalyzer --help
111
93
 
112
94
  Usage: codeanalyzer [OPTIONS] COMMAND [ARGS]...
113
95
 
@@ -131,38 +113,38 @@ To view the available options and commands, run `uv run codeanalyzer --help`. Yo
131
113
 
132
114
  1. **Basic analysis with symbol table:**
133
115
  ```bash
134
- uv run codeanalyzer --input ./my-python-project
116
+ codeanalyzer --input ./my-python-project
135
117
  ```
136
118
 
137
119
  This will print the symbol table to stdout in JSON format to the standard output. If you want to save the output, you can use the `--output` option.
138
120
 
139
121
  ```bash
140
- uv run codeanalyzer --input ./my-python-project --output /path/to/analysis-results
122
+ codeanalyzer --input ./my-python-project --output /path/to/analysis-results
141
123
  ```
142
124
 
143
125
  Now, you can find the analysis results in `analysis.json` in the specified directory.
144
126
 
145
127
  2. **Toggle analysis levels with `--analysis-level`:**
146
128
  ```bash
147
- uv run codeanalyzer --input ./my-python-project --analysis-level 1 # Symbol table only
129
+ codeanalyzer --input ./my-python-project --analysis-level 1 # Symbol table only
148
130
  ```
149
131
  Call graph analysis can be enabled by setting the level to `2`:
150
132
  ```bash
151
- uv run codeanalyzer --input ./my-python-project --analysis-level 2 # Symbol table + Call graph
133
+ codeanalyzer --input ./my-python-project --analysis-level 2 # Symbol table + Call graph
152
134
  ```
153
135
  ***Note: The `--analysis-level=2` is not yet implemented in this version.***
154
136
 
155
137
  3. **Analysis with CodeQL enabled:**
156
138
  ```bash
157
- uv run codeanalyzer --input ./my-python-project --codeql
139
+ codeanalyzer --input ./my-python-project --codeql
158
140
  ```
159
- This will perform CodeQL-based analysis in addition to the standard symbol table generation.
160
-
141
+ This will perform CodeQL-based analysis in addition to the standard symbol table generation.
142
+
161
143
  ***Note: Not yet fully implemented. Please refrain from using this option until further notice.***
162
144
 
163
145
  4. **Eager analysis with custom cache directory:**
164
146
  ```bash
165
- uv run codeanalyzer --input ./my-python-project --eager --cache-dir /path/to/custom-cache
147
+ codeanalyzer --input ./my-python-project --eager --cache-dir /path/to/custom-cache
166
148
  ```
167
149
  This will rebuild the analysis cache at every run and store it in `/path/to/custom-cache/.codeanalyzer`. The cache will be cleared by default after analysis unless you specify `--keep-cache`.
168
150
 
@@ -170,7 +152,7 @@ To view the available options and commands, run `uv run codeanalyzer --help`. Yo
170
152
 
171
153
  5. **Quiet mode (minimal output):**
172
154
  ```bash
173
- uv run codeanalyzer --input /path/to/my-python-project --quiet
155
+ codeanalyzer --input /path/to/my-python-project --quiet
174
156
  ```
175
157
 
176
158
  ### Output
@@ -179,10 +161,36 @@ By default, analysis results are printed to stdout in JSON format. When using th
179
161
 
180
162
  ## Development
181
163
 
164
+ This project uses [uv](https://docs.astral.sh/uv/) for dependency management during development.
165
+
166
+ ### Development Setup
167
+
168
+ 1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
169
+
170
+ 2. Clone the repository:
171
+ ```bash
172
+ git clone https://github.com/codellm-devkit/codeanalyzer-python
173
+ cd codeanalyzer-python
174
+ ```
175
+
176
+ 3. Install dependencies using uv:
177
+ ```bash
178
+ uv sync --all-groups
179
+ ```
180
+ This will install all dependencies including development and test dependencies.
181
+
182
+ ### Running from Source
183
+
184
+ When developing, you can run the tool directly from source:
185
+
186
+ ```bash
187
+ uv run codeanalyzer --input /path/to/python/project
188
+ ```
189
+
182
190
  ### Running Tests
183
191
 
184
192
  ```bash
185
- uv run pytest --pspec -s
193
+ uv run pytest --pspec -s
186
194
  ```
187
195
 
188
196
  ### Development Dependencies
@@ -0,0 +1,26 @@
1
+ codeanalyzer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ codeanalyzer/__main__.py,sha256=JD8jukEzozZQlKZ2Cz08dZgWCDnM1d3VnZdbCoA-v0s,3830
3
+ codeanalyzer/core.py,sha256=29LVfRmprj6Y-f4rzwmdZ9dWH_S22zLo0Uqm_E62c5I,12431
4
+ codeanalyzer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ codeanalyzer/jedi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ codeanalyzer/jedi/jedi.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ codeanalyzer/schema/__init__.py,sha256=bIwfGFvgqtNZ0mCAvDXSo9WVJHqhm15iZc7YOuWYSZ0,390
8
+ codeanalyzer/schema/py_schema.py,sha256=YFd0EtJkTOiOruaVkO_ibbzTktSPOvKDvsxqcI3n9J8,10471
9
+ codeanalyzer/semantic_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ codeanalyzer/semantic_analysis/codeql/__init__.py,sha256=ODMkdGvs3ebJdfIZle8T4VcHoCBhH_ZehWuWFpNh3NI,1022
11
+ codeanalyzer/semantic_analysis/codeql/codeql_analysis.py,sha256=-mVTm2JdQlfmV_9T4xLgjxwROKS83aP7lJAmQHh37xY,5312
12
+ codeanalyzer/semantic_analysis/codeql/codeql_exceptions.py,sha256=PnJOasW9rP68SEX158jSqQFdqjW_Q_Fx3vbH6vNiCQs,474
13
+ codeanalyzer/semantic_analysis/codeql/codeql_loader.py,sha256=o0BW-6yHkN6kLG66rOYQQ_ToQUn5Ivl9h9ZdBM3_E_Q,2288
14
+ codeanalyzer/semantic_analysis/codeql/codeql_query_runner.py,sha256=QJtID1YZkO6Wyns_qTJFqOSiV238ArLXwgLv105B27E,6520
15
+ codeanalyzer/semantic_analysis/wala/__init__.py,sha256=JSDvkrpJ2U90Ikex34EluSHmoGutlmRhV2xvInt6tB8,743
16
+ codeanalyzer/syntactic_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ codeanalyzer/syntactic_analysis/symbol_table_builder.py,sha256=kNNeLTw9Z24uDDTdDjWOgEiZ1JiWsZ4arSETvke44GU,36191
18
+ codeanalyzer/utils/__init__.py,sha256=hC6VWdR5rerSqBxzu9KQHTASWqwrrYJv-CMDwrTlzkc,137
19
+ codeanalyzer/utils/logging.py,sha256=0vTkGSl5EZN8yhhWa_5Mrn1n_twRCSW53rNwjzQ9RbI,601
20
+ codeanalyzer/utils/progress_bar.py,sha256=ZHJzGiCo5q4dyXq4CtsrJeq9Ip7sD84T3yZjNX7TBys,2443
21
+ codeanalyzer_python-0.1.4.dist-info/METADATA,sha256=rP6eR5doioj56UMBb_TkSXlPy2egh-ML3X4ydQ9mu6Q,7460
22
+ codeanalyzer_python-0.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ codeanalyzer_python-0.1.4.dist-info/entry_points.txt,sha256=eUrB7Jq5Oav6RblMX_RYfVLSw_h15NbzC3fNSnGsPuM,59
24
+ codeanalyzer_python-0.1.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
+ codeanalyzer_python-0.1.4.dist-info/licenses/NOTICE,sha256=YU0Z9NDWqKY-2jfFcbxeZ6fbnzz0oZeKmnUcO8a-bcQ,901
26
+ codeanalyzer_python-0.1.4.dist-info/RECORD,,
@@ -1,26 +0,0 @@
1
- codeanalyzer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- codeanalyzer/__main__.py,sha256=vfASpqZsadwzxNkdHIlqb6r6ERT7O_JlqEIP8KKg1Z4,2580
3
- codeanalyzer/core.py,sha256=fR6ffVc74IH-5kwGR4iqg4kNXFVoblXHVSDZ4Z__zQo,12521
4
- codeanalyzer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- codeanalyzer/jedi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- codeanalyzer/jedi/jedi.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- codeanalyzer/schema/__init__.py,sha256=YWGFbLLCOqc94VXA6NaBKKOKf7TBFbx_DyOgmWucZFQ,388
8
- codeanalyzer/schema/py_schema.py,sha256=xOvzmyv-3VHQAe5FtirM04bfD5ZKKs2jG011UiV7jH0,13148
9
- codeanalyzer/semantic_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- codeanalyzer/semantic_analysis/codeql/__init__.py,sha256=JYeyTli9aa-V1gpdGKdwr2e927G72_dgcUw25Pagt3o,1022
11
- codeanalyzer/semantic_analysis/codeql/codeql_analysis.py,sha256=zr3sXkKmBXyRUCRy2u6OZD1CXYRol8_D2p8cbX0NoXA,5324
12
- codeanalyzer/semantic_analysis/codeql/codeql_exceptions.py,sha256=PnJOasW9rP68SEX158jSqQFdqjW_Q_Fx3vbH6vNiCQs,474
13
- codeanalyzer/semantic_analysis/codeql/codeql_loader.py,sha256=GwPIItrzyuEIDuet9txgrgkP1yGO2vTsjTWBt6z1EWM,2689
14
- codeanalyzer/semantic_analysis/codeql/codeql_query_runner.py,sha256=fBNbdQhIH8vnHNYNHQgel2tVpowmXmP_Vi5qF4JL_cY,6519
15
- codeanalyzer/semantic_analysis/wala/__init__.py,sha256=JSDvkrpJ2U90Ikex34EluSHmoGutlmRhV2xvInt6tB8,743
16
- codeanalyzer/syntactic_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- codeanalyzer/syntactic_analysis/symbol_table_builder.py,sha256=b9IlM-WsCO_p2a0jUpHPHhf_XWpSvWmx6G-3oJgu75s,37026
18
- codeanalyzer/utils/__init__.py,sha256=Ipgq2cSoNgTMSi-BamJoIAWo_1LN2IyaYW4Ms1z-qnI,157
19
- codeanalyzer/utils/logging.py,sha256=UkSKx9IyBd7mCGcgXTR-PX-Rw-x_0tZDRRnwDyrGeuY,600
20
- codeanalyzer/utils/progress_bar.py,sha256=4BmrOVEzZt2rOvGNoP-j_8rCapDZU36VibUA8S7--9A,2442
21
- codeanalyzer_python-0.1.2.dist-info/METADATA,sha256=27Q1g78MrXf48H5qcJ9SPx8pWVOxY09gEY6EuuuzshE,7394
22
- codeanalyzer_python-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
- codeanalyzer_python-0.1.2.dist-info/entry_points.txt,sha256=eUrB7Jq5Oav6RblMX_RYfVLSw_h15NbzC3fNSnGsPuM,59
24
- codeanalyzer_python-0.1.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
- codeanalyzer_python-0.1.2.dist-info/licenses/NOTICE,sha256=YU0Z9NDWqKY-2jfFcbxeZ6fbnzz0oZeKmnUcO8a-bcQ,901
26
- codeanalyzer_python-0.1.2.dist-info/RECORD,,