py-flow-mapper 0.1.0b3.dev0__tar.gz → 0.1.0b4.dev0__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 (16) hide show
  1. {py_flow_mapper-0.1.0b3.dev0/src/py_flow_mapper.egg-info → py_flow_mapper-0.1.0b4.dev0}/PKG-INFO +1 -1
  2. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/setup.py +1 -1
  3. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/src/py_flow_mapper/__init__.py +1 -1
  4. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/src/py_flow_mapper/analyzer.py +24 -14
  5. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/src/py_flow_mapper/utils.py +30 -11
  6. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0/src/py_flow_mapper.egg-info}/PKG-INFO +1 -1
  7. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/LICENSE +0 -0
  8. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/README.md +0 -0
  9. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/setup.cfg +0 -0
  10. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/src/py_flow_mapper/cli.py +0 -0
  11. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/src/py_flow_mapper/mermaid_generator.py +0 -0
  12. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/src/py_flow_mapper.egg-info/SOURCES.txt +0 -0
  13. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/src/py_flow_mapper.egg-info/dependency_links.txt +0 -0
  14. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/src/py_flow_mapper.egg-info/entry_points.txt +0 -0
  15. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/src/py_flow_mapper.egg-info/requires.txt +0 -0
  16. {py_flow_mapper-0.1.0b3.dev0 → py_flow_mapper-0.1.0b4.dev0}/src/py_flow_mapper.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-flow-mapper
3
- Version: 0.1.0b3.dev0
3
+ Version: 0.1.0b4.dev0
4
4
  Summary: Python project analyzer and visualization tool
5
5
  Home-page: https://github.com/ArunKoundinya/py-flow-mapper
6
6
  Author: Arun Koundinya Parasa
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="py-flow-mapper",
8
- version="0.1.0b3.dev",
8
+ version="0.1.0b4.dev",
9
9
  author="Arun Koundinya Parasa",
10
10
  author_email="parasa.arunkoundinya@gmail.com",
11
11
  description="Python project analyzer and visualization tool",
@@ -2,7 +2,7 @@
2
2
  PyFlowMapper - A Python project analyzer and visualization tool.
