Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
This is a Python package to directly interact with the Meetnet Vlaamse Banken api and get the publically available weather data in the Belgian North Sea directly.
The mvbc
package is a Python client to interact with the Meetnet Vlaamse Banken API. This package provides easy access to public weather data from the Belgian North Sea directly, and it returns the data in a pandas DataFrame format, making it convenient for further analysis.
To use the Meetnet Vlaamse Banken API, you first need to create an account and get credentials:
MEETNET_USERNAME
and MEETNET_PASSWORD
.For best security practices, store your credentials in environment variables. You can set them as follows in your terminal:
export MEETNET_USERNAME="your_username"
export MEETNET_PASSWORD="your_password"
You can install the mvbc
package via pip:
pip install mvbc
Once you have the package installed, you can start using it to retrieve weather data. Below is an example on how to use the package to fetch data.
import mvbc
# If you are using environmental variables
mvbc_username = os.getenv('MEETNET_USERNAME') # Replace with your usernam
mvbc_password = os.getenv('MEETNET_PASSWORD') # Replace with your password
# Use the credentials
creds = Credentials(username=mvbc_username, password=mvbc_password)
b=Base(creds)
b.ping()
# Specify the timeframe of interest
dt_start = datetime(2022,9,30,tzinfo=utc) # timestamp with timezone
dt_end = datetime(2022,10,1,tzinfo=utc)
# Get the information about the avialble data points
c = Catalog(credentials=creds)
df_unfiltered = c.data_points()
print(df_unfiltered)
The df_unfiltered
DataFrame contains the information about the available data and the weather stations.
There are two main ways to retrieve data:
weather_station = 'Wandelaar'
df_weather = \
dg.get_data_by_weatherstation(
weather_station,
dt_start,
dt_end,
creds,
df_unfiltered
)
# Replace this with location of interest in the from of [Latitude, Longitude]
location_of_interest = [2.81, 51.69]
df_weather, weatherstation_information, all_wetaherstations = dg.get_longterm_weather_data(location_of_interest, dt_start, dt_end, df=df_unfiltered, credentials=creds)
# Data comes in for every 30min, but you can resample to the time you want (e.g. 10 minutes)
df_weather = df_weather.resample('10T', axis=0).interpolate(method='linear', axis=0, limit=12)
The weather data is returned as a pandas DataFrame (df_weather
) with the timestamps in the rows and columns in the format:
mvbc_<weather station>_<Parameter Name>
For example, you might see columns such as:
mvbc_Thorntonbank_Wind_speed
mvbc_Wandelaar_Temperature
mvbc_Westhinder_Wave_height
The additional information about available weather stations and data can be accessed via the df_unfiltered
DataFrame. This provides you with metadata about the stations and available parameters.
You can also set a list of preferred weather stations to prioritize fetching data from. The default preferred stations are:
You can provide your own list of preferred stations as follows:
preferred_stations = ["Westhinder", "Nieuwpoort"]
df_preferred = client.get_weather_data(preferred_stations=preferred_stations)
print(df_preferred)
For a full usage example, check out the provided Jupyter notebook (mvbc_tutorial.ipynb
) which showcases different ways of fetching data, including using preferred weather stations and fetching data by location.
FAQs
This is a Python package to directly interact with the Meetnet Vlaamse Banken api and get the publically available weather data in the Belgian North Sea directly.
We found that mvbc 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.