๐Ÿ py-dss-interface: Python Control for OpenDSS Powered by EPRI๏ƒ

PyPI Platform License AppVeyor

py-dss-interface is a Python package endorsed by EPRI to control OpenDSS Powered by EPRI using the Python programming language. This tool is actively used across multiple EPRI research projects and by many utilities and consultants. It also serves as the foundation for the automated testing process of OpenDSS itself.


๐Ÿš€ What Can You Do With py-dss-interface?๏ƒ

Use the full power of Python to control and automate your OpenDSS workflows:

  • โš™๏ธ Automate repetitive OpenDSS tasks.

  • ๐Ÿง  Manipulate circuit, element, and bus properties with Python logic.

  • ๐Ÿ“Š Extract simulation results and generate custom reports.

  • ๐Ÿงฎ Implement advanced analysis and algorithms using Python.


๐Ÿ”„ Why Use py-dss-interface Instead of the COM Interface?๏ƒ

Compared to the COM interface, py-dss-interface provides a modern, Pythonic experience:

  • ๐Ÿ’ก Code Completion: Works seamlessly with IDEs like PyCharm for better developer productivity.

  • ๐Ÿ“ฆ No OpenDSS Installation Required (Windows): No need to install OpenDSS since py-dss-interface comes bundled with a tested version of OpenDSS. However, you may also use a different OpenDSS version if desired. Please note that compatibility is only guaranteed for the bundled version.

  • ๐Ÿ”„ Supports Multiple DSS Objects: Interact with multiple OpenDSS objects at the same time.

  • ๐ŸŒ Multi-Platform: Supports both Windows and now Linux (via local OpenDSS C++ build).

  • โšก Better Performance: Some examples comparing performance will be provided later.

  • ๐Ÿ” Version Control Friendly (Windows): Avoid breaking your Python code when updating the OpenDSS version on your computer.


๐Ÿ’ป Platform Support๏ƒ

โœ… Windows๏ƒ

pip install py-dss-interface

๐Ÿง Linux (OpenDSS C++ Build Required)๏ƒ

To use py-dss-interface on Linux, youโ€™ll need to build the OpenDSS C++ engine locally:

  1. Clone this repository:

    git clone https://github.com/PauloRadatz/py_dss_interface.git
    cd py_dss_interface
    
  2. Run the setup script:

    cd py_dss_interface
    bash OpenDSSLinuxCPPForRepo.sh
    
  3. Install the package:

    pip install -e .
    

    Or if you donโ€™t need editable mode:

    pip install .
    

๐Ÿ“Œ Note: You will need tools for building C++ code on your system (e.g., g++, cmake, etc.) to compile the OpenDSS engine locally.


๐Ÿ“ฆ Quickstart Example๏ƒ

import py_dss_interface

dss = py_dss_interface.DSS()
dss.text("compile path/to/circuit.dss")
dss.text("solve")
print(dss.circuit.total_power)

๐Ÿ“– Documentation๏ƒ

๐Ÿ“– Full documentation available at: ๐Ÿ‘‰ https://py-dss-interface.readthedocs.io/en/latest/


๐ŸŽ“ Learn More๏ƒ

๐Ÿ“˜ Comprehensive Online Course๏ƒ

The best way to master py-dss-interface is through the official course:

๐Ÿ‘‰ Try the first modules for free

๐Ÿ“บ YouTube Playlists๏ƒ


๐Ÿงฉ Tools Built on py-dss-interface๏ƒ

  • ๐Ÿ“ˆ OpenDER_Interface: EPRIโ€™s tool for Distributed Energy Resource simulation and control, powered by py-dss-interface. More on OpenDER: GitHub

  • ๐Ÿ“Š 2023 Hosting Capacity Webinar: Examples shown using this package.

  • ๐Ÿ”ง py-dss-tools: A new package built on top of py-dss-interface, coming soon to PyPI.


๐Ÿ“‚ Where to Find Examples๏ƒ

  • ๐Ÿ“ OpenDSS Repository

  • ๐Ÿ“ Local Installation: After installing OpenDSS in your Windows computer, navigate to: C:\\Program Files\\OpenDSS\\Examples\\Python\\py-dss-interface


๐Ÿค Community and Support๏ƒ

  • ๐Ÿ’ฌ Open an Issue on GitHub for bugs or feature requests.

  • ๐Ÿ™Œ Contributions welcome! Please open a pull request with clear descriptions.

  • ๐Ÿ’ป Questions? Join discussions in the OpenDSS user forums or comment on relevant YouTube videos.


๐Ÿ“š How to Cite๏ƒ

If you use py-dss-interface in your academic work, please reference it as follows:

APA Style:

Radatz, P. (2025). py-dss-interface: A Python package that interfaces with OpenDSS powered by EPRI (Version X.X.X) [Computer software]. GitHub. https://github.com/PauloRadatz/py_dss_interface

BibTeX Entry:

@software{radatz2024bdgd2opendss,
  author = {Paulo Radatz},
  title = {py-dss-interface: A Python package that interfaces with OpenDSS powered by EPRI},
  year = {2025},
  version = {X.X.X},
  url = {https://github.com/PauloRadatz/py_dss_interface}
}

๐Ÿ“Œ Please replace X.X.X with the version of the package you are using.


๐Ÿ™ Acknowledgements๏ƒ

Developed and maintained by Paulo Radatz, with support from EPRI and the global OpenDSS community.

Special thanks to รŠnio Viana and Rodolfo Pilar Londero for their contributions to the first version of this tool.