question

Upvotes
Accepted
5 0 0 7

Contributing with Python Data Library API

Hi,


I'm trying to contribute data into the ATS, however i can't make it work:

1673525816297.png

For info, getting prices though the same stream works well.


Thanks for the help.


Regards


python#technologyapirefinitiv-dataplatform-libraries
1673525816297.png (32.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
1.3k 3 2 4

Hi @fabien.marcaillou ,

You're trying to contribute with OnStream mode (ie: a opened stream), so if you need to open your stream before calling contribute() function:

session = rd.open_session(config_name='refinitiv-data.config.json')

streaming = rd.content.pricing.Definition(
    ['XAGFIX_PRIME'],
    service='DTS',
    fields=['ASK', 'BID']
).get_stream()

streaming.open()

response = streaming.contribute('XAGFIX_PRIME', {'BID': 22.092})

print(response.is_success)

rd.close_session()

Then it should work.

If you don't need to open your stream to retrieve updates, then you can use the OffStream mode:

session = rd.open_session(config_name='refinitiv-data.config.json')

response = rd.delivery.omm_stream.contribute(
    'XAGFIX_PRIME',
    fields={'BID': 22.092},
    service='DTS'
)

print(response.is_success)

rd.close_session()


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
98 5 5 15

Dear developer community


I m interested by this contribution fonctionality in. Net environnement.

Can you tell me if this contribution service is also available in refinitiv library under. Net.


Regards

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.