According to the documentation you can add filter in the definition of your class:
QString QFileDialog.getOpenFileName (QWidget parent = None, QString caption = QString(), QString directory = QString(), QString filter = QString(), Options options = 0)
So with your code it should looks like :
def filePath(title):
qfd = QFileDialog()
path = "D:\ennine\SIG HTB\BGN"
filter = "csv(*.csv)"
f = QFileDialog.getOpenFileName(qfd, title, path, filter)
return f
You can also add other filter. You need to separate them with a double ;; like so :
"Images (*.png *.xpm .jpg);;Text files (.txt);;XML files (*.xml)"