Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files |
|
File content: <br />
<p align="center">
<a href="https://docs.codegen.com">
<img src="https://i.imgur.com/6RF9W0z.jpeg" />
</a>
</p>
<h2 align="center">
Scriptable interface to a powerful, multi-lingual language server.
</h2>
<div align="center">
[](https://pypi.org/project/codegen/)
[](https://docs.codegen.com)
[](https://community.codegen.com)
[](https://github.com/codegen-sh/codegen-sdk/tree/develop?tab=Apache-2.0-1-ov-file)
[](https://x.com/codegen)
</div>
<br />
[Codegen](https://docs.codegen.com) is a python library for manipulating codebases.
```python
from codegen import Codebase
# Codegen builds a complete graph connecting
# functions, classes, imports and their relationships
codebase = Codebase("./")
# Work with code without dealing with syntax trees or parsing
for function in codebase.functions:
# Comprehensive static analysis for references, dependencies, etc.
if not function.usages:
# Auto-handles references and imports to maintain correctness
function.move_to_file("deprecated.py")Write code that transforms code. Codegen combines the parsing power of Tree-sitter with the graph algorithms of rustworkx to enable scriptable, multi-language code manipulation at scale. Installation and UsageWe support
UsageSee Getting Started for a full tutorial. ResourcesWhy Codegen?Software development is fundamentally programmatic. Refactoring a codebase, enforcing patterns, or analyzing control flow - these are all operations that can (and should) be expressed as programs themselves. We built Codegen backwards from real-world refactors performed on enterprise codebases. Instead of starting with theoretical abstractions, we focused on creating APIs that match how developers actually think about code changes:
ContributingPlease see our Contributing Guide for instructions on how to set up the development environment and submit contributions. EnterpriseFor more information on enterprise engagements, please contact us or request a demo. |
|
File content: <br />
<p align="center">
<a href="https://docs.codegen.com">
<img src="https://i.imgur.com/6RF9W0z.jpeg" />
</a>
</p>
<h2 align="center">
Scriptable interface to a powerful, multi-lingual language server.
</h2>
<div align="center">
[](https://pypi.org/project/codegen/)
[](https://docs.codegen.com)
[](https://community.codegen.com)
[](https://github.com/codegen-sh/codegen-sdk/tree/develop?tab=Apache-2.0-1-ov-file)
[](https://x.com/codegen)
</div>
<br />
[Codegen](https://docs.codegen.com) is a python library for manipulating codebases.
```python
from codegen import Codebase
# Codegen builds a complete graph connecting
# functions, classes, imports and their relationships
codebase = Codebase("./")
# Work with code without dealing with syntax trees or parsing
for function in codebase.functions:
# Comprehensive static analysis for references, dependencies, etc.
if not function.usages:
# Auto-handles references and imports to maintain correctness
function.move_to_file("deprecated.py")Write code that transforms code. Codegen combines the parsing power of Tree-sitter with the graph algorithms of rustworkx to enable scriptable, multi-language code manipulation at scale. Installation and UsageWe support
UsageSee Getting Started for a full tutorial. ResourcesWhy Codegen?Software development is fundamentally programmatic. Refactoring a codebase, enforcing patterns, or analyzing control flow - these are all operations that can (and should) be expressed as programs themselves. We built Codegen backwards from real-world refactors performed on enterprise codebases. Instead of starting with theoretical abstractions, we focused on creating APIs that match how developers actually think about code changes:
ContributingPlease see our Contributing Guide for instructions on how to set up the development environment and submit contributions. EnterpriseFor more information on enterprise engagements, please contact us or request a demo. |
Motivation
Content
Testing
Please check the following before marking your PR as ready for review