
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
A Fast and Efficient way to get the current Oil Price from Yahoo Finance API in Python.
A Fast and Efficient way to get the current Oil Price from Yahoo Finance API in Python. Data is returned as a dictionary.
I've found a lack of good simple ways to get the oil price from a free online API, so I designed one myself based upon Yahoo Finance.
It simply returns a dictionary with the current market data for Oil (WTI Front Month).
It also accepts a parameter ticker
which will get the market data for that ticker on Yahoo Finance. i.e bmdPriceFetch()
An example usage file is included called main.py. It contains the basics for running this code. It is in essense:
from bmdOilPriceFetch import bmdPriceFetch
data = bmdPriceFetch()
if data is not None:
outputString = f"The price of WTI is ${data['regularMarketPrice']:.2f}"
print(outputString)
The output is a dictionary:
{ 'close': 53.650001525878906,
'high': 53.650001525878906,
'lastClose': 52.98,
'low': 53.060001373291016,
'open': 53.130001068115234,
'regularMarketPrice': 53.65,
'volume': 2664,
'metadata': {
'chartPreviousClose': 52.98,
'currency': 'USD',
'currentTradingPeriod': {
'post': {
'end': 1611205140,
'gmtoffset': -18000,
'start': 1611205140,
'timezone': 'EST'},
'pre': {
'end': 1611118800,
'gmtoffset': -18000,
'start': 1611118800,
'timezone': 'EST'},
'regular': {
'end': 1611205140,
'gmtoffset': -18000,
'start': 1611118800,
'timezone': 'EST'}},
'dataGranularity': '1d',
'exchangeName': 'NYM',
'exchangeTimezoneName': 'America/New_York',
'firstTradeDate': 967003200,
'gmtoffset': -18000,
'instrumentType': 'FUTURE',
'priceHint': 2,
'range': '',
'regularMarketPrice': 53.65,
'regularMarketTime': 1611142219,
'symbol': 'CL=F',
'timezone': 'EST',
'validRanges': [
'1d',
'5d',
'1mo',
'3mo',
'6mo',
'1y',
'2y',
'5y',
'10y',
'ytd',
'max']}}
designed in 2021 by bmd.
FAQs
A Fast and Efficient way to get the current Oil Price from Yahoo Finance API in Python.
We found that bmdOilPriceFetch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.