From bf5d92d4c659e542fa071b7658c27dcb669242df Mon Sep 17 00:00:00 2001 From: shigapov <57352291+shigapov@users.noreply.github.com> Date: Tue, 19 Dec 2023 15:33:12 +0100 Subject: [PATCH] fix reading geojsons & update to v0.1.6 --- MANIFEST.in | 1 + enricher/enricher.py | 19 ++++++++++--------- setup.py | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..ac8b667 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include enricher/*.json \ No newline at end of file diff --git a/enricher/enricher.py b/enricher/enricher.py index e37a813..6d169ef 100644 --- a/enricher/enricher.py +++ b/enricher/enricher.py @@ -3,6 +3,7 @@ import geopandas as gpd from shapely.geometry import Point from pprint import pprint +import pkg_resources # Configuration wikibase_api_url = "https://www.wikidata.org/w/api.php" @@ -13,15 +14,15 @@ geo_properties = {'P625': 'geographic coordinates', 'P1566': 'GeoNames ID', 'P402': 'OSM Relation ID', 'P440': 'German district key', 'P439': 'German municipality key', 'P1388': 'German regional key', 'P1937': 'UN/LOCODE', 'P2671': 'Google Knowledge Graph ID', 'P646': 'Freebase ID', 'P590': 'GNIS ID', 'P774': 'FIPS 55-3', 'P11693': 'OpenStreetMap node ID'} # Load boundary data for Germany -historical_germany_1886_1919 = gpd.read_file('./84.json') -historical_germany_1919_1920 = gpd.read_file('./85.json') -historical_germany_1920_1938 = gpd.read_file('./86.json') -historical_germany_1938_1945 = gpd.read_file('./87.json') -historical_GFR_1945_1949 = gpd.read_file('./88.json') -historical_GFR_1949_1990 = gpd.read_file('./89.json') -historical_GFR_1990_2019 = gpd.read_file('./90.json') -historical_GDR_1945_1949 = gpd.read_file('./91.json') -historical_GDR_1949_1990 = gpd.read_file('./92.json') +historical_germany_1886_1919 = gpd.read_file(pkg_resources.resource_filename('enricher', '84.json')) +historical_germany_1919_1920 = gpd.read_file(pkg_resources.resource_filename('enricher', '85.json')) +historical_germany_1920_1938 = gpd.read_file(pkg_resources.resource_filename('enricher', '86.json')) +historical_germany_1938_1945 = gpd.read_file(pkg_resources.resource_filename('enricher', '87.json')) +historical_GFR_1945_1949 = gpd.read_file(pkg_resources.resource_filename('enricher', '88.json')) +historical_GFR_1949_1990 = gpd.read_file(pkg_resources.resource_filename('enricher', '89.json')) +historical_GFR_1990_2019 = gpd.read_file(pkg_resources.resource_filename('enricher', '90.json')) +historical_GDR_1945_1949 = gpd.read_file(pkg_resources.resource_filename('enricher', '91.json')) +historical_GDR_1949_1990 = gpd.read_file(pkg_resources.resource_filename('enricher', '92.json')) current_germany_boundary = historical_GFR_1990_2019 diff --git a/setup.py b/setup.py index fb2229c..299444a 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="kg-enricher", - version='0.1.5', + version='0.1.6', author="Renat Shigapov", license="MIT", description="A Python library for enriching strings, entities and KGs using Wikibase knowledge graphs. "