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.

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

Download files

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

Source Distribution

gfw_common-0.14.3.tar.gz (90.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gfw_common-0.14.3-py3-none-any.whl (74.7 kB view details)

Uploaded Python 3

File details

Details for the file gfw_common-0.14.3.tar.gz.

File metadata

  • Download URL: gfw_common-0.14.3.tar.gz
  • Upload date:
  • Size: 90.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for gfw_common-0.14.3.tar.gz
Algorithm Hash digest
SHA256 7217bea2bf3830c877a1fb95e5213433e1f1ce6849f45511023d9dcd2c71305b
MD5 1c118c2c6b6821ca4b7e6c407c0697bd
BLAKE2b-256 d363f255b128f558e12f2f25d913455d0e294652269b9a9a3c056dc1475a9208

See more details on using hashes here.

File details

Details for the file gfw_common-0.14.3-py3-none-any.whl.

File metadata

  • Download URL: gfw_common-0.14.3-py3-none-any.whl
  • Upload date:
  • Size: 74.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for gfw_common-0.14.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ffa47625ca5b4293122da835a5bb3e89ba242d69e32255d8645cd376946c4602
MD5 d9d05a0d7e28daba8469e824660995e6
BLAKE2b-256 de520da8431ee9bc0b28e2ed48d5fc01ac16332e53697b0d73d108a875e6a6ca

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.14.3 This release

2 files

0.14.2

2 files

0.14.1

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 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