TextPy ── Collaborative Agent Workflow through Programming and Prompting
🚀 Core Philosophy
P1: Workflow = Programming + Prompting
P2: Programming <-> Prompting
P3: Workflow = Function Signature with Comment
⚡ Revolutionary Features
- Mixed-Execution: Seamlessly integrates with legacy code
- AICompiler: Just write function signatures -- our powerful compiler will automatically generate natural language instructions or code instructions just in time
- Self-Replication: Easier implementation of recursive workflows
🔧 Usage
Installation
Install via pip:
$ pip install textpy-llm
Import in your Python script:
import textpy
Or use our Docker image:
$ docker pull ghcr.io/yezhengmao1/textpy:latest
👾 Quick Start - Amazing Example - Daily arXiv
Example: Automatically fetch daily updates from arXiv, filter papers by topic, translate abstracts into Chinese, store them in a database, and generate a markdown file to display the abstracts.
😊Real-world Use Case: I personally use TextPy to periodically push these generated markdown files to my blog when new papers are available.
Browse the results at: Daily arXiv
Highlight: You only need to define the functions and use them in your workflow. Our powerful AICompiler recognizes their purpose, automatically generating and executing the necessary code or creating prompts for large language model interaction.
see examples/daily_arxiv.py for the complete implementation.
@code
def get_the_rss_xml_file_str(*, url: str) -> str: ...
@code(pypi=[get_the_rss_xml_file_str(url=ARXIV_URL)])
def get_all_item_in_the_rss_file(*, xml_file_str: str) -> list[dict]: ...
@text
def check_topic_is_satisfactory(*, abstrct: str, topic: str) -> bool: ...
@text
def translate_the_en_abstract_to_zh(*, abstract: str) -> str: ...
@code
def check_link_in_db(*, db_path: str, link: str) -> bool: ...
@code
def save_article_to_db(*, db_path: str, item: dict): ...
# These functions only need to be defined...
🤩 Quick Start - Awesome Example - Deep Paper
Example: Download PDFs from arXiv using their IDs, extract text, generate summaries, and recursively process all cited references. The system visualizes the relationships between papers in an interactive HTML file.
Highlight: All functions in the workflow is generated by TextPy's AICompiler, including installation and usage of external Python packages. Your only responsibility is writing function signatures with clear comments, and the workflow!
NOTE: We strongly recommend running this script in a container since the AICompiler manipulates the external environment during compilation.
To run with Docker:
cd ./examples
DEEPSEEK_API=xxx CACHE_DIR="/workspace/.cache" ARXIV_ID=<xxxx.xxxx> ./arxiv_search.sh
See It In Action:
📌 Contributing
Community contributions are more than welcome, whether it be to fix bugs or to add new features at github.
📜 Citation
@misc{ye2025textpy,
author = {Zhengmao Ye, Shuyun Yang, Zelong Huang, Jie Zuo, Mingjie Tang},
title = {TextPy: Collaborative Agent Workflow through Programming and Prompting},
year = {2025},
howpublished = {\url{https://github.com/yezhengmao1/TextPy}}
}
Metadata
Release files for textpy-llm 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| textpy_llm-0.1.4.tar.gz | 14.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| textpy_llm-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.9 kB
Release files / textpy_llm-0.1.4.tar.gz
| Download URL | textpy_llm-0.1.4.tar.gz |
|---|---|
| Size | 14.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a43f0ce73ed2e8af794d280fc3e4eb9e0f4be7270cad61578b63af13164baa69
|
|
BLAKE2b-256 checksum How to use checksums |
584f67d65bd9040593fd06073ee363c1e305d52fb9614eb8df4f14e94ccb8a4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 1, 2025.
Transparency logRelease files / textpy_llm-0.1.4-py3-none-any.whl
| Download URL | textpy_llm-0.1.4-py3-none-any.whl |
|---|---|
| Size | 17.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8ab22426d45976cb85b62f88a176df57df59f747e297f2dedeb987a62959cab
|
|
BLAKE2b-256 checksum How to use checksums |
0cfda2470cb1c64adb5cd0429ba75a1d9c044cc324df181171aca08bb2fa9d99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 1, 2025.
Transparency log