<h1 align="center" style="border-bottom: none;"> gfw-common </h1>
<p align="center">
<a href="https://github.com/GlobalFishingWatch/gfw-common-client/actions/workflows/ci.yaml" >
<img src="https://github.com/GlobalFishingWatch/gfw-common/actions/workflows/ci.yaml/badge.svg"/>
</a>
<a href="https://codecov.io/gh/GlobalFishingWatch/gfw-common" >
<img src="https://codecov.io/gh/GlobalFishingWatch/gfw-common/graph/badge.svg?token=bpFiU6qtrd"/>
</a>
<a>
<img alt="Python versions" src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue">
</a>
<a>
<img alt="Last release" src="https://img.shields.io/github/v/release/GlobalFishingWatch/gfw-common">
</a>
</p>
Common place for GFW reusable Python components.
[commitizen]: https://github.com/commitizen-tools/commitizen
[Conventional Commits]: https://www.conventionalcommits.org/en/v1.0.0/
[GitHub Flow]: https://githubflow.github.io
[How to Write a Git Commit Message]: https://cbea.ms/git-commit/
[PEP8]: https://peps.python.org/pep-0008/
[pip-tools]: https://pip-tools.readthedocs.io/en/stable/
[Semantic Versioning]: https://semver.org
[examples]: examples/
[GITHUB-FLOW.md]: GITHUB-FLOW.md
[Makefile]: Makefile
[pre-commit hooks]: .pre-commit-config.yaml
[pyproject.toml]: pyproject.toml
[release.yaml]: .github/workflows/release.yaml
[gfw.common.beam]: src/gfw/common/beam/
[gfw.common.cli]: src/gfw/common/cli/
[gfw.common.bigquery_helper.py]: src/gfw/common/bigquery_helper.py
[gfw.common.datetime]: src/gfw/common/datetime.py
[gfw.common.decorators.py]: src/gfw/common/decorators.py
[gfw.common.dictionaries.py]: src/gfw/common/dictionaries.py
[gfw.common.io.py]: src/gfw/common/io.py
[gfw.common.iterables.py]: src/gfw/common/iterables.py
[gfw.common.logging.py]: src/gfw/common/logging.py
[gfw.common.serialization.py]: src/gfw/common/serialization.py
## Introduction
<div align="justify">
The following table shows a summary of the current supported features:
<div align="center">
| 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_helper.py] | Wrapper with extended functionality for bigquery.Client. |
|[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. |
</div>
## 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:
```shell
pip install gfw-common
```
To install all extras, run:
```shell
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.
```shell
git clone https://github.com/GlobalFishingWatch/gfw-common.git
```
Create virtual environment and activate it:
```shell
make venv
./.venv/bin/activate
```
Install the package, dependencies, and pre-commit hooks for local development:
```shell
make install-all
```
Make sure you can run unit tests:
```shell
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`.
</div>
> [!NOTE]
In this context, **X**, **Y** and **Z** refer to **MAJOR**, **MINOR** and **PATCH** of [Semantic Versioning].
Raw data
{
"_id": null,
"home_page": null,
"name": "gfw-common",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "\"Link, Tom\u00e1s Juan Link\" <tomas.link@globalfishingwatch.org>, \"Arana, Andr\u00e9s\" <andres@globalfishingwatch.org>, \"Fuentes, Rodrigo\" <rodrigo.fuentes@globalfishingwatch.org>, \"Piano, Sergio Mat\u00edas\" <matias@globalfishingwatch.org>",
"keywords": "global fishing watch, gfw, python, utils",
"author": null,
"author_email": "\"Link, Tom\u00e1s Juan Link\" <tomas.link@globalfishingwatch.org>, \"Arana, Andr\u00e9s\" <andres@globalfishingwatch.org>, \"Fuentes, Rodrigo\" <rodrigo.fuentes@globalfishingwatch.org>, \"Piano, Sergio Mat\u00edas\" <matias@globalfishingwatch.org>",
"download_url": "https://files.pythonhosted.org/packages/df/cc/9244a235b59dab71238c590dc27de9e84bcf17ce279c4396c9e4f2a8d2c6/gfw_common-0.1.0rc7.tar.gz",
"platform": null,
"description": "<h1 align=\"center\" style=\"border-bottom: none;\"> gfw-common </h1>\n\n<p align=\"center\">\n <a href=\"https://github.com/GlobalFishingWatch/gfw-common-client/actions/workflows/ci.yaml\" >\n <img src=\"https://github.com/GlobalFishingWatch/gfw-common/actions/workflows/ci.yaml/badge.svg\"/>\n </a>\n <a href=\"https://codecov.io/gh/GlobalFishingWatch/gfw-common\" >\n <img src=\"https://codecov.io/gh/GlobalFishingWatch/gfw-common/graph/badge.svg?token=bpFiU6qtrd\"/>\n </a>\n <a>\n <img alt=\"Python versions\" src=\"https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue\">\n </a>\n <a>\n <img alt=\"Last release\" src=\"https://img.shields.io/github/v/release/GlobalFishingWatch/gfw-common\">\n </a>\n</p>\n\nCommon place for GFW reusable Python components.\n\n[commitizen]: https://github.com/commitizen-tools/commitizen\n[Conventional Commits]: https://www.conventionalcommits.org/en/v1.0.0/\n[GitHub Flow]: https://githubflow.github.io\n[How to Write a Git Commit Message]: https://cbea.ms/git-commit/\n[PEP8]: https://peps.python.org/pep-0008/\n[pip-tools]: https://pip-tools.readthedocs.io/en/stable/\n[Semantic Versioning]: https://semver.org\n\n[examples]: examples/\n[GITHUB-FLOW.md]: GITHUB-FLOW.md\n[Makefile]: Makefile\n[pre-commit hooks]: .pre-commit-config.yaml\n[pyproject.toml]: pyproject.toml\n[release.yaml]: .github/workflows/release.yaml\n\n[gfw.common.beam]: src/gfw/common/beam/\n[gfw.common.cli]: src/gfw/common/cli/\n[gfw.common.bigquery_helper.py]: src/gfw/common/bigquery_helper.py\n[gfw.common.datetime]: src/gfw/common/datetime.py\n[gfw.common.decorators.py]: src/gfw/common/decorators.py\n[gfw.common.dictionaries.py]: src/gfw/common/dictionaries.py\n[gfw.common.io.py]: src/gfw/common/io.py\n[gfw.common.iterables.py]: src/gfw/common/iterables.py\n[gfw.common.logging.py]: src/gfw/common/logging.py\n[gfw.common.serialization.py]: src/gfw/common/serialization.py\n\n\n## Introduction\n\n<div align=\"justify\">\n\nThe following table shows a summary of the current supported features:\n\n<div align=\"center\">\n\n| Module/Package | Description |\n| ------------------------------ | ------------------------------------------------------------------- |\n|[gfw.common.beam] | Common utilities and wrappers for Apache Beam pipelines. |\n|[gfw.common.cli] | Lightweight framework around argparse for building CLIs more easily.|\n|[gfw.common.bigquery_helper.py] | Wrapper with extended functionality for bigquery.Client. |\n|[gfw.common.datetime] | Simple helper functions around stdlib datetime module. |\n|[gfw.common.decorators.py] | Basic function decorators. |\n|[gfw.common.dictionaries.py] | Simple helper functions for dictionary manipulation. |\n|[gfw.common.io.py] | Basic IO functions. |\n|[gfw.common.iterables.py] | Iterables utilities. |\n|[gfw.common.logging.py] | Basic logging configuration. |\n|[gfw.common.serialization.py] | Basic serialization utilities. |\n\n</div>\n\n## Installation\n\nThe package offers extras to avoid installing unnecessary dependencies:\n\n- `beam`: includes dependencies for the `gfw.common.beam` package.\n- `bq`: includes dependencies for BigQuery utilities.\n\nFor a default installation without extras, run:\n```shell\npip install gfw-common\n```\nTo install all extras, run:\n```shell\npip install gfw-common[bq,beam]\n```\n\n## Usage\n\nYou can see examples in the [examples] folder.\n\n## How to Contribute\n\n### Preparing the environment\n\nFirst, clone the repository.\n```shell\ngit clone https://github.com/GlobalFishingWatch/gfw-common.git\n```\n\nCreate virtual environment and activate it:\n```shell\nmake venv\n./.venv/bin/activate\n```\n\nInstall the package, dependencies, and pre-commit hooks for local development:\n```shell\nmake install-all\n```\n\nMake sure you can run unit tests:\n```shell\nmake test\n```\n\n### Development Workflow\n\nRegarding the git workflow, we follow [GitHub Flow].\nSee [GITHUB-FLOW.md] for a quick summary.\n\nTry to write good commit messages.\nSee [How to Write a Git Commit Message] guide for details.\n\nThe [pre-commit hooks] will take care of validating your code before a commit\nin terms of [PEP8] standards, type-checking, miss-pellings, missing documentation, etc.\nIf you want/need to do it manually, you have commands in the [Makefile].\nTo see options, type `make`.\n\n### How to Release\n\nCreating a tag will automatically trigger a GitHub Action ([release.yaml]) to publish the package to PyPI.\nThe tag must match the version declared in [pyproject.toml]; this will be validated by the action.\nThe tag name must follow the format `vX.Y.Z`.\n\n</div>\n\n> [!NOTE]\nIn this context, **X**, **Y** and **Z** refer to **MAJOR**, **MINOR** and **PATCH** of [Semantic Versioning].\n",
"bugtrack_url": null,
"license": null,
"summary": "Common place for GFW reusable Python components.",
"version": "0.1.0rc7",
"project_urls": {
"Changelog": "https://github.com/GlobalFishingWatch/gfw-common/blob/main/CHANGELOG.md",
"Documentation": "https://globalfishingwatch.github.io/gfw-common/",
"Homepage": "https://github.com/GlobalFishingWatch/gfw-common",
"Issues": "https://github.com/GlobalFishingWatch/gfw-common/issues",
"Repository": "https://github.com/GlobalFishingWatch/gfw-common"
},
"split_keywords": [
"global fishing watch",
" gfw",
" python",
" utils"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c5849e8f47351f4e8af03afee679f43f844ff495f985d08b8bc934366b5f6225",
"md5": "8892bc0938c072ec182a52a24b19f576",
"sha256": "dbc53eaf6fc22c2ce16057ebd1835d30031609ebda2fba7938412d6c3943384c"
},
"downloads": -1,
"filename": "gfw_common-0.1.0rc7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8892bc0938c072ec182a52a24b19f576",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 46089,
"upload_time": "2025-07-16T22:29:04",
"upload_time_iso_8601": "2025-07-16T22:29:04.449306Z",
"url": "https://files.pythonhosted.org/packages/c5/84/9e8f47351f4e8af03afee679f43f844ff495f985d08b8bc934366b5f6225/gfw_common-0.1.0rc7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "dfcc9244a235b59dab71238c590dc27de9e84bcf17ce279c4396c9e4f2a8d2c6",
"md5": "32fa66645e1c9238ac9864fa9d6bfa38",
"sha256": "d7cf6ea0228512ccb5af66a7d3f6ea9e655a95a61f9f350e68cade889fbc3488"
},
"downloads": -1,
"filename": "gfw_common-0.1.0rc7.tar.gz",
"has_sig": false,
"md5_digest": "32fa66645e1c9238ac9864fa9d6bfa38",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 54876,
"upload_time": "2025-07-16T22:29:06",
"upload_time_iso_8601": "2025-07-16T22:29:06.499117Z",
"url": "https://files.pythonhosted.org/packages/df/cc/9244a235b59dab71238c590dc27de9e84bcf17ce279c4396c9e4f2a8d2c6/gfw_common-0.1.0rc7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-16 22:29:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "GlobalFishingWatch",
"github_project": "gfw-common",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "gfw-common"
}