Skip to content

Commit 5a9454b

Browse files
author
ChidcGithub
committed
Rename project from CogniPy to Codegnipy
- Rename package from cognipy to codegnipy - Update all imports and references - Update README.md with new name and URLs - Update GitHub workflows - Update examples and tests - All 103 tests passing - mypy type check passing
1 parent 971bab2 commit 5a9454b

24 files changed

Lines changed: 119 additions & 117 deletions

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ jobs:
6464
pip install ruff mypy
6565
6666
- name: Run ruff
67-
run: ruff check cognipy/ --output-format=github
67+
run: ruff check codegnipy/ --output-format=github
6868

6969
- name: Run mypy
70-
run: mypy cognipy/ --ignore-missing-imports
70+
run: mypy codegnipy/ --ignore-missing-imports
7171
continue-on-error: true
7272

7373
build:
@@ -124,7 +124,7 @@ jobs:
124124
- name: Get version
125125
id: version
126126
run: |
127-
VERSION=$(python -c "import sys; sys.path.insert(0, '.'); from cognipy import __version__; print(__version__)")
127+
VERSION=$(python -c "import sys; sys.path.insert(0, '.'); from codegnipy import __version__; print(__version__)")
128128
echo "version=$VERSION" >> $GITHUB_OUTPUT
129129
130130
- name: Check if tag exists
@@ -174,4 +174,4 @@ jobs:
174174
path: dist/
175175

176176
- name: Publish to PyPI
177-
uses: pypa/gh-action-pypi-publish@release/v1
177+
uses: pypa/gh-action-pypi-publish@release/v1

README.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# CogniPy
1+
# Codegnipy
22

