Common place for GFW reusable Python components.
Project description
gfw-common
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 thegfw.common.beampackage.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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gfw_common-0.9.0.tar.gz.
File metadata
- Download URL: gfw_common-0.9.0.tar.gz
- Upload date:
- Size: 78.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7278dcb9d7e73076d7b312b03cf0420b47e6c56233c105f1643d0c2570fc6910
|
|
| MD5 |
04d4bd67e635277f382e518f4aa214c9
|
|
| BLAKE2b-256 |
47d408fa873efe535e012ce6825d37b960dfce85e25e60a3c000a62d55161e00
|
File details
Details for the file gfw_common-0.9.0-py3-none-any.whl.
File metadata
- Download URL: gfw_common-0.9.0-py3-none-any.whl
- Upload date:
- Size: 70.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
647bddab66dc306d3b04304d3e2a247c6ec7b8c44b5fdae47a46fe07a6a7c5c9
|
|
| MD5 |
196b18651aab211a083123babce5e858
|
|
| BLAKE2b-256 |
b37f433e68f4e121e02de245714c45e1bb3a1a24fb96e0e28e4084fbad37dfc8
|