pinecone 2.2.2__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.
@@ -0,0 +1,294 @@
1
+ Metadata-Version: 2.1
2
+ Name: pinecone
3
+ Version: 2.2.2
4
+ Summary: Pinecone client and SDK
5
+ Home-page: https://www.pinecone.io
6
+ Keywords: Pinecone,vector,database,cloud
7
+ Author: Pinecone Systems, Inc.
8
+ Author-email: support@pinecone.io
9
+ Requires-Python: >=3.8,<4.0
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Information Technology
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Intended Audience :: System Administrators
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Operating System :: OS Independent
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 :: Database
24
+ Classifier: Topic :: Software Development
25
+ Classifier: Topic :: Software Development :: Libraries
26
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
27
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
+ Requires-Dist: pinecone-client (==2.2.2)
29
+ Project-URL: Documentation, https://pinecone.io/docs
30
+ Description-Content-Type: text/markdown
31
+
32
+ # pinecone-client
33
+ The Pinecone python client
34
+
35
+ For more information, see the docs at https://www.pinecone.io/docs/
36
+
37
+ ## Installation
38
+
39
+ Install a released version from pip:
40
+ ```shell
41
+ pip3 install pinecone-client
42
+ ```
43
+
44
+ Or the gRPC version of the client for [tuning performance](https://docs.pinecone.io/docs/performance-tuning)
45
+
46
+ ```shell
47
+ pip3 install "pinecone-client[grpc]"
48
+ ```
49
+
50
+ Or the latest development version:
51
+ ```shell
52
+ pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git
53
+ ```
54
+
55
+ Or a specific development version:
56
+ ```shell
57
+ pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git
58
+ pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git@example-branch-name
59
+ pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git@259deff
60
+ ```
61
+
62
+ ## Creating an index
63
+
64
+ The following example creates an index without a metadata
65
+ configuration. By default, Pinecone indexes all metadata.
66
+
67
+ ```python
68
+
69
+ import pinecone
70
+
71
+
72
+ pinecone.init(api_key="YOUR_API_KEY",
73
+ environment="us-west1-gcp")
74
+
75
+ pinecone.create_index("example-index", dimension=1024)
76
+ ```
77
+
78
+ The following example creates an index that only indexes
79
+ the "color" metadata field. Queries against this index
80
+ cannot filter based on any other metadata field.
81
+
82
+ ```python
83
+ metadata_config = {
84
+ "indexed": ["color"]
85
+ }
86
+
87
+ pinecone.create_index("example-index-2", dimension=1024,
88
+ metadata_config=metadata_config)
89
+ ```
90
+
91
+ ## List indexes
92
+
93
+ The following example returns all indexes in your project.
94
+
95
+ ```python
96
+ import pinecone
97
+
98
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
99
+
100
+ active_indexes = pinecone.list_indexes()
101
+ ```
102
+
103
+ ## Describe index
104
+
105
+ The following example returns information about the index `example-index`.
106
+
107
+ ```python
108
+ import pinecone
109
+
110
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
111
+
112
+ index_description = pinecone.describe_index("example-index")
113
+
114
+ ```
115
+
116
+ ## Delete an index
117
+
118
+ The following example deletes `example-index`.
119
+
120
+ ```python
121
+ import pinecone
122
+
123
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
124
+
125
+ pinecone.delete_index("example-index")
126
+ ```
127
+
128
+ ## Scale replicas
129
+
130
+ The following example changes the number of replicas for `example-index`.
131
+
132
+ ```python
133
+ import pinecone
134
+
135
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
136
+
137
+ new_number_of_replicas = 4
138
+ pinecone.configure_index("example-index", replicas=new_number_of_replicas)
139
+ ```
140
+
141
+ ## Describe index statistics
142
+
143
+ The following example returns statistics about the index `example-index`.
144
+
145
+ ```python
146
+ import pinecone
147
+
148
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
149
+ index = pinecone.Index("example-index")
150
+
151
+ index_stats_response = index.describe_index_stats()
152
+ ```
153
+
154
+
155
+ ## Upsert vectors
156
+
157
+ The following example upserts vectors to `example-index`.
158
+
159
+ ```python
160
+ import pinecone
161
+
162
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
163
+ index = pinecone.Index("example-index")
164
+
165
+ upsert_response = index.upsert(
166
+ vectors=[
167
+ ("vec1", [0.1, 0.2, 0.3, 0.4], {"genre": "drama"}),
168
+ ("vec2", [0.2, 0.3, 0.4, 0.5], {"genre": "action"}),
169
+ ],
170
+ namespace="example-namespace"
171
+ )
172
+ ```
173
+
174
+ ## Query an index
175
+
176
+ The following example queries the index `example-index` with metadata
177
+ filtering.
178
+
179
+ ```python
180
+ import pinecone
181
+
182
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
183
+ index = pinecone.Index("example-index")
184
+
185
+ query_response = index.query(
186
+ namespace="example-namespace",
187
+ top_k=10,
188
+ include_values=True,
189
+ include_metadata=True,
190
+ vector=[0.1, 0.2, 0.3, 0.4],
191
+ filter={
192
+ "genre": {"$in": ["comedy", "documentary", "drama"]}
193
+ }
194
+ )
195
+ ```
196
+
197
+ ## Delete vectors
198
+
199
+ The following example deletes vectors by ID.
200
+
201
+ ```python
202
+ import pinecone
203
+
204
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
205
+ index = pinecone.Index("example-index")
206
+
207
+ delete_response = index.delete(ids=["vec1", "vec2"], namespace="example-namespace")
208
+ ```
209
+
210
+ ## Fetch vectors
211
+
212
+ The following example fetches vectors by ID.
213
+
214
+ ```python
215
+ import pinecone
216
+
217
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
218
+ index = pinecone.Index("example-index")
219
+
220
+ fetch_response = index.fetch(ids=["vec1", "vec2"], namespace="example-namespace")
221
+ ```
222
+
223
+
224
+ ## Update vectors
225
+
226
+ The following example updates vectors by ID.
227
+
228
+ ```python
229
+ import pinecone
230
+
231
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
232
+ index = pinecone.Index("example-index")
233
+
234
+ update_response = index.update(
235
+ id="vec1",
236
+ values=[0.1, 0.2, 0.3, 0.4],
237
+ set_metadata={"genre": "drama"},
238
+ namespace="example-namespace"
239
+ )
240
+ ```
241
+
242
+ ## Create collection
243
+
244
+ The following example creates the collection `example-collection` from
245
+ `example-index`.
246
+
247
+ ```python
248
+ import pinecone
249
+
250
+ pinecone.init(api_key="YOUR_API_KEY",
251
+ environment="us-west1-gcp")
252
+
253
+ pinecone.create_collection("example-collection", "example-index")
254
+ ```
255
+
256
+ ## List collections
257
+
258
+ The following example returns a list of the collections in the current project.
259
+
260
+ ```python
261
+ import pinecone
262
+
263
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
264
+
265
+ active_collections = pinecone.list_collections()
266
+ ```
267
+
268
+ ## Describe a collection
269
+
270
+ The following example returns a description of the collection
271
+ `example-collection`.
272
+
273
+ ```python
274
+ import pinecone
275
+
276
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
277
+
278
+ collection_description = pinecone.describe_collection("example-collection")
279
+ ```
280
+
281
+ ## Delete a collection
282
+
283
+ The following example deletes the collection `example-collection`.
284
+
285
+ ```python
286
+ import pinecone
287
+
288
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
289
+
290
+ pinecone.delete_collection("example-collection")
291
+ ```
292
+
293
+
294
+
@@ -0,0 +1,262 @@
1
+ # pinecone-client
2
+ The Pinecone python client
3
+
4
+ For more information, see the docs at https://www.pinecone.io/docs/
5
+
6
+ ## Installation
7
+
8
+ Install a released version from pip:
9
+ ```shell
10
+ pip3 install pinecone-client
11
+ ```
12
+
13
+ Or the gRPC version of the client for [tuning performance](https://docs.pinecone.io/docs/performance-tuning)
14
+
15
+ ```shell
16
+ pip3 install "pinecone-client[grpc]"
17
+ ```
18
+
19
+ Or the latest development version:
20
+ ```shell
21
+ pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git
22
+ ```
23
+
24
+ Or a specific development version:
25
+ ```shell
26
+ pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git
27
+ pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git@example-branch-name
28
+ pip3 install git+https://git@github.com/pinecone-io/pinecone-python-client.git@259deff
29
+ ```
30
+
31
+ ## Creating an index
32
+
33
+ The following example creates an index without a metadata
34
+ configuration. By default, Pinecone indexes all metadata.
35
+
36
+ ```python
37
+
38
+ import pinecone
39
+
40
+
41
+ pinecone.init(api_key="YOUR_API_KEY",
42
+ environment="us-west1-gcp")
43
+
44
+ pinecone.create_index("example-index", dimension=1024)
45
+ ```
46
+
47
+ The following example creates an index that only indexes
48
+ the "color" metadata field. Queries against this index
49
+ cannot filter based on any other metadata field.
50
+
51
+ ```python
52
+ metadata_config = {
53
+ "indexed": ["color"]
54
+ }
55
+
56
+ pinecone.create_index("example-index-2", dimension=1024,
57
+ metadata_config=metadata_config)
58
+ ```
59
+
60
+ ## List indexes
61
+
62
+ The following example returns all indexes in your project.
63
+
64
+ ```python
65
+ import pinecone
66
+
67
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
68
+
69
+ active_indexes = pinecone.list_indexes()
70
+ ```
71
+
72
+ ## Describe index
73
+
74
+ The following example returns information about the index `example-index`.
75
+
76
+ ```python
77
+ import pinecone
78
+
79
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
80
+
81
+ index_description = pinecone.describe_index("example-index")
82
+
83
+ ```
84
+
85
+ ## Delete an index
86
+
87
+ The following example deletes `example-index`.
88
+
89
+ ```python
90
+ import pinecone
91
+
92
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
93
+
94
+ pinecone.delete_index("example-index")
95
+ ```
96
+
97
+ ## Scale replicas
98
+
99
+ The following example changes the number of replicas for `example-index`.
100
+
101
+ ```python
102
+ import pinecone
103
+
104
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
105
+
106
+ new_number_of_replicas = 4
107
+ pinecone.configure_index("example-index", replicas=new_number_of_replicas)
108
+ ```
109
+
110
+ ## Describe index statistics
111
+
112
+ The following example returns statistics about the index `example-index`.
113
+
114
+ ```python
115
+ import pinecone
116
+
117
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
118
+ index = pinecone.Index("example-index")
119
+
120
+ index_stats_response = index.describe_index_stats()
121
+ ```
122
+
123
+
124
+ ## Upsert vectors
125
+
126
+ The following example upserts vectors to `example-index`.
127
+
128
+ ```python
129
+ import pinecone
130
+
131
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
132
+ index = pinecone.Index("example-index")
133
+
134
+ upsert_response = index.upsert(
135
+ vectors=[
136
+ ("vec1", [0.1, 0.2, 0.3, 0.4], {"genre": "drama"}),
137
+ ("vec2", [0.2, 0.3, 0.4, 0.5], {"genre": "action"}),
138
+ ],
139
+ namespace="example-namespace"
140
+ )
141
+ ```
142
+
143
+ ## Query an index
144
+
145
+ The following example queries the index `example-index` with metadata
146
+ filtering.
147
+
148
+ ```python
149
+ import pinecone
150
+
151
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
152
+ index = pinecone.Index("example-index")
153
+
154
+ query_response = index.query(
155
+ namespace="example-namespace",
156
+ top_k=10,
157
+ include_values=True,
158
+ include_metadata=True,
159
+ vector=[0.1, 0.2, 0.3, 0.4],
160
+ filter={
161
+ "genre": {"$in": ["comedy", "documentary", "drama"]}
162
+ }
163
+ )
164
+ ```
165
+
166
+ ## Delete vectors
167
+
168
+ The following example deletes vectors by ID.
169
+
170
+ ```python
171
+ import pinecone
172
+
173
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
174
+ index = pinecone.Index("example-index")
175
+
176
+ delete_response = index.delete(ids=["vec1", "vec2"], namespace="example-namespace")
177
+ ```
178
+
179
+ ## Fetch vectors
180
+
181
+ The following example fetches vectors by ID.
182
+
183
+ ```python
184
+ import pinecone
185
+
186
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
187
+ index = pinecone.Index("example-index")
188
+
189
+ fetch_response = index.fetch(ids=["vec1", "vec2"], namespace="example-namespace")
190
+ ```
191
+
192
+
193
+ ## Update vectors
194
+
195
+ The following example updates vectors by ID.
196
+
197
+ ```python
198
+ import pinecone
199
+
200
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
201
+ index = pinecone.Index("example-index")
202
+
203
+ update_response = index.update(
204
+ id="vec1",
205
+ values=[0.1, 0.2, 0.3, 0.4],
206
+ set_metadata={"genre": "drama"},
207
+ namespace="example-namespace"
208
+ )
209
+ ```
210
+
211
+ ## Create collection
212
+
213
+ The following example creates the collection `example-collection` from
214
+ `example-index`.
215
+
216
+ ```python
217
+ import pinecone
218
+
219
+ pinecone.init(api_key="YOUR_API_KEY",
220
+ environment="us-west1-gcp")
221
+
222
+ pinecone.create_collection("example-collection", "example-index")
223
+ ```
224
+
225
+ ## List collections
226
+
227
+ The following example returns a list of the collections in the current project.
228
+
229
+ ```python
230
+ import pinecone
231
+
232
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
233
+
234
+ active_collections = pinecone.list_collections()
235
+ ```
236
+
237
+ ## Describe a collection
238
+
239
+ The following example returns a description of the collection
240
+ `example-collection`.
241
+
242
+ ```python
243
+ import pinecone
244
+
245
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
246
+
247
+ collection_description = pinecone.describe_collection("example-collection")
248
+ ```
249
+
250
+ ## Delete a collection
251
+
252
+ The following example deletes the collection `example-collection`.
253
+
254
+ ```python
255
+ import pinecone
256
+
257
+ pinecone.init(api_key="YOUR_API_KEY", environment="us-west1-gcp")
258
+
259
+ pinecone.delete_collection("example-collection")
260
+ ```
261
+
262
+
@@ -0,0 +1 @@
1
+ from pinecone import *
@@ -0,0 +1,40 @@
1
+ [tool.poetry]
2
+ name = "pinecone"
3
+ version = "2.2.2"
4
+ readme = "README.md"
5
+ description = "Pinecone client and SDK"
6
+ authors = ["Pinecone Systems, Inc. <support@pinecone.io>"]
7
+ homepage = "https://www.pinecone.io"
8
+ documentation = "https://pinecone.io/docs"
9
+ keywords = ["Pinecone", "vector", "database", "cloud"]
10
+ packages = [
11
+ { include="pinecone_backfill"}
12
+ ]
13
+ classifiers=[
14
+ "License :: OSI Approved :: Apache Software License",
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Intended Audience :: Developers",
17
+ "Intended Audience :: Information Technology",
18
+ "Intended Audience :: Science/Research",
19
+ "Intended Audience :: System Administrators",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3.8",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Topic :: Database",
27
+ "Topic :: Software Development",
28
+ "Topic :: Software Development :: Libraries",
29
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
30
+ "Topic :: Software Development :: Libraries :: Python Modules"
31
+ ]
32
+
33
+ [tool.poetry.dependencies]
34
+ python = "^3.8"
35
+ pinecone-client = "2.2.2"
36
+
37
+
38
+ [build-system]
39
+ requires = ["poetry-core"]
40
+ build-backend = "poetry.core.masonry.api"