fgdb_to_gpkg
fgdb_to_gpkg is a Python package that converts all feature classes within an Esri File GeoDatabase to layers within a OGC GeoPackage. This package is designed to be used from the command line or imported as a module.
This package does not have a dependency on ArcPy, which means that you can safely extract feature classes locked inside an Esri File GeoDataBase without needing to worry about any ArcGIS licensing.
Installation
Installing from PyPI
pip install fgdb-to-gpkg
Installing the development version of this package
- Clone the repository:
git clone https://github.com/philiporlando/fgdb_to_gdb.git - Navigate to the repository directory:
cd fgdb_to_gdb - Install the package and its dependencies with poetry:
poetry install
Usage
Command Line Usage
To use fgdb_to_gpkg from the command line, simply call the fgdb_to_gpkg command with the path to the input File GeoDatabase and the path to the output GeoPackage:
poetry run python -m fgdb_to_gpkg <input_fgdb_path> <output_gpkg_path>
Module Usage
You can also import fgdb_to_gpkg as a module in Python and use it to convert any Esri File GeoDatabase feature classes to GeoPackage layers programmatically.
Here's an example of how to use fgdb_to_gpkg as a module:
from fgdb_to_gpkg import fgdb_to_gpkg
input_fgdb_path = "/path/to/my_fgdb.gdb"
output_gpkg_path = "/path/to/my_gpkg.gpkg"
fgdb_to_gpkg(input_fgdb_path, output_gpkg_path)
# See help(fgdb_to_gpkg) for more details
Testing
Unit tests can be performed by the developers of this package using the following command:
poetry run pytest tests
Test coverage can be assessed using the following command:
poetry run pytest --cov=fgdb_to_gpkg --cov-report term-missing
Handling the Fiona GDAL compilation error
The unit tests within this package depend on gdal=^3.6.0, but the current version of fiona ships with gdal=3.5.3. The fiona package must be installed using the --no-binary flag to test this package. If this is not configured properly, then you will see the following error:
poetry run pytest tests
# fiona.errors.DriverError: OpenFileGDB driver requires at least GDAL 3.6.0 for mode 'w', Fiona was compiled against: 3.5.3
The poetry.toml file should contain all of the config needed to tell poetry how to handle this issue. However, if poetry install does not resolve the issue, then try the following:
poetry run pip install --force-reinstall fiona --no-binary fiona
Publishing
This package is automatically published to PyPI when a new release is crafted. For a successful publication, maintainers should:
-
Increment the version number in the pyproject.toml file. Ensure you update it in both the [project] and [project.dependencies] sections.
-
Adhere to
vX.X.Xthe naming convention for the release name and tag.
Metadata
Release files for fgdb-to-gpkg 0.1.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fgdb_to_gpkg-0.1.13.tar.gz | 15.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fgdb_to_gpkg-0.1.13-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.9 kB
Release files / fgdb_to_gpkg-0.1.13.tar.gz
| Download URL | fgdb_to_gpkg-0.1.13.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be4e5dcb0702891033caed4243c6fb5776eec001ed14bfe40cca54518a47f435
|
|
BLAKE2b-256 checksum How to use checksums |
c8f29f0e95319ff586a475eca9a925bff60aceb2729154fedee5aac2a4798411
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / fgdb_to_gpkg-0.1.13-py3-none-any.whl
| Download URL | fgdb_to_gpkg-0.1.13-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe3af7c782ba956d7c78610a8c8bb9380d43fff9981b11d0fbc00bcbf1181c15
|
|
BLAKE2b-256 checksum How to use checksums |
12cf080acf9f8872b10c567dee8e37a4962a910a2d3fe0fa1f75dd3d2b95e8a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|