Skip to main content

🐍 py-dss-interface: Python Control for OpenDSS Powered by EPRI

PyPI Platform License AppVeyor PyPI Downloads

py-dss-interface is a Python package to control OpenDSS Powered by EPRI — the official EPRI-maintained distribution of OpenDSS — using the Python programming language. It is designed to work with OpenDSS Powered by EPRI only. This tool is actively used across multiple EPRI research projects and by utilities and consultants, and it also serves as a foundation for automated testing workflows for OpenDSS.


🚀 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: No need to install OpenDSS since py-dss-interface comes bundled with a tested version of OpenDSS (Windows and Linux). 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 Linux (pre-built wheels available; build from source if needed).
  • ⚡ Better Performance: Some examples comparing performance will be provided later.
  • 🔐 Version Control Friendly: Avoid breaking your Python code when updating the OpenDSS version on your computer.

💻 Platform Support

✅ Windows

pip install py-dss-interface

🐧 Linux

Pre-built wheels are available for x86_64 and ARM64. Start with pip install:

pip install py-dss-interface

If pip install doesn't work for your environment, you can build from source as described below.

🔧 Build from source (fallback)

To use py-dss-interface on Linux, you'll need to build the OpenDSS C++ engine locally using OpenDSSLinuxCPPForRepo.sh.

  1. Clone the repository

    git clone https://github.com/PauloRadatz/py_dss_interface.git
    cd py_dss_interface
    
  2. Build the OpenDSS C++ engine

    bash py_dss_interface/OpenDSSLinuxCPPForRepo.sh
    

    📌 Note: You'll need tools for building C++ code (e.g., g++, cmake, etc.).

  3. Install the package

    pip install path/to/py_dss_interface
    

📦 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)

🧪 Running Tests

The project includes a comprehensive test suite using pytest. Tests can be run individually or together depending on your platform and backend.

Basic Test Execution

# Run all tests
pytest tests/

Test Execution Modes

Automatic Individual Execution (Default)

On Linux or when using the C++ backend on Windows, tests automatically run individually in separate subprocesses to prevent memory leak issues. This is handled automatically by the test framework.

Running All Tests Together

To run all tests together (faster execution, but may have memory issues if there are leaks), use the --run-together flag:

# Run all tests together (even on Linux/C++)
pytest tests/ --run-together

Note: Use --run-together when you want to test memory management fixes or need faster test execution. Individual execution is recommended for normal testing to prevent memory leaks.

Test Summary

When tests run individually, a detailed summary is displayed at the end showing:

  • Total tests executed
  • Passed/Failed/Error counts
  • List of failed tests (if any)
  • Execution time

📖 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


📂 Where to Find Examples

  • 📁 OpenDSS Repository
  • 📁 Local Installation: After installing OpenDSS on 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. (2026). py-dss-interface: A Python package that interfaces with OpenDSS powered by EPRI (Version 2.3.0) [Computer software]. GitHub. https://github.com/PauloRadatz/py_dss_interface

BibTeX Entry:

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

🙏 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.


Metadata

Release files for py-dss-interface 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for py-dss-interface 2.3.0
File
py_dss_interface-2.3.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
py_dss_interface-2.3.0-py3-none-win32.whl Python 3 none Windows x86-32 Details
py_dss_interface-2.3.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
py_dss_interface-2.3.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details

Total release size: 36.4 MB

Release files / py_dss_interface-2.3.0-py3-none-win_amd64.whl

Download URL py_dss_interface-2.3.0-py3-none-win_amd64.whl
Size 9.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
f6cbbf08209e516f56f4ed06fb460e3646bc47901af2f2830a6d049878928b26
BLAKE2b-256 checksum
How to use checksums
7357c7c29bc844dac9a71a3170473ae44f32ae515df479dfa4221a6816b76201
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / py_dss_interface-2.3.0-py3-none-win32.whl

Download URL py_dss_interface-2.3.0-py3-none-win32.whl
Size 9.0 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
ae19e594f8bac9ab685acdbacad597ff65d10a22c03c44c3be7d80f71c53078b
BLAKE2b-256 checksum
How to use checksums
c6c2ad1de36489a3d50b84e0ad2500180ce1cc5fcc02a2c5171a38c575532b84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / py_dss_interface-2.3.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL py_dss_interface-2.3.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 9.2 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
288485e91ad4c1c7f83887da0f25d567594f5cf9f4c8242e8a6a90f2c2ab190c
BLAKE2b-256 checksum
How to use checksums
73e660d186be0eedbe3951041894004787803662d825ef93afc010644708c261
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / py_dss_interface-2.3.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL py_dss_interface-2.3.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 9.1 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
8de8f9ce8fece7c26a96d74bc1dbfc72e53867e9af0c5e20ab0cd3b4dbc7722b
BLAKE2b-256 checksum
How to use checksums
f53bca5328203876aa067a62ca2e11dd7398a3090db65820807716c6c07f05d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

2.3.0 This release

4 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

1 release file

2.1.0

1 release file

2.0.4

2 release files

2.0.3

1 release file

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

1 release file

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page