Skip to main content

gfw-common

Python versions Last release

Common place for GFW reusable Python components.

Introduction

The following table shows a summary of the current supported features:

Module/Package Description
gfw.common.beam Common utilities and wrappers for Apache Beam pipelines.
gfw.common.cli Lightweight framework around argparse for building CLIs more easily.
gfw.common.bigquery Common utilities and wrappers for BigQuery interactions.
gfw.common.datetime Simple helper functions around stdlib datetime module.
gfw.common.decorators.py Basic function decorators.
gfw.common.dictionaries.py Simple helper functions for dictionary manipulation.
gfw.common.io.py Basic IO functions.
gfw.common.iterables.py Iterables utilities.
gfw.common.logging.py Basic logging configuration.
gfw.common.serialization.py Basic serialization utilities.

For more information and API reference, check the documentation pages.

Installation

The package offers extras to avoid installing unnecessary dependencies:

  • beam: includes dependencies for the gfw.common.beam package.
  • bq: includes dependencies for BigQuery utilities.

For a default installation without extras, run:

pip install gfw-common

To install all extras, run:

pip install gfw-common[bq,beam]

Usage

You can see examples in the examples folder.

How to Contribute

Preparing the environment

First, clone the repository.

git clone https://github.com/GlobalFishingWatch/gfw-common.git

Install uv for faster installs:

./install-uv.sh

Create virtual environment and activate it:

make venv
source .venv/bin/activate

Install pre-commit hooks for local development:

make install-pre-commit

Install dependencies and package in editable mode for local development:

make install

Make sure you can run unit tests:

make test

Development Workflow

Regarding the git workflow, we follow GitHub Flow. See GITHUB-FLOW.md for a quick summary.

Try to write good commit messages. See How to Write a Git Commit Message guide for details.

The pre-commit hooks will take care of validating your code before a commit in terms of PEP8 standards, type-checking, miss-pellings, missing documentation, etc. If you want/need to do it manually, you have commands in the Makefile. To see options, type make.

How to Release

Creating a tag will automatically trigger a GitHub Action (release.yaml) to publish the package to PyPI. The tag must match the version declared in pyproject.toml; this will be validated by the action. The tag name must follow the format vX.Y.Z.

In this context, X, Y and Z refer to MAJOR, MINOR and PATCH of Semantic Versioning.

Metadata

Release files for gfw-common 0.27.1

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

Source distribution (sdist)

Source distribution for gfw-common 0.27.1
File Size Uploaded Provenance Actions
gfw_common-0.27.1.tar.gz 114.7 kB Without provenance Details for gfw_common-0.27.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gfw-common 0.27.1
File Interpreter ABI Platform Actions
gfw_common-0.27.1-py3-none-any.whl Python 3 none any Details for gfw_common-0.27.1-py3-none-any.whl

Total release size: 203.9 kB

Release files / gfw_common-0.27.1.tar.gz

Download URL gfw_common-0.27.1.tar.gz
Size 114.7 kB
Tags Source
SHA-256 checksum
How to use checksums
327c0d59adce0a98369df55de45dec896f7277f78f0573f072957118a7f8de7c
BLAKE2b-256 checksum
How to use checksums
500ecfdf95df401798c3b7a58ecf6f628f1a3791ba44039817ca3a5c164e839d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / gfw_common-0.27.1-py3-none-any.whl

Download URL gfw_common-0.27.1-py3-none-any.whl
Size 89.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d309b6d972e94afa67f1154948a4447d44f5daf210a74e6df35d2ee207c634f
BLAKE2b-256 checksum
How to use checksums
0f64b2265c3ea924d3623d29807b3007b388c6c678b28f0e93593b38e46b56e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for gfw-common 0.27.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.27.1 This release

2 release files No provenance

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