Metadata-Version: 2.4
Name: codegen
Version: 0.39.1
Summary: Scriptable interface to a powerful, multi-lingual language server built on top of Tree-sitter
Project-URL: Homepage, https://www.codegen.com/
Project-URL: Repository, https://github.com/codegen-sh/codegen-sdk
Project-URL: Download, https://github.com/codegen-sh/codegen-sdk/archive/734237820fcf6f46f8b62c3656d9ef9030664d9d.zip
Project-URL: Changelog, https://docs.codegen.com/changelog/changelog
Project-URL: Releasenotes, https://github.com/codegen-sh/codegen-sdk/releases
Project-URL: Issues, https://github.com/codegen-sh/codegen-sdk/issues
Project-URL: Documentation, https://docs.codegen.com
Project-URL: Playground, https://www.codegen.sh/
Author-email: Codegen Team <team@codegen.sh>
License: Apache-2.0
License-File: LICENSE
Keywords: code generation,codebase,codebase analysis,codebase manipulation,codebase transformation,codegen,refactoring
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: MacOS X
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <3.14,>=3.12
Requires-Dist: astor<1.0.0,>=0.8.1
Requires-Dist: click>=8.1.7
Requires-Dist: codeowners<1.0.0,>=0.6.0
Requires-Dist: dataclasses-json<1.0.0,>=0.6.4
Requires-Dist: datamodel-code-generator>=0.26.5
Requires-Dist: dicttoxml<2.0.0,>=1.7.16
Requires-Dist: docker>=6.1.3
Requires-Dist: docstring-parser<1.0,>=0.16
Requires-Dist: fastapi[standard]<1.0.0,>=0.115.2
Requires-Dist: gitpython==3.1.44
Requires-Dist: giturlparse
Requires-Dist: hatch-vcs>=0.4.0
Requires-Dist: hatchling>=1.25.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: humanize<5.0.0,>=4.10.0
Requires-Dist: langchain-anthropic>=0.3.7
Requires-Dist: langchain-core
Requires-Dist: langchain-openai
Requires-Dist: langchain[openai]
Requires-Dist: langgraph
Requires-Dist: lazy-object-proxy>=0.0.0
Requires-Dist: lox>=0.12.0
Requires-Dist: mcp[cli]
Requires-Dist: mini-racer>=0.12.4
Requires-Dist: modal>=0.73.45
Requires-Dist: neo4j
Requires-Dist: networkx>=3.4.1
Requires-Dist: numpy>=2.2.2
Requires-Dist: openai==1.64.0
Requires-Dist: packaging>=24.2
Requires-Dist: pip>=24.3.1
Requires-Dist: plotly<7.0.0,>=5.24.0
Requires-Dist: psutil>=5.8.0
Requires-Dist: pydantic-core>=2.23.4
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pydantic<3.0.0,>=2.9.2
Requires-Dist: pygit2>=1.16.0
Requires-Dist: pygithub==2.6.1
Requires-Dist: pyinstrument>=5.0.0
Requires-Dist: pyjson5==1.6.8
Requires-Dist: pyright<2.0.0,>=1.1.372
Requires-Dist: pytest-snapshot>=0.9.0
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: python-levenshtein<1.0.0,>=0.25.1
Requires-Dist: python-semantic-release
Requires-Dist: requests>=2.32.3
Requires-Dist: rich-click>=1.8.5
Requires-Dist: rich<14.0.0,>=13.7.1
Requires-Dist: rustworkx>=0.15.1
Requires-Dist: sentry-sdk==2.22.0
Requires-Dist: slack-sdk
Requires-Dist: starlette<1.0.0,>=0.16.0
Requires-Dist: tabulate<1.0.0,>=0.9.0
Requires-Dist: termcolor>=2.4.0
Requires-Dist: tiktoken<1.0.0,>=0.5.1
Requires-Dist: tomlkit>=0.13.2
Requires-Dist: tqdm>=4.67.1
Requires-Dist: tree-sitter-javascript>=0.23.1
Requires-Dist: tree-sitter-python>=0.23.4
Requires-Dist: tree-sitter-typescript>=0.23.2
Requires-Dist: tree-sitter>=0.23.1
Requires-Dist: typing-extensions>=4.12.2
Requires-Dist: unidiff>=0.7.5
Requires-Dist: urllib3>=2.0.0
Requires-Dist: uvicorn[standard]>=0.30.0
Requires-Dist: watchfiles<1.1.0,>=1.0.0
Requires-Dist: wrapt<2.0.0,>=1.16.0
Requires-Dist: xmltodict<1.0.0,>=0.13.0
Provides-Extra: lsp
Requires-Dist: attrs>=25.1.0; extra == 'lsp'
Requires-Dist: lsprotocol==2024.0.0b1; extra == 'lsp'
Requires-Dist: pygls>=2.0.0a2; extra == 'lsp'
Provides-Extra: types
Requires-Dist: types-networkx>=3.2.1.20240918; extra == 'types'
Requires-Dist: types-requests>=2.32.0.20241016; extra == 'types'
Requires-Dist: types-tabulate>=0.9.0.20240106; extra == 'types'
Requires-Dist: types-toml>=0.10.8.20240310; extra == 'types'
Description-Content-Type: text/markdown

