How do I use LO's proxy settings in python scripts?

I have a python script embedded into my document which downloads some data from the Internet. Essentially it works, but I am having trouble with the proxy settings.

I am using urllib.requests to do my web calls and whenever I am behind a proxy server, my calls fail, i.e., time out. I do have proxy settings in Extras->Options->Internet->Proxy. How do I access these settings in a python script?

If I don’t have specifc proxy settings but leave the setting at System, how do I obtain the correct proxy settings for urllib to work in my LO document?

  1. ‘Tools - Options - Internet - Proxy’ settings are stored as org.openoffice.Inet configuration keys which you can read pushing ‘Open expert configuration’ button in ‘Tools - Options - LibreOffice - Advanced’ dialog.

    Note: A Python script accessing such settings with is available at easydev/ at master · UniversoLibreMexicoAC/easydev · GitHub - found via [Solved] Convert Basic function to python (View topic) • Apache OpenOffice Community Forum -

  2. ‘System’ proxy setting are depending on your OS which you do not precise …

Thanks for the hint about the configuration keys and that I may access them from python. This was just the information I needed. I shall write my own configuration-key-reader, due to unclear licensing of the code you referenced.

You can add access proxy in your script, look:

Nice! Thx elmau

Check the mark (✓) to the left of the answer that solves your question.