P4 API for Python

P4 API for Python is a derived API, it is the Python interface to the P4 API for C/C++, see P4 API for C/C++ Documentation. P4 API for Python enables you to write Python code that interacts with a P4 Server.

P4 API for Python enables your Python scripts to:

  • Get P4 Server data and forms in dictionaries and lists.
  • Edit P4 Server forms by modifying dictionaries.
  • Provide exception-based error handling and optionally ignore warnings.
  • Issue multiple commands on a single connection (performs better than spawning single commands and parsing the results).