Skip to main content

dbgdb

Project description

This is a library containing Luigi tasks to help you get that data into (and out of) your GIS databases. The library also comes with a command-line interface based on Click that can be helpful for running tasks individually.

Getting Started

Prerequisites

pip install

You can use pip to install the library itself.

pip install dbgdb

GDAL/OGR

You will also need ogr2ogr which you can get by installing GDAL.

Note: In this early version we expect ``ogr2ogr`` to be in your system path. Improvements on that point are forthcoming.

Using Tasks

This library contains a number of tasks that you can use in your Luigi pipelines.

PgLoadTask

Use `PgLoadTask <https://dbgdb.readthedocs.io/en/latest/api.html#dbgdb.tasks.postgres.load.PgLoadTask>`__ task to import your data (likely a file geodatabase) to your PostgreSQL database.

PgExtractTask

Use a `PgExtractTask <https://dbgdb.readthedocs.io/en/latest/api.html#dbgdb.tasks.postgres.extract.PgExtractTask>`__ to get your data out of the database.

PgDropSchemaTask

If you need to drop the import schema because you’re starting the process over, use `PgDropSchemaTask <https://dbgdb.readthedocs.io/en/latest/api.html#dbgdb.tasks.postgres.drop.PgDropSchemaTask>`__.

Using the Command Line

A Note about the CLI and Luigi

Most of the commands you run with the command-line interface (CLI) create Luigi tasks which are then submitted to a Luigi scheduler. The -l parameter indicates that the tasks should be run using the local scheduler. The examples listed below use this parameter.

Getting Help

dbgdb has its own command-line help.

dbgdb --help

Load Data

You can load a file geodatabase with the load subcommand.

dbgdb -l load --schema myschema /path/to/your/data.gdb

Extract Data

You can extract all of the data within a schema to an output file with the extract subcommand.

dbgdb -l extract  --schema myschema /path/to/your/exported/data.db

Note: At the moment, we can export to `GeoPackage <https://www.geopackage.org/>`__ or `Spatialite <https://www.gaia-gis.it/fossil/libspatialite/index>`__ formats. Support for ESRI File Geodatabses (gdb) is still in the works.

Drop a Schema

If the target schema for your load command already exists, you may notice Luigi reports there was nothing to do because, from the task’s perspective, the work is already done. If you need to drop a schema, you can use the drop subcommand.

dbgdb -l drop schema myschema

Resources

Would you like to learn more? Check out the links below!

Authors

  • Pat Daburu - Initial work - github

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbgdb-0.0.5.tar.gz (11.8 kB view details)

Uploaded Source

File details

Details for the file dbgdb-0.0.5.tar.gz.

File metadata

  • Download URL: dbgdb-0.0.5.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dbgdb-0.0.5.tar.gz
Algorithm Hash digest
SHA256 165623eefa8bada3965b171f9453acea0be1e54810e321f73b52a7f223adc07d
MD5 6503aa633d3cfd591197fe90d3fda3e0
BLAKE2b-256 d4ad05c1b63c70ff02e718e82a0f72f368c2258fe58fe7636cb384b9b336e421

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page