Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Publish Docker image

on:
workflow_run:
workflows: ["Build"]
types: [completed]
branches: [master]
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

env:
DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY || 'geopython/pygeometa' }}

jobs:
on-success:
name: Build, Test and Push Docker Image to DockerHub
runs-on: ubuntu-24.04
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@master

- name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.2.1

- name: Log in to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.0.1
with:
images: |
${{ env.DOCKER_REPOSITORY }}
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}

- name: Build and push Docker images
uses: docker/build-push-action@v3.3.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/arm64, linux/amd64

on-failure:
runs-on: ubuntu-24.04
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Print Test Fail
run: echo Tests Failed
62 changes: 62 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# =================================================================
#
# Terms and Conditions of Use
#
# Unless otherwise noted, computer program source code of this
# distribution # is covered under Crown Copyright, Government of
# Canada, and is distributed under the MIT License.
#
# The Canada wordmark and related graphics associated with this
# distribution are protected under trademark law and copyright law.
# No permission is granted to use them outside the parameters of
# the Government of Canada's corporate identity program. For
# more information, see
# http://www.tbs-sct.gc.ca/fip-pcim/index-eng.asp
#
# Copyright title to all 3rd party software distributed with this
# software is held by the respective copyright holders as noted in
# those files. Users are asked to read the 3rd Party Licenses
# referenced with those assets.
#
# Copyright (c) 2026 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# =================================================================

FROM python:3.14-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1

RUN useradd -m pygeometa

WORKDIR /app
COPY ./ /app

RUN python3.14 -m venv --system-site-packages /venv && \
/venv/bin/pip3 install .

USER pygeometa


ENTRYPOINT ["/venv/bin/pygeometa"]
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![Build Status](https://github.com/geopython/pygeometa/workflows/build%20%E2%9A%99%EF%B8%8F/badge.svg)](https://github.com/geopython/pygeometa/actions)
[![Join the chat at https://matrix.to/#/#geopython_pygeometa:gitter.im](https://badges.gitter.im/Join%20Chat.svg)](https://matrix.to/#/#geopython_pygeometa:gitter.im)
[![Docker](https://github.com/geopython/pygeometa/actions/workflows/containers.yml/badge.svg)](https://github.com/geopython/pygeometa/actions/workflows/containers.yml)
[![Vulnerabilities](https://github.com/geopython/pygeometa/actions/workflows/vulnerabilities.yml/badge.svg)](https://github.com/geopython/pygeometa/actions/workflows/vulnerabilities.yml)

# pygeometa

Expand Down Expand Up @@ -73,6 +75,16 @@ pygeometa metadata transform path/to/file.xml --input-schema=iso19139 --output-s
pygeometa metadata transform path/to/file.xml --input-schema=autodetect --output-schema=oarec-record # --input-schema=autodetect is default
```

## Docker

pygeometa can also be run as a Docker application:

```bash
# run pygeometa via Docker, and map local path /path/to/my-data-dir to /data in Docker
docker run -ti -v /path/to/my-data-dir/:/data/ pygeometa:latest metadata generate --schema oarec-record /data/sample.mcf.yml
```


### Supported schemas
Schemas supported by pygeometa:
* CSV on the web, [reference](https://www.w3.org/TR/2015/REC-tabular-metadata-20151217/)
Expand Down