Skip to main content

Auto-Sync LFS Files Github

lcfm-shapefiles

Python wrapper around shapefiles used for the LCFM project.

Install

From PyPI:

uv add lcfm-shapefiles
# or: pip install lcfm-shapefiles

From VITO's internal Artifactory (VITO-only):

uv add --index https://artifactory.vgt.vito.be/artifactory/api/pypi/python-packages/simple lcfm-shapefiles

Use

import lcfm_shapefiles import list_filepaths, get_filepath
import geopandas as gpd

# List out all available files; you can index this list to get a path
lcfm_shapefiles.list_filepaths()

# Get path a specific file
fp = lcfm_shapefiles.get_filepath("LCFM_1p_S2-tiles.fgb")

# Import fgb into a geopandas data frame
gdf = gpd.read_file(fp)

Develop

# Build venv
uv sync

# Run tests
uv run pytest

# Format the code
uv run ruff format .

License

The Python source code is licensed under the MIT License - see LICENSE.

The shapefile/grid data shipped in src/lcfm_shapefiles/data/ is licensed under CC BY-SA 4.0, except two files derived from OpenStreetMap land polygons (generated by scripts/land_buffer.py), which are ODbL 1.0 licensed - see LICENSE-DATA for the full breakdown and attribution.

CI/CD

A Jenkins job is configured, that:

  • Builds the package
  • Runs the tests
  • Uploads a 'dev build' package to Artifactory, e.g. 0.2.3.dev20250305+6
  • Creates a promotion job.

When the build is successful, you should receive an email with a link to the promotion job. If you don't get this email (e.g., when Jenkins can't infer your email from your commits), you can find the link to the promotion job in the build logs, or here. When you build this promotion job ("Build with Parameters" and then "Build"), it:

  • Tags the commit based on the package version
  • Uploads the 'tag build' package to Artifactory, e.g. 0.2.3.

This CI/CD uses the general Python pipeline and was created through the Jenkins job builder. Check with the Software Operations team for more details on its configuration or help with build issues.

Steps to to deploy a new or update existing shapefiles

  • Add or update shapefiles in src/lcfm_shapefiles/data.
  • Update tests accordingly.
  • Bump the package version in pyproject.toml.
  • Commit and push the changes to master.
  • If the build passes, trigger the promotion job.

A new version of the lcfm-shapefiles package should now be on Artifactory.

Use Git LFS storage

We are using the Github Large File Storage about to store fgb files This works alongside with the principle that big files should not be stored in the repository, and a pointer is stored in their place. The actual files are stored somewhere from LFS and are synchronized/cloned from our master branch in the vm at: /vitodata/vegteam/auxdata/LCFM/shapefiles-lfs

sudo dnf install -y git-lfs
git lfs install

If you need to pull the actual fgb files try:

git lfs pull

MD5 and Shapefile limits

To ensure validity of downloaded assets, multi-part upload limit is set to 5GB aligning with the Cloudferro's suggested max size recommended limit

Auto-Syncing Shapefiles to Terrascope

When triggered, the script /vitodata/vegteam/auxdata/LCFM/scripts/sync-shapefiles-terrascope.sh performs a syncing from the master branch As Terrascope network is not exposed publicly and github event-hooks can not be used, the trigger is a weekly defined cronjob:

Cronjob

Cronjob is added with:

crontab -e

and then usin VIM editor add:

0 0 * * 0 /vitodata/vegteam/auxdata/LCFM/scripts/sync-shapefiles-terrascope.sh >> /vitodata/vegteam/auxdata/LCFM/logs/cron.log 2>&1

confirm that cronjob is added

crontab -l

Metadata

Release files for lcfm-shapefiles 0.9.33

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lcfm-shapefiles 0.9.33
File Size Uploaded
lcfm_shapefiles-0.9.33.tar.gz 1.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for lcfm-shapefiles 0.9.33
File Interpreter ABI Platform
lcfm_shapefiles-0.9.33-py3-none-any.whl Python 3 none any Details

Total release size: 1.6 MB

Release files / lcfm_shapefiles-0.9.33.tar.gz

Download URL lcfm_shapefiles-0.9.33.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
26b38f4acbe6c17fd9081b7ecf1523955c94bdbcd67ea1fca6ba6fe64e4d4a3d
BLAKE2b-256 checksum
How to use checksums
c209167ddb1b81ea5c01114e32c495cb381b6a3c7075ebbb30f31db4c734373d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.24

Release files / lcfm_shapefiles-0.9.33-py3-none-any.whl

Download URL lcfm_shapefiles-0.9.33-py3-none-any.whl
Size 31.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bb79d0e77ab6d3781b9261d60ef7739650c034cf02feb8a33639c79c0506719
BLAKE2b-256 checksum
How to use checksums
3538837c6272e2578cdc31c4d46ebdf7ee3c9f5814531eef57d030dfa053ad22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.24

Release history Release notifications | RSS feed

0.9.37

2 release files

0.9.36

2 release files

0.9.35

2 release files

0.9.34

2 release files

This release

0.9.33 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page