openweatherd 1.0.0

A D library to work with weather information and forecast data provided by Open Weather Map.

To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:


A D library to work with weather information and forecasts data provided by Open Weather Map. This is a port from the previously built library OpenWeatherJS


We start initialization of the library by setting the options. To set the options we call the Options class like this:

    //New Options object
    Options options = Options.getInstance();
    // Set the api key the library should use.
    // Set which temperature units the library should use (Default is Kelvin).

After we set the options we get the desired location

    // Get location by id.
    // Full id list can be viewed at:
    Location location = Location.getById(6_198_442);
    // Get location by name and city.
    location = Location.getByName("London", "UK");

After that we can use the location object to get the current weather for that location:

    // Get current weather for target location.
    WeatherEntry entry = CurrentWeather.getWeather(location);

    writeln("Current weather description: ", entry.description);
    writeln("Current weather icon id: ", entry.icon);

    writeln("Current weather temperature: ", entry.temperature);
    writeln("Current weather pressure: ", entry.pressure);
    writeln("Current weather humidity: ", entry.humidity);

    writeln("Current weather minimum temperature: ", entry.minimum);
    writeln("Current weather minimum temperature: ", entry.maximum);

    writeln("Current weather sea level pressure: ", entry.seaLevel);
    writeln("Current weather ground level pressure: ", entry.grndLevel);

    writeln("Current weather wind speed: ", entry.windSpeed);
    writeln("Current weather wind direction: ", entry.windDirection);

    writeln("Current weather cloudiness: ", entry.cloudiness);
    writeln("Current weather rain volume: ", entry.rainVolume);
    writeln("Current weather snow volume: ", entry.snowVolume);

    writeln("Location id: ",;
    writeln("Location name: ",;
    writeln("Location latitude: ", entry.location.latitude);
    writeln("Location longitude: ", entry.location.longitude);
    writeln("Location country: ",;


You can use the values freely as you'd like, as you see there is alot of coverage so if you would like to for example display a complete weather report on your website this would be a great choice since it covers everything from temperature to pressure and cloudiness.

  • Oskar Mendel
1.0.0 2017-Jun-22
~master 2017-Jun-22
Show all 2 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 14 downloads total

Short URL: