The Internet of Things (IoT) envisions to connect Advanced Metering Infrastructure (AMI) to the Internet to facilitate efficient resource management in smart cities. Smart grid is the evolutionary approach towards a more dynamic, situation‐aware, and elastic power systems in smart cities. However, due to the huge scale, heterogeneity and complexity of the many interconnected cyber and physical devices, current network and security technologies are incapable of best serving these needs. Destructive attacks targeting these components such as Denial of Service (DoS) may fully use grid structure and disrupt its crucial service. Recent researches offer the use of modern Software Defined Networking (SDN) to solve synonymous Cyber Physical Systems (CPS) network and security challenges. These researches noted the lack of an adequate platform to simulate grid systems network infrastructure. Therefore, in this paper, we present PYGRID, a software development and assessment framework for grid‐aware SDN. Additionally, a top level SDN application is developed in SDN‐enabled smart grid network to demonstrate the effectiveness of such merger and to mitigate DoS attacks. PYGRID is developed using PYTHON, an OSI‐approved open source language considering standard client and server industrial communication protocols. IEEE 14‐bus power system is adopted to demonstrate the potent and effectiveness of the proposed solution. We conducted multiple experiments to validate the developed framework over 14‐bus system using PYPOWER. To the best of our knowledge, the resulted platform may be considered the first completely open source implementation of a secure SDN enabled smart grid simulator.