Using companys' proxy with lseg-data package

Options

Hi !

In order to use the lseg-data Python package, I've fiddled in the GitHub standard package to try and open a session. However I am getting an error that obviously says that I need proxy authentication to actually test it properly (the error is quite clear).

I am setting the proxy settings in pip.ini for example if I want to download packages through pip, or in the settings before using the requests package. So I was wondering if it is possible to achieve the same with this package ? I want to specify username/password/proxyurl/proxyport.

Hope I was clear !

Regards,

Answers

  • wasin.w
    wasin.w admin
    edited July 8

    Hello @Jugadorwc3

    Are you using the Desktop Session or Platform Session?

    If you are using the Desktop Session

    The library connects and consumes data from the LSEG Workspace platform. The LSEG Workspace desktop application integrates the API proxy that acts as an interface between the Data library and the Workspace Platform. For this reason, the Workspace application must be running when you use the Data library with Desktop Session.

    If you are using the Platform Session

    The library connects and consumes data from the LSEG Delivery Platform over network. If your organization needs HTTP Proxy authentication to access an internet, you can check an accept answer on this StackExchange page about how to set HTTP Proxy using OS Environment Variable.

    I hope this helps.

  • Jugadorwc3
    Jugadorwc3 Newcomer

    Hi Wasin,

    Thank you for the quick reply. I am using a Desktop Session. The Workspace application is running in the background and I can fetch various data from the desktop application.

    I have created an app key that is specified in the config file, and upon trying to open a session, I am met with an HTTP 407 error (Proxy Authentication required).

    Hope this can help clear things out !

    Regards,

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Jugadorwc3

    Typically, a proxy is not required when connecting to a Desktop session because the library connects localhost. You may set the NO_PROXY environment before opening a desktop session.

    import os
    os.environ['NO_PROXY'] = 'localhost'
  • wasin.w
    wasin.w admin

    Hello @Jugadorwc3

    The library needs to connect to the Workspace desktop application (API Proxy) via localhost. Your organization might have a network policy that blocks access to a localhost.

    I suggest you try my colleague suggestion above, or contact your local IT network team to help you check if there a network policy that blocks a connection to Workspace desktop application.