3-
[![PyPI version](https://img.shields.io/pypi/v/cognipy.svg)](https://pypi.org/project/cognipy/)
4-
[![Python](https://img.shields.io/pypi/pyversions/cognipy.svg)](https://pypi.org/project/cognipy/)
5-
[![License](https://img.shields.io/github/license/ChidcGithub/CogniPy)](LICENSE)
6-
[![Build Status](https://github.com/ChidcGithub/CogniPy/actions/workflows/ci.yml/badge.svg)](https://github.com/ChidcGithub/CogniPy/actions/workflows/ci.yml)
7-
[![Coverage](https://img.shields.io/codecov/c/github/ChidcGithub/CogniPy.svg)](https://codecov.io/gh/ChidcGithub/CogniPy)
3+
[![PyPI version](https://img.shields.io/pypi/v/codegnipy.svg)](https://pypi.org/project/codegnipy/)
4+
[![Python](https://img.shields.io/pypi/pyversions/codegnipy.svg)](https://pypi.org/project/codegnipy/)
5+
[![License](https://img.shields.io/github/license/ChidcGithub/Codegnipy)](LICENSE)
6+
[![Build Status](https://github.com/ChidcGithub/Codegnipy/actions/workflows/ci.yml/badge.svg)](https://github.com/ChidcGithub/Codegnipy/actions/workflows/ci.yml)
7+
[![Coverage](https://img.shields.io/codecov/c/github/ChidcGithub/Codegnipy.svg)](https://codecov.io/gh/ChidcGithub/Codegnipy)
88

99
**AI-Native Python Language Extension**
1010

11-
CogniPy seamlessly integrates Large Language Models (LLMs) into Python, making non-deterministic AI capabilities a first-class citizen in your code. Write logic close to natural language while achieving production-grade performance and debuggability.
11+
Codegnipy seamlessly integrates Large Language Models (LLMs) into Python, making non-deterministic AI capabilities a first-class citizen in your code. Write logic close to natural language while achieving production-grade performance and debuggability.
1212

1313
## Features
1414

@@ -22,21 +22,21 @@ CogniPy seamlessly integrates Large Language Models (LLMs) into Python, making n
2222
## Installation
2323

2424
```bash
25-
pip install cognipy
25+
pip install codegnipy
2626
```
2727

2828
For development:
2929

3030
```bash
31-
pip install cognipy[dev]
31+
pip install codegnipy[dev]
3232
```
3333

3434
## Quick Start
3535

3636
### The `~` Operator
3737

3838
```python
39-
from cognipy import CognitiveContext, cognitive_call
39+
from codegnipy import CognitiveContext, cognitive_call
4040

4141
with CognitiveContext(api_key="your-api-key"):
4242
# Natural language prompts directly in code
@@ -47,7 +47,7 @@ with CognitiveContext(api_key="your-api-key"):
4747
### The `@cognitive` Decorator
4848

4949
```python
50-
from cognipy import cognitive, CognitiveContext
50+
from codegnipy import cognitive, CognitiveContext
5151

5252
@cognitive
5353
def summarize(text: str) -> str:
@@ -62,7 +62,7 @@ with CognitiveContext(api_key="your-api-key"):
6262

6363
```python
6464
import asyncio
65-
from cognipy import batch_call, CognitiveContext
65+
from codegnipy import batch_call, CognitiveContext
6666

6767
async def main():
6868
prompts = [
@@ -79,7 +79,7 @@ asyncio.run(main())
7979
### With Memory Persistence
8080

8181
```python
82-
from cognipy import CognitiveContext, FileStore
82+
from codegnipy import CognitiveContext, FileStore
8383

8484
with CognitiveContext(
8585
api_key="your-api-key",
@@ -93,7 +93,7 @@ with CognitiveContext(
9393
### With Type Constraints
9494

9595
```python
96-
from cognipy import PrimitiveConstraint, deterministic_call
96+
from codegnipy import PrimitiveConstraint, deterministic_call
9797

9898
# Ensure LLM output is a valid integer between 0-100
9999
constraint = PrimitiveConstraint(
@@ -114,7 +114,7 @@ if result.status == "valid":
114114
### With Reflection
115115

116116
```python
117-
from cognipy import CognitiveContext, with_reflection
117+
from codegnipy import CognitiveContext, with_reflection
118118

119119
with CognitiveContext(api_key="your-api-key") as ctx:
120120
result = with_reflection(
@@ -203,7 +203,7 @@ CognitiveContext(
203203
### Scheduler
204204

205205
```python
206-
from cognipy import CognitiveScheduler, Priority
206+
from codegnipy import CognitiveScheduler, Priority
207207

208208
scheduler = CognitiveScheduler(
209209
max_concurrent=5,
@@ -225,7 +225,7 @@ result = await scheduler.get_result(task_id, timeout=10.0)
225225
### Hallucination Detection
226226

227227
```python
228-
from cognipy import HallucinationDetector
228+
from codegnipy import HallucinationDetector
229229

230230
detector = HallucinationDetector()
231231
check = detector.detect(llm_response)
@@ -241,14 +241,14 @@ print(check.issues) # List of detected issues
241241
| Variable | Description |
242242
|----------|-------------|
243243
| `OPENAI_API_KEY` | OpenAI API key |
244-
| `COGNIPY_MODEL` | Default model to use |
245-
| `COGNIPY_TEMPERATURE` | Default temperature |
246-
| `COGNIPY_MAX_TOKENS` | Default max tokens |
244+
| `CODEGNIPY_MODEL` | Default model to use |
245+
| `CODEGNIPY_TEMPERATURE` | Default temperature |
246+
| `CODEGNIPY_MAX_TOKENS` | Default max tokens |
247247

248248
### Programmatic Configuration
249249

250250
```python
251-
from cognipy import CognitiveContext
251+
from codegnipy import CognitiveContext
252252

253253
ctx = CognitiveContext(
254254
api_key="sk-...",
@@ -262,16 +262,16 @@ ctx = CognitiveContext(
262262

263263
```bash
264264
# Run a script with cognitive features
265-
cognipy run script.py
265+
codegnipy run script.py
266266

267267
# Start interactive REPL
268-
cognipy repl
268+
codegnipy repl
269269

270270
# Show version
271-
cognipy version
271+
codegnipy version
272272

273273
# With options
274-
cognipy run script.py --model gpt-4 --api-key sk-...
274+
codegnipy run script.py --model gpt-4 --api-key sk-...
275275
```
276276

277277
## Testing
@@ -283,15 +283,15 @@ cognipy run script.py --model gpt-4 --api-key sk-...
283283
pytest tests/ -v
284284

285285
# With coverage
286-
pytest tests/ --cov=cognipy --cov-report=html
286+
pytest tests/ --cov=codegnipy --cov-report=html
287287
```
288288

289289
### Simulation Mode
290290

291291
For testing without actual LLM calls:
292292

293293
```python
294-
from cognipy import Simulator, SimulationMode
294+
from codegnipy import Simulator, SimulationMode
295295

296296
simulator = Simulator(mode=SimulationMode.MOCK)
297297

@@ -311,8 +311,8 @@ simulator.load_recordings("recordings.json")
311311
## Project Structure
312312

313313
```
314-
CogniPy/
315-
cognipy/
314+
Codegnipy/
315+
codegnipy/
316316
__init__.py # Package exports
317317
runtime.py # Core runtime (cognitive_call, CognitiveContext)
318318
decorator.py # @cognitive decorator
@@ -345,8 +345,8 @@ CogniPy/
345345

346346
```bash
347347
# Clone repository
348-
git clone https://github.com/ChidcGithub/CogniPy.git
349-
cd CogniPy
348+
git clone https://github.com/ChidcGithub/Codegnipy.git
349+
cd Codegnipy
350350

351351
# Create virtual environment
352352
python -m venv venv
@@ -359,8 +359,8 @@ pip install -e ".[dev]"
359359
pytest tests/ -v
360360

361361
# Run linting
362-
ruff check cognipy/
363-
mypy cognipy/
362+
ruff check codegnipy/
363+
mypy codegnipy/
364364
```
365365

366366
## Roadmap
@@ -377,10 +377,10 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
377377

378378
## Acknowledgments
379379

380-
CogniPy is inspired by the vision of making AI a natural part of programming, bridging the gap between deterministic code and probabilistic intelligence.
380+
Codegnipy is inspired by the vision of making AI a natural part of programming, bridging the gap between deterministic code and probabilistic intelligence.
381381

382382
## Links
383383

384-
- [Documentation](https://github.com/ChidcGithub/CogniPy#readme)
385-
- [Issue Tracker](https://github.com/ChidcGithub/CogniPy/issues)
386-
- [PyPI Package](https://pypi.org/project/cognipy/)
384+
- [Documentation](https://github.com/ChidcGithub/Codegnipy#readme)
385+
- [Issue Tracker](https://github.com/ChidcGithub/Codegnipy/issues)
386+
- [PyPI Package](https://pypi.org/project/codegnipy/)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# CogniPy - AI 原生的 Python 语言扩展
1+
# Codegnipy - AI 原生的 Python 语言扩展
22
"""
3-
CogniPy 让非确定性的 AI 能力成为 Python 的一等公民。
3+
Codegnipy 让非确定性的 AI 能力成为 Python 的一等公民。
44
55
核心特性:
66
- `~"prompt"` 操作符:将自然语言提示直接嵌入代码

cognipy/cli.py renamed to codegnipy/cli.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
CogniPy 命令行接口
2+
Codegnipy 命令行接口
33
4-
提供 `cognipy run` 和 `cognipy repl` 命令。
4+
提供 `codegnipy run` 和 `codegnipy repl` 命令。
55
"""
66

77
import argparse
@@ -11,14 +11,14 @@
1111

1212
from .transformer import transform_code
1313
from .runtime import CognitiveContext
14-
import cognipy
14+
import codegnipy
1515

1616

1717
def create_parser() -> argparse.ArgumentParser:
1818
"""创建命令行解析器"""
1919
parser = argparse.ArgumentParser(
20-
prog="cognipy",
21-
description="CogniPy - AI 原生的 Python 语言扩展"
20+
prog="codegnipy",
21+
description="Codegnipy - AI 原生的 Python 语言扩展"
2222
)
2323

2424
subparsers = parser.add_subparsers(dest="command", help="可用命令")
@@ -51,7 +51,7 @@ def create_parser() -> argparse.ArgumentParser:
5151

5252

5353
def run_file(filepath: str, model: str, api_key: Optional[str] = None):
54-
"""运行 CogniPy 文件"""
54+
"""运行 Codegnipy 文件"""
5555
path = Path(filepath)
5656

5757
if not path.exists():
@@ -70,7 +70,7 @@ def run_file(filepath: str, model: str, api_key: Optional[str] = None):
7070
globals_ = {
7171
"__name__": "__main__",
7272
"__file__": str(path.absolute()),
73-
"cognipy": cognipy,
73+
"codegnipy": codegnipy,
7474
"__cognitive_context__": CognitiveContext.get_current()
7575
}
7676

@@ -90,7 +90,7 @@ def start_repl(model: str):
9090
"""启动交互式 REPL"""
9191
import code
9292

93-
print("CogniPy REPL")
93+
print("Codegnipy REPL")
9494
print(f"模型: {model}")
9595
print("输入 Python 代码,~\"prompt\" 语法将调用 LLM")
9696
print("输入 exit() 或 Ctrl+D 退出\n")
@@ -101,7 +101,7 @@ def start_repl(model: str):
101101

102102
# 准备 REPL 环境
103103
local_vars = {
104-
"cognipy": cognipy,
104+
"codegnipy": codegnipy,
105105
"__cognitive_context__": ctx
106106
}
107107

@@ -143,11 +143,11 @@ def main():
143143
elif args.command == "repl":
144144
start_repl(args.model)
145145
elif args.command == "version":
146-
print(f"CogniPy v{cognipy.__version__}")
146+
print(f"Codegnipy v{codegnipy.__version__}")
147147
else:
148148
parser.print_help()
149149
sys.exit(1)
150150

151151

152152
if __name__ == "__main__":
153-
main()
153+
main()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
CogniPy 确定性保证模块
2+
Codegnipy 确定性保证模块
33
44
提供类型约束、模拟执行和幻觉检测功能,确保 LLM 输出的可靠性。
55
"""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
CogniPy 记忆存储模块
2+
Codegnipy 记忆存储模块
33
44
提供会话记忆的存储、检索和管理功能。
55
"""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
CogniPy 多提供商支持模块
2+
Codegnipy 多提供商支持模块
33
44
支持多种 LLM 提供商:OpenAI、Anthropic、本地模型等。
55
"""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
CogniPy 反思模块
2+
Codegnipy 反思模块
33
44
实现反思循环,让 LLM 能够检查和修正自己的输出。
55
"""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
CogniPy 运行时核心模块
2+
Codegnipy 运行时核心模块
33
44
提供 cognitive_call 函数和 CognitiveContext 上下文管理器。
55
"""

0 commit comments

Comments
 (0)