Hello Siham, you need to use the service credentials that you can generate by entering Cloudant.
You will need to reference the username and apikey afterwards. Pls see the code below, it is an example of how to connect to Cloudant and create a pandas data frame.
Hope this helps.
Massimo
.... And here a function to create new records in cloudant
# =============================================================================
# DB data writing (recording the new record in Cloudant)
# =============================================================================
def db_data_writing(credential:dict, db_name:str, files:dict):
"""
DB data writing
This function reach the online database and write the input files as a new document
Parameters
----------
credential: dict
credential to access the online Cloudant database instance
db_name: str
name of the database on which write data
files: dict
json containing data to write on db
Returns
-------
bool
exit status
"""
# Feed credential and establish a connection
client = Cloudant.iam(credential["username"],credential["apikey"],connect=True)
# Select the database instance on which write results
db = client[db_name]
# write and save document
db.create_document(files).save()
# shutdown the connection
client.disconnect()------------------------------
Massimo Loaldi
------------------------------