
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
.NET wrapper to query the Met Office DataPoint API for UK weather data.
.NET wrapper to query the Met Office DataPoint API for weather data.
To use MetOfficeDataPoint in your C# project, you can either download the MetOfficeDataPoint C# .NET libraries directly from the Github repository or, if you have the NuGet package manager installed, you can grab them automatically.
PM> Install-Package MetOfficeDataPoint
Once you have the MetOfficeDataPoint libraries properly referenced in your project, you can include calls to them in your code.
Add the following namespaces to use the library:
using MetOfficeDataPoint;
using MetOfficeDataPoint.Models;
using MetOfficeDataPoint.Models.GeoCoordinate;
The client is intended to be used via Dependency Injection and added using the AddMetOfficeDataPointService
extension.
// Add API client
serviceCollection.AddMetOfficeDataPointService(
"<API KEY>"
);
The injected client can then be used as expected.
public class App
{
private readonly ILogger<App> _logger;
private readonly IMetOfficeDataPointService _metOfficeDataPointService;
public App(ILoggerFactory loggerFactory, IMetOfficeDataPointService metOfficeDataPointService)
{
_logger = loggerFactory.CreateLogger<App>();
_metOfficeDataPointService = metOfficeDataPointService;
}
public async Task RunAsync()
{
// Get all sites
SiteListResponse siteListResponse = await _metOfficeDataPointService.GetAllSitesAsync();
// Get available forcasts
AvailableTimeStampsResponse availableTimeStampsResponse = await _metOfficeDataPointService.GetAvailableTimestampsAsync();
// Get all 3 hourly forecasts
ForecastResponse3Hourly forecastResponse3Hourly = await _metOfficeDataPointService.GetForecasts3HourlyAsync();
// Get daily forecasts for site 14
ForecastResponseDaily forecastResponseDaily = await _metOfficeDataPointService.GetForecastsDailyAsync(14);
// Get historical observations
ForecastResponse3Hourly historicalResponse = await _metOfficeDataPointService.GetHistoricalObservationsAsync();
// Get closest site
GeoCoordinate coordinate = new GeoCoordinate(51.508363, -0.163006);
Location location = await _metOfficeDataPointService.GetClosestSiteAsync(coordinate);
}
}
See the debug project for an example.
FAQs
.NET wrapper to query the Met Office DataPoint API for UK weather data.
We found that metofficedatapoint demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.