Geographical database for internal projects.
Project description
WebCase Geographical database
Installation
pip install wc-django-geo-db
In settings.py:
INSTALLED_APPS += [
'pxd_lingua',
'pxd_postgres',
'pxd_postgres.ltree',
'wcd_geo_db',
'wcd_geo_db.contrib.admin',
'wcd_geo_db_sources',
]
WCD_GEO_DBSOURCES = {
'SOURCE_IMPORT_RUNNERS': (
'wcd_geo_db_sources.sources.katottg.process.KATOTTGImportRunner',
'wcd_geo_db_sources.sources.katottg_to_koatuu.process.KATOTTG_TO_KOATUUImportRunner',
)
}
Usage
from wcd_geo_db.client import GeoClient
from wcd_geo_db.conf import Settings
from wcd_geo_db.modules.code_seeker import registry
from wcd_geo_db_sources.sources.koatuu import KOATUU_SEEKER
from wcd_geo_db_sources.sources.katottg import KATOTTG_SEEKER
from wcd_geo_db_sources.sources.novaposhta import NOVAPOSHTA_SEEKER
client = GeoClient(settings=Settings(), code_seeker_registry=registry)
registry.register(KOATUU_SEEKER)
registry.register(KATOTTG_SEEKER)
registry.register(NOVAPOSHTA_SEEKER)
client.bank.divisions.get(ids=(1,))
found = client.bank.divisions.find(levels=(DivisionLevel.ADMINISTRATIVE_LEVEL_1,))
descendants = client.bank.divisions.find_descendants(ids=found)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wc-django-geo-db-0.1.1.tar.gz
(30.6 kB
view details)
File details
Details for the file wc-django-geo-db-0.1.1.tar.gz.
File metadata
- Download URL: wc-django-geo-db-0.1.1.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6e638f67c086fe02571dbe6f04fcd66bf7b31f21c9064f12de68d093d815fad
|
|
| MD5 |
73f81ed513c41f477c7ca2dc36c75fab
|
|
| BLAKE2b-256 |
96479d4b0561a6697af8aca8d66ab50016a356f16ccf03b8d546ec1888761701
|