3
3
  """
4
4
 
5
- __version__ = "0.1.0b3.dev"
5
+ __version__ = "0.1.0b4.dev"
6
6
  __author__ = "Arun Koundinya Parasa"
7
7
  __description__ = "Analyze Python projects and generate dependency graphs"
8
8
  __github__ = "https://github.com/ArunKoundinya/py-flow-mapper"
@@ -107,8 +107,24 @@ class ProjectAnalyzer:
107
107
  """Find all Python files in the project, excluding virtual environments and other unwanted directories."""
108
108
  python_files = []
109
109
 
110
- # Prefixes of directories to exclude
111
- exclude_prefixes = ('venv', '.venv', 'env', '.env', '__pycache__', '.git', 'node_modules')
110
+ # Prefixes of directories to exclude
111
+ exclude_prefixes = (
112
+ "venv", ".venv", "env", ".env", "virtualenv", ".virtualenv",
113
+ "__pycache__", ".mypy_cache", ".pytest_cache", ".ruff_cache",
114
+ ".coverage", "htmlcov", ".hypothesis",
115
+ ".git", ".hg", ".svn",
116
+ "build", "dist", ".eggs", "egg-info", "*.egg-info",
117
+ ".tox", ".nox", ".pdm-build",
118
+ "site-packages", "node_modules", "bower_components",
119
+ "docs", "doc", "site", "_site", "mkdocs",
120
+ ".ipynb_checkpoints", "notebooks", "examples", "experiments", "scratch",
121
+ "data", "datasets", "models", "checkpoints", "outputs", "results",
122
+ "logs", "tmp", "temp", "cache",
123
+ ".idea", ".vscode", ".DS_Store", "__MACOSX",
124
+ ".github", ".gitlab", ".circleci",
125
+ "tests", "test", "testing",
126
+ )
127
+
112
128
 
113
129
  for root, dirs, files in os.walk(self.base_path):
114
130
  # Filter out directories that start with any of the exclude prefixes
@@ -505,25 +521,19 @@ class DataFlowAnalyzer(ast.NodeVisitor):
505
521
 
506
522
  def visit_Assign(self, node):
507
523
  """Track assignments of function return values."""
508
- # Get the variable name being assigned to
509
- if isinstance(node.targets[0], ast.Name):
524
+ if node.targets and isinstance(node.targets[0], ast.Name):
510
525
  var_name = node.targets[0].id
511
-
512
- # Check if the value is a function call
526
+
513
527
  if isinstance(node.value, ast.Call):
514
528
  call_info = self._extract_call_info(node.value)
515
529
  if call_info:
516
- self.calls.append(call_info['func_name'])
517
- if var_name not in self.return_assignments:
518
- self.return_assignments[var_name] = []
519
- self.return_assignments[var_name].append(call_info['func_name'])
520
-
521
- # Check if the value is a Name (could be a variable holding a return value)
530
+ self.return_assignments.setdefault(var_name, []).append(call_info["func_name"])
531
+
522
532
  elif isinstance(node.value, ast.Name):
523
- # Track variable assignments for data flow
524
533
  pass
525
-
534
+
526
535
  self.generic_visit(node)
536
+
527
537
 
528
538
  def visit_Call(self, node):
529
539
  call_info = self._extract_call_info(node)
@@ -120,17 +120,36 @@ def load_json(file_path: Path) -> Any:
120
120
  def get_project_structure(base_path: Path, exclude_dirs: List[str] = None) -> Dict[str, Any]:
121
121
  """Get the project directory structure."""
122
122
  if exclude_dirs is None:
123
- exclude_dirs = ['venv', '.venv', '__pycache__', '.git', '.idea', '.vscode']
124
-
125
- structure = {}
126
-
127
- for item in sorted(base_path.iterdir()):
128
- if item.name in exclude_dirs:
123
+ exclude_dirs = [
124
+ "venv", ".venv", "env", ".env", "virtualenv",
125
+ "__pycache__", ".mypy_cache", ".pytest_cache", ".ruff_cache",
126
+ ".coverage", "htmlcov",
127
+ ".git", ".hg", ".svn",
128
+ ".idea", ".vscode", ".DS_Store", "__MACOSX",
129
+ "build", "dist", ".eggs", ".tox", ".nox",
130
+ "node_modules", "site-packages",
131
+ "docs", "doc", "notebooks", ".ipynb_checkpoints",
132
+ "models", "outputs", "results",
133
+ "logs", "tmp", "temp",
134
+ ]
135
+
136
+ exclude_set = set(exclude_dirs)
137
+ structure: Dict[str, Any] = {}
138
+
139
+ for item in sorted(base_path.iterdir(), key=lambda p: p.name):
140
+ name = item.name
141
+
142
+ # Unified exclusion logic (works for both files and dirs)
143
+ if (
144
+ name in exclude_set
145
+ or name.endswith(".egg-info") # e.g., mypkg.egg-info
146
+ or any(name.startswith(excl) for excl in exclude_set) # e.g., venv311, build_temp
147
+ ):
129
148
  continue
130
-
149
+
131
150
  if item.is_dir():
132
- structure[item.name] = get_project_structure(item, exclude_dirs)
151
+ structure[name] = get_project_structure(item, exclude_dirs)
133
152
  else:
134
- structure[item.name] = 'file'
135
-
136
- return structure
153
+ structure[name] = "file"
154
+
155
+ return structure
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-flow-mapper
3
- Version: 0.1.0b3.dev0
3
+ Version: 0.1.0b4.dev0
4
4
  Summary: Python project analyzer and visualization tool
5
5
  Home-page: https://github.com/ArunKoundinya/py-flow-mapper
6
6
  Author: Arun Koundinya Parasa