Shopify Python API: How do I add a product to a collection?
The documentation is again not promising but one thing to bear in mind is that there should in actual fact be an existing collection already created
Find it by using this code
collection_id = shopify.CustomCollection.find(handle=<your_handle>)[0].id
then consequently add the collection_id, product_id to a Collect object and save, remember to first save your product (or have an existing one which you can find) and then only save your collection, or else the collection won't know what product its posting to (via the api), like so
new_product = shopify.Product()
new_product.save()
add_collection = shopify.Collect('product_id': new_product.id, 'collection_id': collection_id})
add_collection.save()
Also important to note that there is a 1 to 1 relationship between Product and Collect
I am using the Shopify Python API in an django app to interact with my Shopify Store. 
I have a collection - called - best sellers.
I am looking to create a batch update to this collection - that is add/remove products to this collection. However, they python API docs does not seem to say much about how to do so. How do I fetch a collection by name? How do I add a product to it?
Thank you for your help.

This is what I found



x=shopify.CustomCollection.find(handle="best-sellers")
y=shopify.Collect() #creates a new collect
p = shopify.Product.find(118751076) # gets me the product



So the questions is how do I add the product "p" above to the Custom Collection "x" ?