Commit cec5c5a
authored
Review and update docstrings for Admin class (#551)
# Improve Admin API Documentation
## Summary
This PR comprehensively reviews and updates all docstrings in the Admin
class and its child resource classes (ProjectResource, ApiKeyResource,
OrganizationResource) to ensure they follow RST formatting standards and
include comprehensive code-block usage examples. All docstrings now have
proper whitespace formatting around code blocks to ensure Sphinx renders
them correctly.
## Problem
The Admin API documentation had several issues:
- Some methods were missing code-block usage examples
- Alias methods (`get`, `describe`) lacked examples showing how to use
them
- Code blocks were missing empty lines after them, which can cause
Sphinx rendering issues
- Some examples had syntax errors (missing commas)
- The `__init__` method lacked usage examples showing different
initialization patterns
## Solution
- **Added comprehensive examples**: All methods now include code-block
examples demonstrating different ways to use each function
- **Fixed formatting**: Added empty lines after all code blocks to
ensure proper Sphinx rendering
- **Enhanced alias methods**: Added examples to `get()` and `describe()`
methods in all resource classes
- **Fixed syntax errors**: Corrected missing comma in project creation
example
- **Improved initialization docs**: Added examples showing environment
variable usage, explicit credentials, and additional headers
## User-Facing Impact
Users will now have:
- **Better discoverability**: Clear examples for every Admin API method,
including aliases
- **Multiple usage patterns**: Examples showing different ways to
accomplish the same task (e.g., using `project_id` vs `name`)
- **Properly rendered docs**: Code blocks will render correctly in
Sphinx-generated documentation
- **Complete coverage**: No methods are left without examples, making
the API easier to learn and use
## Usage Examples
### Before
```python
# Alias methods had no examples
admin.project.get(project_id="...") # No documentation example
```
### After
```python
# Now includes comprehensive examples
admin.project.get(project_id="42ca341d-43bf-47cb-9f27-e645dbfabea6")
# Shows both project_id and name usage patterns
```
### Initialization Examples
```python
# Environment variables
admin = Admin() # Reads from PINECONE_CLIENT_ID and PINECONE_CLIENT_SECRET
# Explicit credentials
admin = Admin(
client_id="your-client-id",
client_secret="your-client-secret"
)
# With additional headers
admin = Admin(
client_id="your-client-id",
client_secret="your-client-secret",
additional_headers={"X-Custom-Header": "value"}
)
```
## Breaking Changes
None. This is a documentation-only change that does not affect any API
functionality or behavior.1 parent db0418b commit cec5c5a
File tree
6 files changed
+265
-16
lines changed- pinecone
- admin
- resources
- inference
6 files changed
+265
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
61 | 101 | | |
62 | 102 | | |
63 | 103 | | |
| |||
149 | 189 | | |
150 | 190 | | |
151 | 191 | | |
152 | | - | |
| 192 | + | |
153 | 193 | | |
154 | 194 | | |
155 | 195 | | |
| |||
169 | 209 | | |
170 | 210 | | |
171 | 211 | | |
| 212 | + | |
172 | 213 | | |
173 | 214 | | |
174 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
112 | 134 | | |
113 | 135 | | |
114 | 136 | | |
115 | 137 | | |
116 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
117 | 160 | | |
118 | 161 | | |
119 | 162 | | |
| |||
204 | 247 | | |
205 | 248 | | |
206 | 249 | | |
| 250 | + | |
207 | 251 | | |
208 | 252 | | |
209 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| |||
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| |||
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| 179 | + | |
177 | 180 | | |
178 | 181 | | |
179 | 182 | | |
| |||
201 | 204 | | |
202 | 205 | | |
203 | 206 | | |
| 207 | + | |
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
| |||
256 | 260 | | |
257 | 261 | | |
258 | 262 | | |
| 263 | + | |
259 | 264 | | |
260 | 265 | | |
261 | 266 | | |
| |||
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
| 461 | + | |
456 | 462 | | |
457 | 463 | | |
458 | 464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
197 | 222 | | |
198 | 223 | | |
199 | 224 | | |
| |||
235 | 260 | | |
236 | 261 | | |
237 | 262 | | |
238 | | - | |
239 | | - | |
| 263 | + | |
240 | 264 | | |
241 | 265 | | |
242 | 266 | | |
| |||
275 | 299 | | |
276 | 300 | | |
277 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
278 | 334 | | |
279 | 335 | | |
280 | 336 | | |
| |||
302 | 358 | | |
303 | 359 | | |
304 | 360 | | |
305 | | - | |
306 | | - | |
| 361 | + | |
307 | 362 | | |
308 | 363 | | |
309 | 364 | | |
| |||
339 | 394 | | |
340 | 395 | | |
341 | 396 | | |
342 | | - | |
343 | | - | |
344 | 397 | | |
345 | 398 | | |
346 | 399 | | |
| |||
371 | 424 | | |
372 | 425 | | |
373 | 426 | | |
| 427 | + | |
374 | 428 | | |
375 | 429 | | |
0 commit comments