<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">

[![PyPI](https://img.shields.io/badge/PyPi-codegen-gray?style=flat-square&color=blue)](https://pypi.org/project/codegen/)
[![Documentation](https://img.shields.io/badge/Docs-docs.codegen.com-purple?style=flat-square)](https://docs.codegen.com)
[![Slack Community](https://img.shields.io/badge/Slack-Join-4A154B?logo=slack&style=flat-square)](https://community.codegen.com)
[![License](https://img.shields.io/badge/Code%20License-Apache%202.0-gray?&color=gray)](https://github.com/codegen-sh/codegen-sdk/tree/develop?tab=Apache-2.0-1-ov-file)
[![Follow on X](https://img.shields.io/twitter/follow/codegen?style=social)](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](https://tree-sitter.github.io/tree-sitter/) with the graph algorithms of [rustworkx](https://github.com/Qiskit/rustworkx) to enable scriptable, multi-language code manipulation at scale.

## Installation and Usage

We support

- Running Codegen in Python 3.12 – 3.13 (recommended: Python 3.13)
- macOS and Linux
  - macOS is supported
  - Linux is supported on x86_64 and aarch64 with glibc 2.34+
  - Windows is not supported
- Python, Typescript, Javascript and React codebases

```
# Install inside existing project
uv pip install codegen

# Install global CLI
uv tool install codegen

# Create a codemod for a given repo
cd path/to/repo
codegen init
codegen create test-function

# Run the codemod
codegen run test-function

# Create an isolated venv with codegen => open jupyter
codegen notebook
```

## Usage

See [Getting Started](https://docs.codegen.com/introduction/getting-started) for a full tutorial.

```
from codegen import Codebase
```

## Resources

- [Docs](https://docs.codegen.com)
- [Getting Started](https://docs.codegen.com/introduction/getting-started)
- [Contributing](CONTRIBUTING.md)
- [Contact Us](https://codegen.com/contact)

## Why 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:

- **Natural mental model**: Write transforms that read like your thought process - "move this function", "rename this variable", "add this parameter". No more wrestling with ASTs or manual import management.

- **Battle-tested on complex codebases**: Handle Python, TypeScript, and React codebases with millions of lines of code.

- **Built for advanced intelligences**: As AI developers become more sophisticated, they need expressive yet precise tools to manipulate code. Codegen provides a programmatic interface that both humans and AI can use to express complex transformations through code itself.

## Contributing

Please see our [Contributing Guide](CONTRIBUTING.md) for instructions on how to set up the development environment and submit contributions.

## Enterprise

For more information on enterprise engagements, please [contact us](https://codegen.com/contact) or [request a demo](https://codegen.com/request-demo).
