import yaml


def read_config(filename):
	"""Read .yaml config file

	robot:
		gap: 0
		gap_ignore: 0
		amount: 0
	exchange:
  		client_id: ''
  		client_secret: ''
  		uri: ''
  		instrument: ''	
	
	Args:
		filename (string): configuration file name

	Returns:
		dict: dict with parameters
	"""
	with open(filename) as file:
		try:
			confs = yaml.safe_load(file)
			return confs
		except yaml.YAMLError as e:
			print("Read config file error: {}".format(e))