codesigs
About codesigs
codesigs extracts function and method signatures from source code
across over a dozen programming languages. It uses
ast-grep for most languages and Python’s
built-in ast module for Python files, providing accurate syntax-aware
parsing rather than brittle regex matching.
This is useful for:
- Documentation generation - quickly summarize the public API of a codebase
- Code search and navigation - find functions by signature pattern
- LLM context preparation - provide compact API summaries to language models without including full implementations
- Codebase analysis - understand the structure of unfamiliar projects
Installation
Install latest from pypi
$ pip install codesigs
How to use
Pass source code to a language-specific function to get a list of signatures:
sigs = py_sigs("""
def greet(name, age=10):
"Say hello to someone"
return f"Hello {name}, you are {age}"
class Calculator:
def add(self, a, b):
return a + b
""")
for o in sigs: print(o)
def greet(name, age=10):
"Say hello to someone" ...
class Calculator: ...
def add(self, a, b): ...
Use
ext_sigs
when you have source code and know the file extension:
ext_sigs("function greet(name) { return `Hello ${name}`; }", ".js")
['function greet(name) {...}']
Or use
file_sigs
to read and extract signatures from a file in one step:
file_sigs('../codesigs/core.py')[:3]
['def get_docstring(node, lines):\n "Get docstring from source lines if present" ...',
'def _node_sig(node, lines): ...',
'def py_sigs(src):\n "Extract class/function/method signatures from Python source" ...']
The package supports Python, JavaScript/TypeScript, Java, Rust, C#, CSS,
Go, Ruby, PHP, Kotlin, Swift, and Lua. Each language has a dedicated
function
(e.g. js_sigs,
rust_sigs),
or use
ext_sigs/file_sigs
which auto-detect from the extension.
Metadata
Release files for codesigs 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| codesigs-0.0.3.tar.gz | 9.2 kB | Without provenance | Details for codesigs-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codesigs-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for codesigs-0.0.3-py3-none-any.whl |
Total release size: 18.9 kB
Release files / codesigs-0.0.3.tar.gz
| Download URL | codesigs-0.0.3.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6786f9652ffdd6ea481697fb7baecd5b44ed6d5bf52fda529b76e5c8ee79d8d4
|
|
BLAKE2b-256 checksum How to use checksums |
92de7a3c6b900594944dbc89b7cce1c6d58a5fac56971171405f4749f757025d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / codesigs-0.0.3-py3-none-any.whl
| Download URL | codesigs-0.0.3-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
83591fc5e317609ed42b776e52fcd8fc3fdf8ffca5e6e92c5225358ac0ee62b8
|
|
BLAKE2b-256 checksum How to use checksums |
93812d1049c2dea9ba328dac97346e7a32a326fdb2fdf2b5d95db46688d6784a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for codesigs 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.