gisco-geodata

GISCO Geodata is a Python package that provides access to the European Commission's GISCO geospatial data.

https://github.com/alecsandrei/gisco-geodata

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary

Keywords

async asyncio geodata gisco
Last synced: 6 months ago · JSON representation ·

Repository

GISCO Geodata is a Python package that provides access to the European Commission's GISCO geospatial data.

Basic Info
  • Host: GitHub
  • Owner: alecsandrei
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 314 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
async asyncio geodata gisco
Created almost 2 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog License Citation

README.md

Can be used to download geodata from the GISCO API.

DOI

Installation

Unreleased version

sh git clone https://github.com/alecsandrei/gisco-geodata.git cd gisco-geodata python3 -m pip install .

PyPI

sh pip install gisco-geodata

Requirements

  • httpx
  • async-cache
  • Python >= 3.9
  • Optional: GeoPandas

Examples

Also check the examples folder.

```python import os from pathlib import Path

from giscogeodata import ( NUTS, Countries, sethttpxargs, setsemaphore_value )

if name == 'main': out_dir = Path( os.path.normpath(os.path.expanduser("~/Desktop")) ) # Desktop path

set_httpx_args(verify=False)  # prevents SSLError in my case
set_semaphore_value(20) # the maximum number of asynchronous API calls

nuts = NUTS()

nuts.download(
    file_format='shp',
    year='2021',
    spatial_type='BN',
    scale='60M',
    projection='4326',
    nuts_level='LEVL_3',
    out_dir=out_dir,
)

# Equivalent to the above
datasets = nuts.get_datasets()
datasets[-1].download(
    file_format='shp',
    spatial_type='BN',
    scale='60M',
    projection='4326',
    nuts_level='LEVL_3',
    out_dir=out_dir,
)

# Retrieve Country information as Polygons
countries = Countries()

# If you have geopandas installed, this will be a GDF.
gdf = countries.get(
    countries=['RO', 'IT'],
    spatial_type='RG',
)
if not isinstance(gdf, list):
    print(gdf.head(5))
else:
    print(gdf)

```

You can also use it with the eurostat python package.

```python """To use this script you will need to also install the 'eurostat' and the 'mapclassify' packages."""

""" To use this script you will need to also install the following packages - eurostat - geopandas - mapclassify """

import geopandas as gpd import matplotlib.pyplot as plt from eurostat import getdatadf, gettocdf, setrequestsargs

from giscogeodata import NUTS, sethttpx_args

def getplot(): sethttpxargs(verify=False) setrequests_args(verify=False)

# Get the geometries from the gisco service.
nuts = NUTS()
level_2 = nuts.get(spatial_type='RG', nuts_level='LEVL_2')
assert isinstance(level_2, gpd.GeoDataFrame)

# Get the dataset information.
eurostat_database = get_toc_df()
title, code = eurostat_database.loc[
    eurostat_database['title']
    == 'Unemployment by sex, age, educational attainment level and NUTS 2 region (1 000)',
    ['title', 'code'],
].iloc[0]
dataset = get_data_df(code)
assert dataset is not None

# Preprocess the dataset.
dataset = dataset.loc[
    (dataset['isced11'] == 'TOTAL') & (dataset['sex'] == 'T')
]  # total unemployment rate
# Join with the geometries.
dataset = level_2.merge(
    dataset, left_on='NUTS_ID', right_on=r'geo\TIME_PERIOD'
)
assert isinstance(dataset, gpd.GeoDataFrame)

# Plot.
dataset.plot(
    column='2023', scheme='NaturalBreaks', legend=True, edgecolor='black'
)
plt.title(title, fontdict={'size': 15, 'wrap': True})
plt.xlim(-25, 47)
plt.ylim(30, 75)
plt.tight_layout()
plt.show()

if name == 'main': get_plot()

```

Disclaimer

This plugin, Eurostat Downloader, is an independent project created by Cuvuliuc Alex-Andrei. It is not an official product of Eurostat, and Cuvuliuc Alex-Andrei is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Eurostat or any of its subsidiaries or its affiliates.

Copyright notice

Before using this package, please read the information provided by Eurostat.

Owner

  • Login: alecsandrei
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Cuvuliuc"
  given-names: "Alex-Andrei"
  orcid: "https://orcid.org/0009-0004-7575-2036"
title: "gisco-geodata"
version: 0.1.1
date-released: 2024-06-04
url: "https://github.com/alecsandrei/gisco-geodata"

GitHub Events

Total
  • Release event: 5
  • Watch event: 1
  • Delete event: 7
  • Push event: 16
  • Pull request event: 5
  • Create event: 11
Last Year
  • Release event: 5
  • Watch event: 1
  • Delete event: 7
  • Push event: 16
  • Pull request event: 5
  • Create event: 11

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 50 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: gisco-geodata

GISCO Geodata is a Python package that provides access to the European Commission's GISCO geospatial data.

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 50 Last month
Rankings
Dependent packages count: 10.9%
Average: 36.1%
Dependent repos count: 61.3%
Maintainers (1)
Last synced: 7 months ago

Dependencies

pyproject.toml pypi
  • requests *