code-node-graph 0.1.0__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 (186) hide show
  1. code_node_graph-0.1.0/.gitignore +220 -0
  2. code_node_graph-0.1.0/CHANGELOG.md +157 -0
  3. code_node_graph-0.1.0/LICENSE +201 -0
  4. code_node_graph-0.1.0/PKG-INFO +165 -0
  5. code_node_graph-0.1.0/README.md +135 -0
  6. code_node_graph-0.1.0/examples/books-api/README.md +13 -0
  7. code_node_graph-0.1.0/examples/cart-service/README.md +13 -0
  8. code_node_graph-0.1.0/examples/orders-service/README.md +4 -0
  9. code_node_graph-0.1.0/pyproject.toml +74 -0
  10. code_node_graph-0.1.0/src/code_node/__init__.py +40 -0
  11. code_node_graph-0.1.0/src/code_node/__main__.py +7 -0
  12. code_node_graph-0.1.0/src/code_node/analysis/__init__.py +3 -0
  13. code_node_graph-0.1.0/src/code_node/analysis/aws_model.py +197 -0
  14. code_node_graph-0.1.0/src/code_node/analysis/findings.py +462 -0
  15. code_node_graph-0.1.0/src/code_node/analysis/graph.py +780 -0
  16. code_node_graph-0.1.0/src/code_node/analysis/mapping.py +114 -0
  17. code_node_graph-0.1.0/src/code_node/analysis/model.py +289 -0
  18. code_node_graph-0.1.0/src/code_node/analysis/reader.py +1926 -0
  19. code_node_graph-0.1.0/src/code_node/analysis/syntax.py +220 -0
  20. code_node_graph-0.1.0/src/code_node/analysis/terms.py +505 -0
  21. code_node_graph-0.1.0/src/code_node/cli.py +316 -0
  22. code_node_graph-0.1.0/src/code_node/deploys/__init__.py +321 -0
  23. code_node_graph-0.1.0/src/code_node/deploys/sam.py +371 -0
  24. code_node_graph-0.1.0/src/code_node/deploys/serverless.py +117 -0
  25. code_node_graph-0.1.0/src/code_node/kit/__init__.py +4 -0
  26. code_node_graph-0.1.0/src/code_node/kit/blocks.py +184 -0
  27. code_node_graph-0.1.0/src/code_node/kit/fmt.py +389 -0
  28. code_node_graph-0.1.0/src/code_node/kit/highlight.py +131 -0
  29. code_node_graph-0.1.0/src/code_node/kit/render.py +1066 -0
  30. code_node_graph-0.1.0/src/code_node/kit/text.py +81 -0
  31. code_node_graph-0.1.0/src/code_node/libraries/__init__.py +333 -0
  32. code_node_graph-0.1.0/src/code_node/libraries/llm.py +124 -0
  33. code_node_graph-0.1.0/src/code_node/libraries/mongo.py +169 -0
  34. code_node_graph-0.1.0/src/code_node/libraries/redis.py +253 -0
  35. code_node_graph-0.1.0/src/code_node/libraries/sql.py +232 -0
  36. code_node_graph-0.1.0/src/code_node/pages.py +92 -0
  37. code_node_graph-0.1.0/src/code_node/platforms/__init__.py +203 -0
  38. code_node_graph-0.1.0/src/code_node/platforms/aws_lambda.py +290 -0
  39. code_node_graph-0.1.0/src/code_node/platforms/web.py +301 -0
  40. code_node_graph-0.1.0/src/code_node/project.py +402 -0
  41. code_node_graph-0.1.0/src/code_node/report/__init__.py +3 -0
  42. code_node_graph-0.1.0/src/code_node/report/brands.py +244 -0
  43. code_node_graph-0.1.0/src/code_node/report/build.py +119 -0
  44. code_node_graph-0.1.0/src/code_node/report/editor.py +40 -0
  45. code_node_graph-0.1.0/src/code_node/report/graph.py +1411 -0
  46. code_node_graph-0.1.0/src/code_node/report/logos/README.md +8 -0
  47. code_node_graph-0.1.0/src/code_node/report/logos/anthropic-icon.svg +1 -0
  48. code_node_graph-0.1.0/src/code_node/report/logos/aws-amplify.svg +1 -0
  49. code_node_graph-0.1.0/src/code_node/report/logos/aws-api-gateway.svg +1 -0
  50. code_node_graph-0.1.0/src/code_node/report/logos/aws-appflow.svg +1 -0
  51. code_node_graph-0.1.0/src/code_node/report/logos/aws-appsync.svg +1 -0
  52. code_node_graph-0.1.0/src/code_node/report/logos/aws-athena.svg +1 -0
  53. code_node_graph-0.1.0/src/code_node/report/logos/aws-backup.svg +1 -0
  54. code_node_graph-0.1.0/src/code_node/report/logos/aws-batch.svg +1 -0
  55. code_node_graph-0.1.0/src/code_node/report/logos/aws-certificate-manager.svg +1 -0
  56. code_node_graph-0.1.0/src/code_node/report/logos/aws-cloudformation.svg +1 -0
  57. code_node_graph-0.1.0/src/code_node/report/logos/aws-cloudfront.svg +1 -0
  58. code_node_graph-0.1.0/src/code_node/report/logos/aws-cloudtrail.svg +1 -0
  59. code_node_graph-0.1.0/src/code_node/report/logos/aws-cloudwatch.svg +1 -0
  60. code_node_graph-0.1.0/src/code_node/report/logos/aws-codebuild.svg +1 -0
  61. code_node_graph-0.1.0/src/code_node/report/logos/aws-codecommit.svg +1 -0
  62. code_node_graph-0.1.0/src/code_node/report/logos/aws-codedeploy.svg +1 -0
  63. code_node_graph-0.1.0/src/code_node/report/logos/aws-codepipeline.svg +1 -0
  64. code_node_graph-0.1.0/src/code_node/report/logos/aws-cognito.svg +1 -0
  65. code_node_graph-0.1.0/src/code_node/report/logos/aws-config.svg +1 -0
  66. code_node_graph-0.1.0/src/code_node/report/logos/aws-documentdb.svg +1 -0
  67. code_node_graph-0.1.0/src/code_node/report/logos/aws-dynamodb.svg +1 -0
  68. code_node_graph-0.1.0/src/code_node/report/logos/aws-ec2.svg +1 -0
  69. code_node_graph-0.1.0/src/code_node/report/logos/aws-ecs.svg +1 -0
  70. code_node_graph-0.1.0/src/code_node/report/logos/aws-eks.svg +1 -0
  71. code_node_graph-0.1.0/src/code_node/report/logos/aws-elasticache.svg +1 -0
  72. code_node_graph-0.1.0/src/code_node/report/logos/aws-elb.svg +1 -0
  73. code_node_graph-0.1.0/src/code_node/report/logos/aws-eventbridge.svg +1 -0
  74. code_node_graph-0.1.0/src/code_node/report/logos/aws-glacier.svg +1 -0
  75. code_node_graph-0.1.0/src/code_node/report/logos/aws-glue.svg +1 -0
  76. code_node_graph-0.1.0/src/code_node/report/logos/aws-iam.svg +1 -0
  77. code_node_graph-0.1.0/src/code_node/report/logos/aws-keyspaces.svg +1 -0
  78. code_node_graph-0.1.0/src/code_node/report/logos/aws-kinesis.svg +1 -0
  79. code_node_graph-0.1.0/src/code_node/report/logos/aws-kms.svg +1 -0
  80. code_node_graph-0.1.0/src/code_node/report/logos/aws-lake-formation.svg +1 -0
  81. code_node_graph-0.1.0/src/code_node/report/logos/aws-lambda.svg +1 -0
  82. code_node_graph-0.1.0/src/code_node/report/logos/aws-lightsail.svg +1 -0
  83. code_node_graph-0.1.0/src/code_node/report/logos/aws-mq.svg +1 -0
  84. code_node_graph-0.1.0/src/code_node/report/logos/aws-msk.svg +1 -0
  85. code_node_graph-0.1.0/src/code_node/report/logos/aws-neptune.svg +1 -0
  86. code_node_graph-0.1.0/src/code_node/report/logos/aws-open-search.svg +1 -0
  87. code_node_graph-0.1.0/src/code_node/report/logos/aws-quicksight.svg +1 -0
  88. code_node_graph-0.1.0/src/code_node/report/logos/aws-rds.svg +1 -0
  89. code_node_graph-0.1.0/src/code_node/report/logos/aws-redshift.svg +1 -0
  90. code_node_graph-0.1.0/src/code_node/report/logos/aws-route53.svg +1 -0
  91. code_node_graph-0.1.0/src/code_node/report/logos/aws-s3.svg +1 -0
  92. code_node_graph-0.1.0/src/code_node/report/logos/aws-secrets-manager.svg +1 -0
  93. code_node_graph-0.1.0/src/code_node/report/logos/aws-ses.svg +1 -0
  94. code_node_graph-0.1.0/src/code_node/report/logos/aws-shield.svg +1 -0
  95. code_node_graph-0.1.0/src/code_node/report/logos/aws-sns.svg +1 -0
  96. code_node_graph-0.1.0/src/code_node/report/logos/aws-sqs.svg +1 -0
  97. code_node_graph-0.1.0/src/code_node/report/logos/aws-step-functions.svg +1 -0
  98. code_node_graph-0.1.0/src/code_node/report/logos/aws-systems-manager.svg +1 -0
  99. code_node_graph-0.1.0/src/code_node/report/logos/aws-timestream.svg +1 -0
  100. code_node_graph-0.1.0/src/code_node/report/logos/aws-waf.svg +1 -0
  101. code_node_graph-0.1.0/src/code_node/report/logos/aws-xray.svg +1 -0
  102. code_node_graph-0.1.0/src/code_node/report/logos/aws.svg +1 -0
  103. code_node_graph-0.1.0/src/code_node/report/logos/azure-icon.svg +1 -0
  104. code_node_graph-0.1.0/src/code_node/report/logos/django-icon.svg +1 -0
  105. code_node_graph-0.1.0/src/code_node/report/logos/elasticsearch.svg +1 -0
  106. code_node_graph-0.1.0/src/code_node/report/logos/fastapi-icon.svg +1 -0
  107. code_node_graph-0.1.0/src/code_node/report/logos/firebase-icon.svg +1 -0
  108. code_node_graph-0.1.0/src/code_node/report/logos/flask.svg +1 -0
  109. code_node_graph-0.1.0/src/code_node/report/logos/google-cloud.svg +1 -0
  110. code_node_graph-0.1.0/src/code_node/report/logos/kafka-icon.svg +1 -0
  111. code_node_graph-0.1.0/src/code_node/report/logos/mariadb-icon.svg +1 -0
  112. code_node_graph-0.1.0/src/code_node/report/logos/mongodb-icon.svg +1 -0
  113. code_node_graph-0.1.0/src/code_node/report/logos/mysql-icon.svg +1 -0
  114. code_node_graph-0.1.0/src/code_node/report/logos/openai-icon.svg +1 -0
  115. code_node_graph-0.1.0/src/code_node/report/logos/postgresql.svg +1 -0
  116. code_node_graph-0.1.0/src/code_node/report/logos/python.svg +1 -0
  117. code_node_graph-0.1.0/src/code_node/report/logos/rabbitmq-icon.svg +1 -0
  118. code_node_graph-0.1.0/src/code_node/report/logos/redis.svg +1 -0
  119. code_node_graph-0.1.0/src/code_node/report/logos/serverless.svg +1 -0
  120. code_node_graph-0.1.0/src/code_node/report/logos/slack-icon.svg +1 -0
  121. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-api-gateway.svg +1 -0
  122. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-appflow.svg +1 -0
  123. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-appsync.svg +1 -0
  124. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-athena.svg +1 -0
  125. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-backup.svg +1 -0
  126. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-batch.svg +1 -0
  127. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-certificate-manager.svg +1 -0
  128. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-cloudformation.svg +1 -0
  129. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-cloudfront.svg +1 -0
  130. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-cloudtrail.svg +1 -0
  131. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-cloudwatch.svg +1 -0
  132. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-codebuild.svg +1 -0
  133. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-codecommit.svg +1 -0
  134. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-codedeploy.svg +1 -0
  135. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-codepipeline.svg +1 -0
  136. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-cognito.svg +1 -0
  137. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-config.svg +1 -0
  138. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-documentdb.svg +1 -0
  139. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-dynamodb.svg +1 -0
  140. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-ec2.svg +1 -0
  141. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-ecs.svg +1 -0
  142. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-eks.svg +1 -0
  143. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-elasticache.svg +1 -0
  144. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-elb.svg +1 -0
  145. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-eventbridge.svg +1 -0
  146. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-glacier.svg +1 -0
  147. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-glue.svg +1 -0
  148. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-iam.svg +1 -0
  149. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-keyspaces.svg +1 -0
  150. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-kinesis.svg +1 -0
  151. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-kms.svg +1 -0
  152. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-lake-formation.svg +1 -0
  153. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-lambda.svg +1 -0
  154. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-mq.svg +1 -0
  155. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-msk.svg +1 -0
  156. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-neptune.svg +1 -0
  157. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-open-search.svg +1 -0
  158. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-quicksight.svg +1 -0
  159. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-rds.svg +1 -0
  160. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-redshift.svg +1 -0
  161. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-route53.svg +1 -0
  162. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-s3.svg +1 -0
  163. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-secrets-manager.svg +1 -0
  164. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-ses.svg +1 -0
  165. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-shield.svg +1 -0
  166. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-sns.svg +1 -0
  167. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-sqs.svg +1 -0
  168. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-step-functions.svg +1 -0
  169. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-systems-manager.svg +1 -0
  170. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-timestream.svg +1 -0
  171. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-waf.svg +1 -0
  172. code_node_graph-0.1.0/src/code_node/report/logos/small/aws-xray.svg +1 -0
  173. code_node_graph-0.1.0/src/code_node/report/logos/snowflake-icon.svg +1 -0
  174. code_node_graph-0.1.0/src/code_node/report/logos/sqlite.svg +1 -0
  175. code_node_graph-0.1.0/src/code_node/report/logos/stripe.svg +1 -0
  176. code_node_graph-0.1.0/src/code_node/report/logos/supabase-icon.svg +1 -0
  177. code_node_graph-0.1.0/src/code_node/report/logos/twilio-icon.svg +1 -0
  178. code_node_graph-0.1.0/src/code_node/report/outline.py +219 -0
  179. code_node_graph-0.1.0/src/code_node/report/style.py +358 -0
  180. code_node_graph-0.1.0/src/code_node/report/tabs.py +73 -0
  181. code_node_graph-0.1.0/src/code_node/report/walk.py +624 -0
  182. code_node_graph-0.1.0/src/code_node/serve.py +277 -0
  183. code_node_graph-0.1.0/tests/snapshots/books-api.txt +142 -0
  184. code_node_graph-0.1.0/tests/snapshots/cart-service.txt +111 -0
  185. code_node_graph-0.1.0/tests/snapshots/orders-service.txt +115 -0
  186. code_node_graph-0.1.0/tests/test_code_node.py +994 -0
