1- # Pinecone Python SDK
1+ # Pinecone Python SDK
2+
23![ License] ( https://img.shields.io/github/license/pinecone-io/pinecone-python-client?color=orange ) [ ![ CI] ( https://github.com/pinecone-io/pinecone-python-client/actions/workflows/pr.yaml/badge.svg )] ( https://github.com/pinecone-io/pinecone-python-client/actions/workflows/pr.yaml )
34
45The official Pinecone Python SDK.
@@ -193,9 +194,7 @@ index.upsert(vectors=[])
193194index.query(vector = [... ], top_key = 10 )
194195```
195196
196- # Indexes
197-
198- ## Create Index
197+ ## Indexes
199198
200199### Create a serverless index
201200
@@ -264,7 +263,7 @@ pc.create_index(
264263)
265264```
266265
267- ## List indexes
266+ ### List indexes
268267
269268The following example returns all indexes in your project.
270269
@@ -276,7 +275,7 @@ for index in pc.list_indexes():
276275 print (index[' name' ])
277276```
278277
279- ## Describe index
278+ ### Describe index
280279
281280The following example returns information about the index ` example-index ` .
282281
@@ -288,7 +287,7 @@ pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
288287index_description = pc.describe_index(" example-index" )
289288```
290289
291- ## Delete an index
290+ ### Delete an index
292291
293292The following example deletes the index named ` example-index ` . Only indexes which are not protected by deletion protection may be deleted.
294293
@@ -300,7 +299,7 @@ pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
300299pc.delete_index(" example-index" )
301300```
302301
303- ## Scale replicas
302+ ### Scale replicas
304303
305304The following example changes the number of replicas for ` example-index ` .
306305
@@ -313,7 +312,7 @@ new_number_of_replicas = 4
313312pc.configure_index(" example-index" , replicas = new_number_of_replicas)
314313```
315314
316- ## Configuring deletion protection
315+ ### Configuring deletion protection
317316
318317If you would like to enable deletion protection, which prevents an index from being deleted, the ` configure_index ` method also handles that via an optional ` deletion_protection ` keyword argument.
319318
@@ -333,7 +332,7 @@ desc = pc.describe_index("example-index")
333332print (desc.deletion_protection)
334333```
335334
336- ## Describe index statistics
335+ ### Describe index statistics
337336
338337The following example returns statistics about the index ` example-index ` .
339338
@@ -347,7 +346,7 @@ index = pc.Index(host=os.environ.get('INDEX_HOST'))
347346index_stats_response = index.describe_index_stats()
348347```
349348
350- ## Upsert vectors
349+ ### Upsert vectors
351350
352351The following example upserts vectors to ` example-index ` .
353352
@@ -367,7 +366,7 @@ upsert_response = index.upsert(
367366)
368367```
369368
370- ## Query an index
369+ ### Query an index
371370
372371The following example queries the index ` example-index ` with metadata
373372filtering.
@@ -394,7 +393,7 @@ query_response = index.query(
394393)
395394```
396395
397- ## Delete vectors
396+ ### Delete vectors
398397
399398The following example deletes vectors by ID.
400399
@@ -411,7 +410,7 @@ index = pc.Index(host=os.environ.get('INDEX_HOST'))
411410delete_response = index.delete(ids = [" vec1" , " vec2" ], namespace = " example-namespace" )
412411```
413412
414- ## Fetch vectors
413+ ### Fetch vectors
415414
416415The following example fetches vectors by ID.
417416
@@ -428,7 +427,7 @@ index = pc.Index(host=os.environ.get('INDEX_HOST'))
428427fetch_response = index.fetch(ids = [" vec1" , " vec2" ], namespace = " example-namespace" )
429428```
430429
431- ## Update vectors
430+ ### Update vectors
432431
433432The following example updates vectors by ID.
434433
@@ -449,7 +448,7 @@ update_response = index.update(
449448)
450449```
451450
452- ## List vectors
451+ ### List vectors
453452
454453The ` list ` and ` list_paginated ` methods can be used to list vector ids matching a particular id prefix.
455454With clever assignment of vector ids, this can be used to help model hierarchical relationships between
@@ -494,9 +493,9 @@ print(results.pagination.next) # 'eyJza2lwX3Bhc3QiOiI5IiwicHJlZml4IjpudWxsfQ=='
494493print (results.usage) # { 'read_units': 1 }
495494```
496495
497- # Collections
496+ ## Collections
498497
499- ## Create collection
498+ ### Create collection
500499
501500The following example creates the collection ` example-collection ` from
502501` example-index ` .
@@ -512,7 +511,7 @@ pc.create_collection(
512511)
513512```
514513
515- ## List collections
514+ ### List collections
516515
517516The following example returns a list of the collections in the current project.
518517
@@ -524,7 +523,7 @@ pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
524523active_collections = pc.list_collections()
525524```
526525
527- ## Describe a collection
526+ ### Describe a collection
528527
529528The following example returns a description of the collection
530529` example-collection ` .
@@ -537,7 +536,7 @@ pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
537536collection_description = pc.describe_collection(" example-collection" )
538537```
539538
540- ## Delete a collection
539+ ### Delete a collection
541540
542541The following example deletes the collection ` example-collection ` .
543542
@@ -549,7 +548,7 @@ pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
549548pc.delete_collection(" example-collection" )
550549```
551550
552- # Inference API
551+ ## Inference API
553552
554553The Pinecone SDK now supports creating embeddings via the [ Inference API] ( https://docs.pinecone.io/guides/inference/understanding-inference ) .
555554
@@ -583,6 +582,6 @@ query_embeddings = pc.inference.embed(
583582# Send query to Pinecone index to retrieve similar documents
584583```
585584
586- # Contributing
585+ ## Contributing
587586
588587If you'd like to make a contribution, or get setup locally to develop the Pinecone Python SDK, please see our [ contributing guide] ( https://github.com/pinecone-io/pinecone-python-client/blob/main/CONTRIBUTING.md )
0 commit comments