The increasing demand of power and the need to reduce our dependency on fossil resources represent an opportunity to valorise low-to-medium grade heat streams such as mild hot streams from industry and natural brines into electricity. A systematic approach is required for the simultaneous selection of thermodynamic cycle which includes its configuration, the thermal fluid, and the optimal operating conditions. A methodology that integrates heuristics, for pre-screening, machine learning, to include rigorous thermodynamics, and mathematical optimization, for process flowsheet design is proposed. The pre-screening yields three fluids, benzene, toluene and 1,1,1,2,3,3,3-heptafluoropropane (R227ea) and two promising cycles, dual pressure organic Rankine cycle (ORC) and organic flash Rankine cycle (OFRC). The mathematical optimization shows that for temperatures over 120 degrees C, the OFRC using Benzene is the configuration of choice in terms of thermodynamic performance, but the ORC provides the most economical electricity. For hot resources below 120 degrees C, the efficiency of both cycles converges, but the best fluid turns out to be R227ea alongside the dual ORC cycle showing better performance and lower cost. The cooling costs present a minimum at Delta T-min equal to 8 degrees C. The results on process design are used to evaluate a exploitation of geothermal resources across Spain.