Convert Tickers into OrganizationalIDs

Hello, could you please provide a code that leverage the one below that can convert a ticker into an organizationalID so to be used for fetching data in the RDP Filigs API ?

I am connecting using the os variable below using a json config file where all my credentials are stored:

os.environ["LD_LIB_CONFIG_PATH"] = r"C:\Users\padadmin\PycharmProjects\pythonProject\Repos\pwm-pad\APIs\Configuration"

I generally open the connection like this:

Open the session using the default specified in the configuration file

session = ld.open_session()

Open the session

session.open()

Inspect the session object for connection details

try:
# Hypothetical method or attribute to get connection type
connection_type = session.type # Replace with actual method/attribute if available
print(f"Connection Type: {connection_type}")
except AttributeError:
print("Could not determine connection type. Please check documentation for available attributes.")

Example: Print other attributes

try:
print(f"Session Name: {session.name}")
print(f"Session State: {session.open_state}") # Replace with actual attributes if available
#print(f"Session State: {session.config}") # Replace with actual attributes if available
except AttributeError:
print("Some attributes are not available. Please check documentation.")

Can I use the same method (instead of having a token) to get access to the Symbology API ? Based on this could you provide a code that does the conversion I mentioned earlier ?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    edited April 8 Answer ✓

    @Aleniles

    Thank you for reaching out to us.

    You can use the symbol_conversion to convert tickers to organization PermIDs. For example:

    response = symbol_conversion.Definition(
        symbols=["PTT","GOOG"],
        from_symbol_type=symbol_conversion.SymbolTypes.TICKER_SYMBOL,
        to_symbol_types=[
            symbol_conversion.SymbolTypes.OA_PERM_ID
        ]
    ).get_data()
    
    response.data.df
    
    image.png

    The examples are on GitHub.

Answers