Latlon-utils

Latest version: v0.0.7

Safety actively analyzes 618874 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.0.7

This release fixes the download URLs for Woldclim (thanks klondenberg-vw, see 1), and natural earth (see 2).

0.0.2

[![Build Status](https://travis-ci.org/Chilipp/latlon-utils.svg?branch=v0.0.2)](https://travis-ci.org/Chilipp/latlon-utils)

This patch includes a minor update to fix a bug when downloading data from the command line.

0.0.1

[![Build Status](https://travis-ci.org/Chilipp/latlon-utils.svg?branch=v0.0.1)](https://travis-ci.org/Chilipp/latlon-utils)

This python package is supposed to deliver information specific to a given latitude and longitude.

This first release contains the `get_climate` method to retrieve climate data from the [WorldClim 2.0](http://worldclim.org/version2) and the `get_country` method to retrieve the country based on the [datasets/geo-countries](https://github.com/datasets/geo-countries) repository.

Example usage
------
Get the country for 50 degrees north and 10 degrees east:

>>> from latlon_utils import get_country

>>> get_country(50, 10)
'Germany'

Get the climate for 50 degrees north and 10 degrees east:

>>> from latlon_utils import get_climate

limit the number of columns printed by pandas
>>> import pandas; pandas.options.display.max_columns = 5

>>> get_climate(50, 10)
tavg jan 0.044739
feb 0.974976
mar 4.705505
apr 8.232239
mai 13.150024
jun 16.012268
jul 17.958984
aug 17.828735
sep 13.779480
oct 8.787476
nov 4.039001
dec 1.430237
djf 0.816650
mam 8.695923
jja 17.266663
son 8.868652
ann 8.911972
prec jan 48.000000
feb 42.000000
mar 44.000000
apr 44.000000
mai 56.000000
jun 68.000000
jul 65.000000
aug 52.000000
sep 47.000000
oct 52.000000
nov 52.000000
dec 59.000000
djf 49.666667
mam 48.000000
jja 61.666667
son 50.333333
ann 52.416667
Name: (50, 10), dtype: float64


>>> get_climate(50, 10)['tavg', 'djf']
0.816650390625

>>> get_climate([10, 11], [50, 51])
tavg ... prec
jan feb ... son ann
lat lon ...
10 50 21.810730 22.687988 ... 10.666667 6.833333
11 51 18.416992 19.715759 ... 10.000000 7.833333

[2 rows x 34 columns]

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.