SumPAI
Summarization and embedding of Python projects.
Generates information that is useful for helping machines understand your Python code.
The data structure looks like this:
{ "type": source_type, "name": name, "path": path, "hash": city_hash, "summary": summary, "embedding": embedding, }
Each file is broken into Classes, Class Functions, Functions and global level code.
Each of these are summarized using GPT-3.5-turbo and ada-02 embeddings are generated with the summary and code chunks.
Additionally, each file is summarized by all of the summaries above to give a complete overview of the file.
This project currently consumes about $0.02 for one run to give you an idea of the cost to run this.
If files were not changed it skips the file.
It will also skip classes and functions and globals if they were not changed.
It is intended for the files to be commited to the git repo and not for use by humans, it might make sense to hide these files in the future.
If you're not sure why you might need to run this you probably don't.
If you have a large project be aware that this code will scale models based on token count, for very large projects this might mean you will use gpt-4-32k.
Installation
pip install sum-pai
Usage
Setup your OpenAI API Key as the OPENAI_API_KEY environmental variable.
.env files are supported.
or pass with
--openai-api-key=<key>
sum_pai <target>
you can also set the logging level with LOG_LEVEL envvar or
--log-level=DEBUG
Searching
There's a search embedding in the root of the project, will be used for testing.
search_project.exe --text "perform a knn search" --target src
Result:
Metadata
Release files for sum-pai 0.4.0
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 |
|---|---|---|---|---|
| sum_pai-0.4.0.tar.gz | 45.7 kB | Without provenance | Details for sum_pai-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sum_pai-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for sum_pai-0.4.0-py3-none-any.whl |
Total release size: 66.3 kB
Release files / sum_pai-0.4.0.tar.gz
| Download URL | sum_pai-0.4.0.tar.gz |
|---|---|
| Size | 45.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fae23b33e0f71521312c47518dbc063a9fa6091c2ff25643f594cf5dc1749f75
|
|
BLAKE2b-256 checksum How to use checksums |
1e1ff76f96805b497efd80fafd6b25c2a6cd97620ba490a61b1d648c4fee6a15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.4
|
Release files / sum_pai-0.4.0-py3-none-any.whl
| Download URL | sum_pai-0.4.0-py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d272a5ab54303aef92572b4068eaa77ba389bd2b0b6eefc52d4125f574cf7f8
|
|
BLAKE2b-256 checksum How to use checksums |
f7b1c3b777a79fed0f3b60eb0d4d289ab1647a4a3d8b0c6b9bcedf9af81ba207
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.4
|
Security for sum-pai 0.4.0
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.