sumiki 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sumiki-0.1.0/.env.example +4 -0
- sumiki-0.1.0/.gitignore +60 -0
- sumiki-0.1.0/LICENSE +21 -0
- sumiki-0.1.0/PKG-INFO +292 -0
- sumiki-0.1.0/PUBLISHING.md +140 -0
- sumiki-0.1.0/README.md +253 -0
- sumiki-0.1.0/examples/kb_with_agent.py +138 -0
- sumiki-0.1.0/examples/knowledge_base_basic.py +95 -0
- sumiki-0.1.0/examples/quickstart.py +105 -0
- sumiki-0.1.0/examples/simple_structured.py +45 -0
- sumiki-0.1.0/examples/structured_responses.py +195 -0
- sumiki-0.1.0/lyzr/__init__.py +69 -0
- sumiki-0.1.0/lyzr/agents.py +364 -0
- sumiki-0.1.0/lyzr/base.py +21 -0
- sumiki-0.1.0/lyzr/exceptions.py +76 -0
- sumiki-0.1.0/lyzr/http.py +305 -0
- sumiki-0.1.0/lyzr/inference.py +326 -0
- sumiki-0.1.0/lyzr/knowledge_base.py +945 -0
- sumiki-0.1.0/lyzr/models.py +474 -0
- sumiki-0.1.0/lyzr/protocols.py +126 -0
- sumiki-0.1.0/lyzr/providers.py +258 -0
- sumiki-0.1.0/lyzr/responses.py +134 -0
- sumiki-0.1.0/lyzr/structured.py +283 -0
- sumiki-0.1.0/lyzr/studio.py +111 -0
- sumiki-0.1.0/lyzr/vector_stores.py +149 -0
- sumiki-0.1.0/pyproject.toml +124 -0
- sumiki-0.1.0/uv.lock +1946 -0
sumiki-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual Environment
|
|
24
|
+
.venv/
|
|
25
|
+
venv/
|
|
26
|
+
ENV/
|
|
27
|
+
env/
|
|
28
|
+
|
|
29
|
+
# IDEs
|
|
30
|
+
.vscode/
|
|
31
|
+
.idea/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
*~
|
|
35
|
+
|
|
36
|
+
# Testing
|
|
37
|
+
.pytest_cache/
|
|
38
|
+
.coverage
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
|
|
42
|
+
# Build
|
|
43
|
+
*.whl
|
|
44
|
+
*.tar.gz
|
|
45
|
+
|
|
46
|
+
# OS
|
|
47
|
+
.DS_Store
|
|
48
|
+
Thumbs.db
|
|
49
|
+
|
|
50
|
+
# API docs and temp files
|
|
51
|
+
api_docs/
|
|
52
|
+
rag_docs/
|
|
53
|
+
*.json
|
|
54
|
+
!pyproject.toml
|
|
55
|
+
!package.json
|
|
56
|
+
|
|
57
|
+
# Examples environment
|
|
58
|
+
examples/.venv/
|
|
59
|
+
.env
|
|
60
|
+
t
|
sumiki-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lyzr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sumiki-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sumiki
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Intuitive Python SDK for Lyzr Agent API - Build AI agents with ease
|
|
5
|
+
Project-URL: Homepage, https://github.com/pradipta-lyzr/lyzr-sdk
|
|
6
|
+
Project-URL: Documentation, https://docs.lyzr.ai/sdk
|
|
7
|
+
Project-URL: Repository, https://github.com/pradipta-lyzr/lyzr-sdk
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/pradipta-lyzr/lyzr-sdk/issues
|
|
9
|
+
Author-email: Lyzr <support@lyzr.ai>
|
|
10
|
+
Maintainer-email: Lyzr <support@lyzr.ai>
|
|
11
|
+
License: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: agent,ai,anthropic,artificial-intelligence,chatbot,gemini,google,llm,lyzr,machine-learning,openai
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Requires-Python: >=3.8
|
|
26
|
+
Requires-Dist: httpx>=0.24.0
|
|
27
|
+
Requires-Dist: json-repair>=0.7.0
|
|
28
|
+
Requires-Dist: pydantic>=2.0.0
|
|
29
|
+
Requires-Dist: typing-extensions>=4.0.0; python_version < '3.10'
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: black>=23.0.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: ipython>=8.0.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
37
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# Lyzr SDK
|
|
41
|
+
|
|
42
|
+
[](https://www.python.org/downloads/)
|
|
43
|
+
[](https://opensource.org/licenses/MIT)
|
|
44
|
+
|
|
45
|
+
**The official Python SDK for Lyzr - Build production-ready AI agents in minutes**
|
|
46
|
+
|
|
47
|
+
Create powerful AI agents with a clean, intuitive API. Supports multiple LLM providers, knowledge bases (RAG), structured outputs, and streaming.
|
|
48
|
+
|
|
49
|
+
## ✨ Features
|
|
50
|
+
|
|
51
|
+
- 🚀 **Simple & Intuitive** - `agent.run("message")` - that's it!
|
|
52
|
+
- 🎯 **Type-Safe** - Full Pydantic v2 validation with autocomplete
|
|
53
|
+
- 🔌 **Modular** - Use what you need, extend what you want
|
|
54
|
+
- 🤖 **Multi-Provider** - OpenAI, Anthropic, Google, Groq, Perplexity, AWS Bedrock
|
|
55
|
+
- 📚 **Knowledge Bases** - Built-in RAG for documents, PDFs, websites
|
|
56
|
+
- 🎨 **Structured Outputs** - Type-safe responses with Pydantic models
|
|
57
|
+
- ⚡ **Streaming** - Real-time response streaming
|
|
58
|
+
- 📦 **Production-Ready** - Robust error handling, retries, validation
|
|
59
|
+
|
|
60
|
+
## 📦 Installation
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install sumiki
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 🔑 Getting Your API Key
|
|
67
|
+
|
|
68
|
+
Get your free API key from **[studio.lyzr.ai](https://studio.lyzr.ai)**
|
|
69
|
+
|
|
70
|
+
Set it as an environment variable:
|
|
71
|
+
```bash
|
|
72
|
+
export LYZR_API_KEY="your-api-key-here"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 🚀 Quick Start
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from lyzr import Studio
|
|
79
|
+
|
|
80
|
+
# Initialize (uses LYZR_API_KEY from environment)
|
|
81
|
+
studio = Studio()
|
|
82
|
+
|
|
83
|
+
# Or pass API key directly
|
|
84
|
+
studio = Studio(api_key="your-api-key-here")
|
|
85
|
+
|
|
86
|
+
# Create an agent
|
|
87
|
+
agent = studio.create_agent(
|
|
88
|
+
name="Customer Support Agent",
|
|
89
|
+
provider="openai/gpt-4o-mini"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# Run the agent
|
|
93
|
+
response = agent.run("What are your business hours?")
|
|
94
|
+
print(response.response)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 📖 Core Features
|
|
98
|
+
|
|
99
|
+
### 1. Smart Agents
|
|
100
|
+
|
|
101
|
+
Agents are intelligent objects with built-in methods:
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
# Create
|
|
105
|
+
agent = studio.create_agent(
|
|
106
|
+
name="Sales Assistant",
|
|
107
|
+
provider="openai/gpt-4o",
|
|
108
|
+
temperature=0.7
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
# Run
|
|
112
|
+
response = agent.run("Hello!")
|
|
113
|
+
|
|
114
|
+
# Stream
|
|
115
|
+
for chunk in agent.run("Tell me about your products", stream=True):
|
|
116
|
+
print(chunk.content, end="")
|
|
117
|
+
|
|
118
|
+
# Update
|
|
119
|
+
agent = agent.update(temperature=0.5)
|
|
120
|
+
|
|
121
|
+
# Clone
|
|
122
|
+
new_agent = agent.clone("Sales Assistant V2")
|
|
123
|
+
|
|
124
|
+
# Delete
|
|
125
|
+
agent.delete()
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 2. Structured Outputs with Pydantic
|
|
129
|
+
|
|
130
|
+
Get type-safe, validated responses:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from pydantic import BaseModel
|
|
134
|
+
from typing import Literal
|
|
135
|
+
|
|
136
|
+
class SentimentAnalysis(BaseModel):
|
|
137
|
+
sentiment: Literal["positive", "negative", "neutral"]
|
|
138
|
+
confidence: float
|
|
139
|
+
reasoning: str
|
|
140
|
+
|
|
141
|
+
agent = studio.create_agent(
|
|
142
|
+
name="Sentiment Analyzer",
|
|
143
|
+
provider="openai/gpt-4o",
|
|
144
|
+
response_model=SentimentAnalysis
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
# Get typed response
|
|
148
|
+
result: SentimentAnalysis = agent.run("I love this product!")
|
|
149
|
+
print(result.sentiment) # "positive" - fully typed!
|
|
150
|
+
print(result.confidence) # 0.95
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 3. Knowledge Bases (RAG)
|
|
154
|
+
|
|
155
|
+
Create knowledge bases and use them with agents:
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
# Create knowledge base
|
|
159
|
+
kb = studio.create_knowledge_base(
|
|
160
|
+
name="product_docs",
|
|
161
|
+
vector_store="qdrant"
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
# Add documents
|
|
165
|
+
kb.add_pdf("user_manual.pdf")
|
|
166
|
+
kb.add_docx("policies.docx")
|
|
167
|
+
kb.add_website("https://docs.mycompany.com", max_pages=50)
|
|
168
|
+
kb.add_text("FAQ: Business hours are 9am-5pm", source="faq.txt")
|
|
169
|
+
|
|
170
|
+
# Query directly
|
|
171
|
+
results = kb.query("How do I reset my password?", top_k=3)
|
|
172
|
+
|
|
173
|
+
# Use with agent at runtime
|
|
174
|
+
agent = studio.create_agent(
|
|
175
|
+
name="Support Bot",
|
|
176
|
+
provider="openai/gpt-4o"
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
response = agent.run(
|
|
180
|
+
"What are your business hours?",
|
|
181
|
+
knowledge_bases=[kb] # ← Pass KB at runtime
|
|
182
|
+
)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 4. Multiple Providers
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
# OpenAI
|
|
189
|
+
agent = studio.create_agent(name="Bot", provider="openai/gpt-4o")
|
|
190
|
+
|
|
191
|
+
# Anthropic
|
|
192
|
+
agent = studio.create_agent(name="Bot", provider="anthropic/claude-sonnet-4-5")
|
|
193
|
+
|
|
194
|
+
# Google
|
|
195
|
+
agent = studio.create_agent(name="Bot", provider="google/gemini-2.5-pro")
|
|
196
|
+
|
|
197
|
+
# Auto-detect provider
|
|
198
|
+
agent = studio.create_agent(name="Bot", provider="gpt-4o")
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## 🌟 Supported Models
|
|
202
|
+
|
|
203
|
+
### LLM Providers
|
|
204
|
+
- **OpenAI**: GPT-4o, GPT-5, o3, o4-mini
|
|
205
|
+
- **Anthropic**: Claude Sonnet 4.5, Claude Opus 4.5
|
|
206
|
+
- **Google**: Gemini 2.5 Pro, Gemini 3 Pro Preview
|
|
207
|
+
- **Groq**: Llama 3.3, Llama 4
|
|
208
|
+
- **Perplexity**: Sonar, Sonar Pro (with web search)
|
|
209
|
+
- **AWS Bedrock**: Amazon Nova, Claude via Bedrock
|
|
210
|
+
|
|
211
|
+
### Vector Stores (Knowledge Bases)
|
|
212
|
+
- Qdrant, Weaviate, PG-Vector, Milvus, Amazon Neptune
|
|
213
|
+
|
|
214
|
+
## 📚 Examples
|
|
215
|
+
|
|
216
|
+
See the `/examples` folder for complete working examples:
|
|
217
|
+
|
|
218
|
+
- `quickstart.py` - Basic agent creation and usage
|
|
219
|
+
- `structured_responses.py` - Pydantic models for typed outputs
|
|
220
|
+
- `knowledge_base_basic.py` - Creating and managing knowledge bases
|
|
221
|
+
- `kb_with_agent.py` - Using KBs with agents at runtime
|
|
222
|
+
|
|
223
|
+
## 🛠️ Advanced Usage
|
|
224
|
+
|
|
225
|
+
### Multiple Knowledge Bases
|
|
226
|
+
|
|
227
|
+
```python
|
|
228
|
+
products_kb = studio.create_knowledge_base(name="products")
|
|
229
|
+
policies_kb = studio.create_knowledge_base(name="policies")
|
|
230
|
+
|
|
231
|
+
# Use multiple KBs with custom config
|
|
232
|
+
response = agent.run(
|
|
233
|
+
"What's the refund policy for Product X?",
|
|
234
|
+
knowledge_bases=[
|
|
235
|
+
products_kb.with_config(top_k=5, score_threshold=0.8),
|
|
236
|
+
policies_kb.with_config(top_k=3, retrieval_type="mmr")
|
|
237
|
+
]
|
|
238
|
+
)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Session Management
|
|
242
|
+
|
|
243
|
+
```python
|
|
244
|
+
# Auto-generated session
|
|
245
|
+
response = agent.run("Hello")
|
|
246
|
+
|
|
247
|
+
# Explicit session for continuity
|
|
248
|
+
session_id = "user_123"
|
|
249
|
+
response1 = agent.run("Question 1", session_id=session_id)
|
|
250
|
+
response2 = agent.run("Follow-up", session_id=session_id)
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## 🐛 Error Handling
|
|
254
|
+
|
|
255
|
+
```python
|
|
256
|
+
from lyzr.exceptions import (
|
|
257
|
+
AuthenticationError,
|
|
258
|
+
ValidationError,
|
|
259
|
+
NotFoundError,
|
|
260
|
+
InvalidResponseError
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
try:
|
|
264
|
+
agent = studio.create_agent(name="Bot", provider="invalid/model")
|
|
265
|
+
except ValidationError as e:
|
|
266
|
+
print(f"Error: {e.message}")
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## 🤝 Contributing
|
|
270
|
+
|
|
271
|
+
Contributions welcome! Please submit a Pull Request.
|
|
272
|
+
|
|
273
|
+
## 📄 License
|
|
274
|
+
|
|
275
|
+
MIT License - see [LICENSE](LICENSE) file
|
|
276
|
+
|
|
277
|
+
## 🔗 Links
|
|
278
|
+
|
|
279
|
+
- **Get API Key**: [studio.lyzr.ai](https://studio.lyzr.ai)
|
|
280
|
+
- **Documentation**: [docs.lyzr.ai](https://docs.lyzr.ai)
|
|
281
|
+
- **GitHub**: [github.com/pradipta-lyzr/lyzr-sdk](https://github.com/pradipta-lyzr/lyzr-sdk)
|
|
282
|
+
- **PyPI**: [pypi.org/project/sumiki](https://pypi.org/project/sumiki)
|
|
283
|
+
- **Website**: [lyzr.ai](https://lyzr.ai)
|
|
284
|
+
|
|
285
|
+
## 💬 Support
|
|
286
|
+
|
|
287
|
+
- Email: support@lyzr.ai
|
|
288
|
+
- GitHub Issues: [github.com/pradipta-lyzr/lyzr-sdk/issues](https://github.com/pradipta-lyzr/lyzr-sdk/issues)
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
Built with ❤️ by [Lyzr](https://lyzr.ai)
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Publishing Sumiki (Lyzr SDK) to PyPI
|
|
2
|
+
|
|
3
|
+
**PyPI Package Name**: sumiki
|
|
4
|
+
**Import Name**: from lyzr import Studio
|
|
5
|
+
**Install**: pip install sumiki
|
|
6
|
+
|
|
7
|
+
## Quick Guide
|
|
8
|
+
|
|
9
|
+
### 1. Install Build Tools
|
|
10
|
+
```bash
|
|
11
|
+
uv pip install build twine
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### 2. Clean Previous Builds
|
|
15
|
+
```bash
|
|
16
|
+
rm -rf dist/ build/ *.egg-info
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 3. Build the Package
|
|
20
|
+
```bash
|
|
21
|
+
uv build
|
|
22
|
+
# Or: python3 -m build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This creates:
|
|
26
|
+
- `dist/sumiki-0.1.0.tar.gz`
|
|
27
|
+
- `dist/sumiki-0.1.0-py3-none-any.whl`
|
|
28
|
+
|
|
29
|
+
### 4. Check the Package
|
|
30
|
+
```bash
|
|
31
|
+
twine check dist/*
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 5. Upload to PyPI
|
|
35
|
+
|
|
36
|
+
**Option A: Using API Token**
|
|
37
|
+
```bash
|
|
38
|
+
# Set token as environment variable
|
|
39
|
+
export TWINE_USERNAME=__token__
|
|
40
|
+
export TWINE_PASSWORD=pypi-YOUR-API-TOKEN-HERE
|
|
41
|
+
|
|
42
|
+
# Upload
|
|
43
|
+
twine upload dist/*
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Option B: Interactive**
|
|
47
|
+
```bash
|
|
48
|
+
twine upload dist/*
|
|
49
|
+
# Username: __token__
|
|
50
|
+
# Password: pypi-YOUR-TOKEN
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 6. Verify Installation
|
|
54
|
+
```bash
|
|
55
|
+
pip install sumiki
|
|
56
|
+
python3 -c "from lyzr import Studio; print('Success!')"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Testing on TestPyPI First (Recommended)
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Upload to TestPyPI
|
|
65
|
+
twine upload --repository testpypi dist/*
|
|
66
|
+
|
|
67
|
+
# Test install
|
|
68
|
+
pip install --index-url https://test.pypi.org/simple/ sumiki
|
|
69
|
+
|
|
70
|
+
# Test it works
|
|
71
|
+
python3 -c "from lyzr import Studio; print('Works!')"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Complete Workflow
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# 1. Update version
|
|
80
|
+
# Edit pyproject.toml and lyzr/__init__.py
|
|
81
|
+
|
|
82
|
+
# 2. Clean and build
|
|
83
|
+
rm -rf dist/ build/ *.egg-info
|
|
84
|
+
uv build
|
|
85
|
+
|
|
86
|
+
# 3. Check
|
|
87
|
+
twine check dist/*
|
|
88
|
+
|
|
89
|
+
# 4. Test on TestPyPI (optional)
|
|
90
|
+
twine upload --repository testpypi dist/*
|
|
91
|
+
|
|
92
|
+
# 5. Upload to PyPI
|
|
93
|
+
export TWINE_USERNAME=__token__
|
|
94
|
+
export TWINE_PASSWORD=pypi-YOUR-TOKEN
|
|
95
|
+
twine upload dist/*
|
|
96
|
+
|
|
97
|
+
# 6. Test installation
|
|
98
|
+
pip install sumiki
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## PyPI Credentials
|
|
104
|
+
|
|
105
|
+
### Get API Token
|
|
106
|
+
1. Go to https://pypi.org/manage/account/
|
|
107
|
+
2. Scroll to "API tokens"
|
|
108
|
+
3. Click "Add API token"
|
|
109
|
+
4. Name: "lyzr-sdk"
|
|
110
|
+
5. Scope: "Entire account"
|
|
111
|
+
6. Copy the token (starts with `pypi-`)
|
|
112
|
+
|
|
113
|
+
### Configure ~/.pypirc (Optional)
|
|
114
|
+
```bash
|
|
115
|
+
cat > ~/.pypirc << 'EOF'
|
|
116
|
+
[pypi]
|
|
117
|
+
username = __token__
|
|
118
|
+
password = pypi-YOUR-TOKEN-HERE
|
|
119
|
+
EOF
|
|
120
|
+
|
|
121
|
+
chmod 600 ~/.pypirc
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Version Updates
|
|
127
|
+
|
|
128
|
+
Before each release, update version in:
|
|
129
|
+
1. `pyproject.toml` - `version = "0.1.1"`
|
|
130
|
+
2. `lyzr/__init__.py` - `__version__ = "0.1.1"`
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Package Name
|
|
135
|
+
|
|
136
|
+
- **PyPI Name**: `lyzr`
|
|
137
|
+
- **Import Name**: `from lyzr import Studio`
|
|
138
|
+
- **Install**: `pip install sumiki`
|
|
139
|
+
|
|
140
|
+
Done! 🎉
|