@@ -0,0 +1,220 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
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
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
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
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs/Zensical documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # pytype static type analyzer
181
+ .pytype/
182
+
183
+ # Cython debug symbols
184
+ cython_debug/
185
+
186
+ # PyCharm
187
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
190
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
191
+ # .idea/
192
+
193
+ # Abstra
194
+ # Abstra is an AI-powered process automation framework.
195
+ # Ignore directories containing user credentials, local state, and settings.
196
+ # Learn more at https://abstra.io/docs
197
+ .abstra/
198
+
199
+ # Visual Studio Code
200
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
201
+ # can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
+ # and can be added to the global gitignore or merged into this file. However, if you prefer, you
203
+ # could uncomment the following to ignore the entire vscode folder
204
+ # .vscode/
205
+ # Temporary file for partial code execution
206
+ tempCodeRunnerFile.py
207
+
208
+ # Ruff stuff:
209
+ .ruff_cache/
210
+
211
+ # PyPI configuration file
212
+ .pypirc
213
+
214
+ # Marimo
215
+ marimo/_static/
216
+ marimo/_lsp/
217
+ __marimo__/
218
+
219
+ # Streamlit
220
+ .streamlit/secrets.toml
@@ -0,0 +1,157 @@
1
+ # Changelog
2
+
3
+ Every change a user would notice, newest first ([Keep a Changelog](https://keepachangelog.com/en/1.1.0/)). Versions
4
+ follow [Semantic Versioning](https://semver.org/); before 1.0, a minor version may change what a command does.
5
+ ## [Unreleased]
6
+
7
+ ## [0.1.0] - 2026-10-20
8
+
9
+ ### Added
10
+
11
+ - A web platform for FastAPI, Flask and Django (`--platform web`, set on its own for an app it finds). What a
12
+ route is called with is the request, read like a Lambda handler's event: a FastAPI route's parameters (from the
13
+ path, the query, the body, `Query()`, `Header()`, `Annotated[...]`; not `Depends()`), a Flask view's URL values
14
+ and `flask.request` (`args`, `form`, `get_json()`), and a Django view's `request` (`GET`, `POST`, `body`) and URL
15
+ values. So SQL or a shell command built from a query string is flagged as injection, and the graph's first box is
16
+ "The request" with the fields the code reads (`path.order_id`, `query.q`, `json.team`).
17
+ - Django's URL confs are entry points: a `urls.py` with `urlpatterns`, its `path()` and `re_path()` routes,
18
+ `include()` (routes come out under the path they're included at), class-based views (`View.as_view()`, a route
19
+ for each method) and Django REST framework routers (`router.register()`, a route for each ViewSet action). The
20
+ site's URL conf is offered before an app's it includes. `django.db.connection.cursor()` is read by the SQL plugin.
21
+ - A web app's box in the graph shows its framework's logo (FastAPI, Flask or Django), on a white tile as other
22
+ logos are, and the docs' "What code-node knows" figure lists the three under "Runs on".
23
+ - `examples/books-api`, a FastAPI app with a mistake for each thing the web platform finds, and a snapshot of
24
+ its page.
25
+ - A call that blocks inside an `async def` route (requests, urllib, `time.sleep()`, boto3) is flagged: it holds up
26
+ every other request on the worker's event loop. A connection opened on every request is too.
27
+ - Plugins that mix. Besides a platform (one per entry point), two new kinds of plugin stack: libraries, each turned
28
+ on when the code imports it, and deploy files, each read when it's in the folder. `code-node --plugins` lists
29
+ them, and other packages add their own through the `code_node.libraries` and `code_node.deploys` entry point
30
+ groups.
31
+ - Library plugins for Redis, SQL (sqlite3, psycopg2, psycopg, PyMySQL, mysql-connector, asyncpg, SQLAlchemy),
32
+ MongoDB (PyMongo, Motor) and the OpenAI and Anthropic SDKs. The graph draws a box for each service they reach
33
+ (Redis, PostgreSQL, OpenAI) with what each call does (`SELECT products`, `SETEX receipt:{customer}`,
34
+ `chat.completions.create gpt-4o-mini`), and Step by step says it ("Reads from PostgreSQL (SELECT products)").
35
+ - Deploy plugins for SAM / CloudFormation templates and `serverless.yml`. A function they name is an entry point,
36
+ whatever it's called, and the Lambda checks run against what the file says: environment variables that aren't
37
+ set, the Python it runs on, layers, its timeout, and AWS calls its role doesn't allow (marked "not allowed" in the
38
+ graph, with the SAM policy template that would allow them).
39
+ - It follows text built from the input: SQL put together from the event is flagged "SQL injection" where it runs,
40
+ and so is a shell command (`shell=True`, `os.system`). A name set to such text says so in Step by step.
41
+ - Findings across plugins: a client that has no timeout, worded for where it runs ("Lambda stops it at its 15 s
42
+ timeout"); a connection opened on every call of a Lambda handler; a call in a loop that a batch call would do
43
+ (`executemany()`, `mget()`, `insert_many()`, the Batch API); Redis `KEYS`.
44
+ - Logos are sharp on an ordinary (1x) screen. They come in two sizes, as favicons do: AWS's detailed service
45
+ icons have a small mark too (the service's colour with a bold white symbol), which the page shows on a 1x screen,
46
+ and the full art on a 2x one. Badges are 32 px, AWS's icons fill theirs instead of sitting small on a white tile,
47
+ and other logos have less padding. The docs' figures, the home page graph and the screenshots pick the size they
48
+ draw at.
49
+ - Real logos in the graph. AWS services (S3, DynamoDB, SNS, SQS, Lambda and about sixty more) and the services
50
+ libraries reach (Redis, PostgreSQL, MySQL, SQLite, MongoDB, OpenAI, Anthropic, Kafka...) show their own logo in
51
+ their box, in light and dark mode, where they had a line drawing; anything without one keeps it. The logos are
52
+ gilbarbara/logos (CC0), kept as .svg files in the package (`src/code_node/report/logos/`), and a page embeds
53
+ the ones it uses, so it still works offline. A library plugin can name one as
54
+ its icon (`icon = "kafka-icon"`).
55
+ - Two new figures in the docs and the README, drawn with those logos: how the plugins mix on the cart example
56
+ (each finding marked with the plugins that found it together), and every service, platform and deploy file
57
+ code-node knows. Logos sit on a white tile in dark mode too, as they're drawn for one.
58
+ - `examples/cart-service`, a Lambda function in a SAM template that uses PostgreSQL, Redis, OpenAI and boto3, and a
59
+ Plugins page in the docs drawn from it.
60
+ - Line links to your editor: each step's card ("line 36 ↗") and each place in a box's code panel ("open ↗") opens
61
+ that line in VS Code, or in Cursor with `--editor cursor`. Inside WSL they open the Windows editor on the WSL
62
+ files. `--editor none` leaves them out, and the folder's full path with them.
63
+
64
+ - The pages have a tab icon (code-node's logo), saved and served.
65
+
66
+ - Click a box in the graph to read its code in a panel on the right: a function whole, with the lines that make
67
+ its calls lit, or a few lines around each place the code uses a service, a variable or its input. No JavaScript:
68
+ the panel opens with CSS (`:target`), and Back closes it. `GraphNode.code` lists the lines (`CodeSpan`), and
69
+ `page_blocks(..., sources=...)` takes the files to show them from.
70
+ - Platforms: subclass `code_node.Platform` to say what another place code runs adds (its entry points, what
71
+ they're called with, its findings and wording), and add it with `register_platform` or a `code_node.platforms`
72
+ entry point in a package's `pyproject.toml`.
73
+ - `code-node [folder]` reads a folder of Python code with `ast` (nothing is run) and opens a page showing how it works
74
+ from an entry point: a graph of what comes in, who calls whom and what each path reaches (AWS calls with their IAM
75
+ permissions, HTTP requests, environment variables), each call step by step, findings, and tables.
76
+ - Entry points are found for you: `pyproject.toml` console scripts, Lambda handlers, FastAPI / Flask apps (each
77
+ route), Typer apps (each command), what runs under `if __name__ == "__main__":`, and functions named `main`.
78
+ When there are several, it asks which one.
79
+ - Start from a file with `code-node path/to/main.py` or `code-node main.py:function` (or `Class.method`), from a
80
+ dotted name with `-e pkg.cli.main`, or search by part of a name with `-e save`.
81
+ - `code-node --serve` puts the page on http://localhost:8765 and redraws it whenever a `.py` file changes. The
82
+ browser reloads at the same scroll position, and a page that can't be drawn says why until the next save.
83
+ - `--all` draws every function however deep; `--depth` and `--functions` set the limits; `--mermaid` prints the
84
+ graph as Mermaid; `--list` lists the entry points.
85
+
86
+ ### Changed
87
+
88
+ - A web app's own class (`FastAPI()`, `Flask()`, `APIRouter()`, `Blueprint()`) now comes from the web platform, so
89
+ an app found runs its checks. The summary no longer says "Each call runs app()" for an app object. Beside a step,
90
+ a field of the input is said in its platform's word (`event body.id` for Lambda, `request query.q` for a web
91
+ app), and the graph's input box is named for it when the kind of event can't be told ("The event", not "Its
92
+ input").
93
+ - The graph has room to breathe and is drawn at its real size, no longer squeezed to the page's width. Gaps between
94
+ columns widen with the arrows through them, boxes are spaced further apart, columns are wider so names show whole
95
+ (a long method's name breaks after its class: `PluginManager.` / `_load_plugin()`), and the order with the fewest
96
+ crossing arrows is kept. Arrows that skip columns from one box (the environment's, start-up's) or into one run as
97
+ one line and part near the end, instead of each taking its own path, and the environment's and clients' arrows
98
+ are quieter until you point at a box. A column too tall to take in is split into lanes side by side, so a big
99
+ graph (`--functions 100`) is wide, not one long strip. Buttons over the graph zoom it (Auto, Fit, 100%, 150%)
100
+ and open it full screen, without JavaScript.
101
+ - code-node now depends on PyYAML, to read deploy files.
102
+ - `--serve` also redraws when a deploy file (`template.yaml`, `serverless.yml`) changes.
103
+
104
+ - Step by step is easier to read. Each step in the list says what it does in plain words ("Takes `bucket` from the
105
+ event", "Reads from S3 (GetObject)", "Goes into `read_orders()`") instead of a cut-off line of code, with step
106
+ numbers in place of line numbers that jumped between files, and each function as a heading over its steps. A dot
107
+ marks the steps that reach AWS or the web. The card is roomier: that sentence as its headline, then where it is
108
+ and what it touches. Next is the one filled button, and Step over and Step out are now Skip call and Finish
109
+ `read_orders()`.
110
+ - The graph picks its boxes by how much code each one leads to, not by how near it is: from the entry point it
111
+ keeps taking the function that leads to the most lines (and AWS calls, HTTP requests and environment variables)
112
+ below it. On code-node's own command it now draws `make_page`, `map_code`, `page_blocks` and `render_page`
113
+ instead of small helpers, and the graph is less than half as tall.
114
+ - A box whose calls the graph leaves out says "+3 calls not drawn", and its code panel names them, instead of
115
+ looking like it does nothing.
116
+ - It follows what Python calls for you: `super().__init__()` and other `super()` calls open the base class's method,
117
+ reading a `@property` (or `cached_property`) runs its getter, and a `with` block on one of your classes runs its
118
+ `__enter__` (what `as` names is what that returns) and, after the block, its `__exit__`.
119
+ - Console scripts come from every `pyproject.toml` in the folder, not only the root's, so a monorepo's commands
120
+ (`libs/cli/pyproject.toml`) are found before its CI scripts.
121
+ - SyntaxWarnings from the code being read (`"\d"` in a plain string) no longer show in the terminal.
122
+ - It shows what it already knew about values. In Step by step, a line's card says what the names it sets now hold
123
+ (`store` holds an OrderStore, `self.table` a DynamoDB Table) and where its AWS call's arguments come from
124
+ (`Bucket ← env ARCHIVE_BUCKET`, `Key ← event Records[].s3.object.key`). A call's card says when it runs
125
+ ("only when `check(order)`"). The text and Mermaid output say the same, and the graph's AWS boxes list the sources
126
+ on hover.
127
+ - A function called only under an `if` says so in its graph box ("when args.serve"), from the `if` nearest around
128
+ the call. Lines after `if not check(order): continue` (or `return`, `raise`, `break`) count as running only when
129
+ `check(order)`, rather than always.
130
+
131
+ - The page is only two tabs now, Graph and Step by step. The title, the cards of numbers, the findings and the tables
132
+ under the graph (AWS calls and their IAM policy, environment variables, the event, functions, imports, HTTP
133
+ requests) are gone. The entry point and the folder sit at the right of the tab bar, which stays at the top as you
134
+ scroll. The graph still marks a warning on a box, such as an HTTP request with no timeout.
135
+ - The graph and the steps are in tabs, Graph and Step by step, instead of one under the other.
136
+ - Step by step is now a walk through the code in the order it runs, as a debugger steps: every step in a list, and
137
+ beside it the function the current step is in, its line lit, with a card saying what the line does and which calls
138
+ it's inside. Next goes into each function a line calls, Step over and Step out skip past them, and once a step is
139
+ clicked the arrow keys step through the rest. Click any numbered line in the code to jump to it. Still no
140
+ JavaScript, and a step is as quick on a page with thousands of them.
141
+ - The paragraph summing up the code under the numbers is gone: the numbers, the findings and the graph say it.
142
+ - Code on the page is set in Cascadia Mono when it's installed (the usual monospace font otherwise).
143
+ - `code-node --serve` keeps the open tab and step when the page redraws.
144
+ - The graph's code panel makes room beside the graph, rather than moving the whole page.
145
+
146
+ - `code-node --serve` without `--port` takes the first free port from 8765, so you can serve several folders at
147
+ once instead of the second one failing. The served tab's title starts with the folder's name. `--port N` still
148
+ means exactly that port.
149
+
150
+ - Lambda is now a platform plugin on top of a generic reader. Plain Python code no longer gets any Lambda check or
151
+ wording (a file written outside `/tmp` used to be marked amber in the graph), and Lambda handlers get the same
152
+ page as before.
153
+ - `--platform NAME` runs a platform's checks whatever the entry point is; `--lambda` is short for
154
+ `--platform lambda`. `EntryPoint.is_lambda` and `PageOptions.is_lambda` are now `platform` (`"lambda"` or `""`).
155
+
156
+ [Unreleased]: https://github.com/utkarsh5026/code-node/compare/v0.1.0...HEAD
157
+ [0.1.0]: https://github.com/utkarsh5026/code-node/releases/tag/v0.1.0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.