https://pypi.python.org/pypi/frostbite-rcon-utils
A library that takes care of the encoding and decoding of packets sent to or from a Battlefield server (or any other server that uses their protocol).
pip install frostbite-rcon-utils
See examples for use instructions.
This is licensed under MIT, hack away!