question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pulling weather forecast and other weather data using the bsrch function

See original GitHub issue

I am using the bsrch function is excel to pull weather data

=BSRCH("comdty:weather","provider=wsi","location=KNYC","model=actuals","target_start_date=2019-01-01","target_end_date=2019-05-10","fields=TEMPERATURE")

It does its job and pulls the data.

However, I am trying to pull the same data using the python api. Assuming that con.bsrch() functions in a similar fashion, I tried doing the same in python but that doesn’t work

Even the following code returns an empty data frame

con.bsrch("comdty:weather")

However, the following example returns a list of tickers

con.bsrch("COMDTY:NGFLOW")

I am not sure why. Can someone please help me with this issue

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
butterflywaltzcommented, Dec 4, 2019

I think the schema is clear. All optional parameters go into the overrides element array.

The requested formula corresponds to below request:

ExcelGetGridRequest = {
    Domain = "COMDTY:Weather"
    Overrides[] = {
        Overrides = {
            name = "provider"
            value = "wsi"
        }
        Overrides = {
            name = "location"
            value = "KNYC"
        }
        Overrides = {
            name = "model"
            value = "actuals"
        }
        Overrides = {
            name = "target_start_date"
            value = "2019-01-01"
        }
        Overrides = {
            name = "target_end_date"
            value = "2019-05-10"
        }
        Overrides = {
            name = "fields"
            value = "TEMPERATURE"
        }
    }
}

The limit in another post can be set in the same way.

And you will get below response:

GridResponse = {
    NumOfFields = 2
    NumOfRecords = 3116
    ColumnTitles[] = {
        "Reported Time", "Temperature (°C)"
    }
    DataRecords[] = {
        DataRecords = {
            DataFields[] = {
                DataFields = {
                    DateTimeValue = 2019-01-01T00:00:00.000+00:00
                }
                DataFields = {
                    DoubleValue = 6.700000
                }
            }
        }
        DataRecords = {
            DataFields[] = {
                DataFields = {
                    DateTimeValue = 2019-01-01T01:00:00.000+00:00
                }
                DataFields = {
                    DoubleValue = 6.700000
                }
            }
        }
...
...
        DataRecords = {
            DataFields[] = {
                DataFields = {
                    DateTimeValue = 2019-05-10T23:00:00.000+00:00
                }
                DataFields = {
                    DoubleValue = 22.200000
                }
            }
        }
    }
    ReachMax = true
    SequenceNumber = 0
}
0reactions
lawrencedarbycommented, Feb 10, 2022

Yea - i had to copy past some mod code. Got if working now !

On Thu, 10 Feb 2022 at 17:39, loschnauer @.***> wrote:

I think the bsrch_weather function was never part of the bdblp source repo… Presumably you’ve reinstalled the package and thereby deleted the function from your modified copy? Should work again if you copy the code back into the BCon class of your installation,

— Reply to this email directly, view it on GitHub https://github.com/matthewgilbert/pdblp/issues/68#issuecomment-1035140034, or unsubscribe https://github.com/notifications/unsubscribe-auth/APEIUNDAMWGOVJSL4SGDL5DU2PS2LANCNFSM4IPDJCBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scraping Weather prediction Data using Python and BS4
This article revolves around scraping weather prediction d data using python and bs4 library. Let's checkout components used in the script –.
Read more >
Weather Data Collection: Web Scraping using Python
In this blog, I will be discussing how to scrape data from a website. Hopefully, you have already visited my data collection technique...
Read more >
get data from bloomberg api with python via excel
I would suggest using the Rblpapi package in R, as it has a bsrch function.
Read more >
Sustainable Design and Climate - Terri Meyer Boake
Designing for a cold climate requires a completely different approach to design and respect for the weather. Buildings must be designed with an ......
Read more >
Time Series Analysis and Weather Forecast in Python - Medium
In this post, I would dive into analyzing and forecasting weather data using different techniques. By following the tutorial, in the end you ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found