# PyGMT
> A Python interface for the Generic Mapping Tools
[Documentation (development version)](https://www.pygmt.org/dev) | [Contact](https://forum.generic-mapping-tools.org) | [TryOnline](https://github.com/GenericMappingTools/try-gmt)
[![Latest version on PyPI](http://img.shields.io/pypi/v/pygmt.svg?style=flat-square)](https://pypi.python.org/pypi/pygmt)
[![Latest version on conda-forge](https://img.shields.io/conda/v/conda-forge/pygmt?style=flat-square)](https://anaconda.org/conda-forge/pygmt)
[![GitHub Actions Tests status](https://github.com/GenericMappingTools/pygmt/workflows/Tests/badge.svg)](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests.yaml)
[![GitHub Actions GMT Dev Tests status](https://github.com/GenericMappingTools/pygmt/workflows/GMT%20Dev%20Tests/badge.svg)](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Test coverage status](https://codecov.io/gh/GenericMappingTools/pygmt/branch/main/graph/badge.svg?token=78Fu4EWstx)](https://app.codecov.io/gh/GenericMappingTools/pygmt)
[![CodSpeed Performance Benchmarks](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/GenericMappingTools/pygmt)
[![Compatible Python versions.](https://img.shields.io/pypi/pyversions/pygmt.svg?style=flat-square)](https://pypi.python.org/pypi/pygmt)
[![Discourse forum](https://img.shields.io/discourse/status?label=forum&server=https%3A%2F%2Fforum.generic-mapping-tools.org%2F&style=flat-square)](https://forum.generic-mapping-tools.org)
[![Digital Object Identifier for the Zenodo archive](https://zenodo.org/badge/DOI/10.5281/3781524.svg)](https://doi.org/10.5281/zenodo.3781524)
[![PyOpenSci](https://tinyurl.com/y22nb8up)](https://github.com/pyOpenSci/software-review/issues/43)
[![GitHub license](https://img.shields.io/github/license/GenericMappingTools/pygmt?style=flat-square)](https://github.com/GenericMappingTools/pygmt/blob/main/LICENSE.txt)
[![Contributor Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.1%20adopted-ff69b4.svg)](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md)
<!-- doc-index-start-after -->
## Why PyGMT?
A beautiful map is worth a thousand words. To truly understand how powerful PyGMT is, play with it online on
[Binder](https://github.com/GenericMappingTools/try-gmt)! For a quicker introduction, check out our
[3 minute overview](https://youtu.be/4iPnITXrxVU)!
Afterwards, feel free to look at our [Tutorials](https://www.pygmt.org/latest/tutorials), visit the
[Gallery](https://www.pygmt.org/latest/gallery), and check out some
[external PyGMT examples](https://www.pygmt.org/latest/external_resources.html)!
![Quick Introduction to PyGMT YouTube Video](doc/_static/scipy2022-youtube-thumbnail.jpg)
## About
PyGMT is a library for processing geospatial and geophysical data and making publication-quality
maps and figures. It provides a Pythonic interface for the
[Generic Mapping Tools (GMT)](https://github.com/GenericMappingTools/gmt), a command-line program
widely used across the Earth, Ocean, and Planetary sciences and beyond.
## Project goals
- Make GMT more accessible to new users.
- Build a Pythonic API for GMT.
- Interface with the GMT C API directly using ctypes (no system calls).
- Support for rich display in the Jupyter notebook.
- Integration with the [PyData ecosystem](https://pydata.org/): `numpy.ndarray` or `pandas.DataFrame` for
data tables, `xarray.DataArray` for grids, and `geopandas.GeoDataFrame` for geographical data.
## Quickstart
### Installation
Simple installation using [mamba](https://mamba.readthedocs.org/):
```bash
mamba install --channel conda-forge pygmt
```
If you use [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/index.html):
```bash
conda install --channel conda-forge pygmt
```
For other ways to install `pygmt`, see the [full installation instructions](https://www.pygmt.org/latest/install.html).
### Getting started
As a starting point, you can open a [Python interpreter](https://docs.python.org/3/tutorial/interpreter.html)
or a [Jupyter notebook](https://docs.jupyter.org/en/latest/running.html), and try the following example:
``` python
import pygmt
fig = pygmt.Figure()
fig.coast(projection="N15c", region="g", frame=True, land="tan", water="lightblue")
fig.text(position="MC", text="PyGMT", font="80p,Helvetica-Bold,red@75")
fig.show()
```
You should see a global map with land and water masses colored in tan and lightblue, respectively. On top,
there should be the semi-transparent text "PyGMT". For more examples, please have a look at the
[Gallery](https://www.pygmt.org/latest/gallery/index.html) and
[Tutorials](https://www.pygmt.org/latest/tutorials/index.html).
## Contacting us
- Most discussion happens [on GitHub](https://github.com/GenericMappingTools/pygmt).
Feel free to [open an issue](https://github.com/GenericMappingTools/pygmt/issues/new) or comment on any open
issue or pull request.
- We have a [Discourse forum](https://forum.generic-mapping-tools.org/c/questions/pygmt-q-a) where you can ask
questions and leave comments.
## Contributing
### Code of conduct
Please note that this project is released with a
[Contributor Code of Conduct](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md).
By participating in this project you agree to abide by its terms.
### Contributing guidelines
Please read our [Contributing Guide](https://github.com/GenericMappingTools/pygmt/blob/main/CONTRIBUTING.md)
to see how you can help and give feedback.
### Imposter syndrome disclaimer
**We want your help.** No, really.
There may be a little voice inside your head that is telling you that you're not ready to be an open source
contributor; that your skills aren't nearly good enough to contribute. What could you possibly offer?
We assure you that the little voice in your head is wrong.
**Being a contributor doesn't just mean writing code.** Equally important contributions include: writing or
proof-reading documentation, suggesting or implementing tests, or even giving feedback about the project
(including giving feedback about the contribution process). If you're coming to the project with fresh eyes,
you might see the errors and assumptions that seasoned contributors have glossed over. If you can write any
code at all, you can contribute code to open source. We are constantly trying out new skills, making mistakes,
and learning from those mistakes. That's how we all improve and we are happy to help others learn.
*This disclaimer was adapted from the* [MetPy project](https://github.com/Unidata/MetPy).
## Citing PyGMT
PyGMT is a community developed project. See the
[AUTHORS.md](https://github.com/GenericMappingTools/pygmt/blob/main/AUTHORS.md) file on GitHub for a list of
the people involved and a definition of the term "PyGMT Developers". Feel free to cite our work in your
research using the following BibTeX:
```
@software{
pygmt_2024_13679420,
author = {Tian, Dongdong and
Uieda, Leonardo and
Leong, Wei Ji and
Fröhlich, Yvonne and
Schlitzer, William and
Grund, Michael and
Jones, Max and
Toney, Liam and
Yao, Jiayuan and
Magen, Yohai and
Tong, Jing-Hui and
Materna, Kathryn and
Belem, Andre and
Newton, Tyler and
Anant, Abhishek and
Ziebarth, Malte and
Quinn, Jamie and
Wessel, Paul},
title = {{PyGMT: A Python interface for the Generic Mapping Tools}},
month = sep,
year = 2024,
publisher = {Zenodo},
version = {0.13.0},
doi = {10.5281/zenodo.13679420},
url = {https://doi.org/10.5281/zenodo.13679420}
}
```
To cite a specific version of PyGMT, go to our Zenodo page at <https://doi.org/10.5281/zenodo.3781524>
and use the "Export to BibTeX" function there. It is also strongly recommended to cite the
[GMT 6 paper](https://doi.org/10.1029/2019GC008515) (which PyGMT wraps around). Note that some modules
like `dimfilter`, `surface`, and `x2sys` also have their dedicated citations. Further information for
all these can be found at <https://www.generic-mapping-tools.org/cite>.
## License
PyGMT is free software: you can redistribute it and/or modify it under the terms of the
**BSD 3-clause License**. A copy of this license is provided in
[LICENSE.txt](https://github.com/GenericMappingTools/pygmt/blob/main/LICENSE.txt).
## Support
The development of PyGMT has been supported by NSF grants
[OCE-1558403](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1558403) and
[EAR-1948603](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1948602).
## Related projects
Other official wrappers for GMT:
- [GMT.jl](https://github.com/GenericMappingTools/GMT.jl): A Julia wrapper for GMT.
- [gmtmex](https://github.com/GenericMappingTools/gmtmex): A Matlab/Octave wrapper for GMT.
<!-- doc-index-end-before -->
## Minimum supported versions
PyGMT has adopted [SPEC 0](https://scientific-python.org/specs/spec-0000/) alongside the
rest of the Scientific Python ecosystem, and therefore:
- Support for Python versions be dropped 3 years after their initial release.
- Support for core package dependencies (NumPy/Pandas/Xarray) be dropped 2 years after
their initial release.
Similarly, the PyGMT team has decided to discontinue support for GMT versions 3 years
after their initial release.
Please see [Minimum Supported Versions](https://www.pygmt.org/dev/minversions.html) for
the minimum supported versions of GMT, Python and core package dependencies.
Raw data
{
"_id": null,
"home_page": null,
"name": "pygmt",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "cartography, geodesy, geology, geophysics, geospatial, oceanography, seismology",
"author": null,
"author_email": "The PyGMT Developers <pygmt.team@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/66/da/9cd4985e323349e1d51daffdae98c2c7c077f04d3a17bc1d04867d27b9b1/pygmt-0.13.0.tar.gz",
"platform": "Any",
"description": "# PyGMT\n\n> A Python interface for the Generic Mapping Tools\n\n[Documentation (development version)](https://www.pygmt.org/dev) | [Contact](https://forum.generic-mapping-tools.org) | [TryOnline](https://github.com/GenericMappingTools/try-gmt)\n\n[![Latest version on PyPI](http://img.shields.io/pypi/v/pygmt.svg?style=flat-square)](https://pypi.python.org/pypi/pygmt)\n[![Latest version on conda-forge](https://img.shields.io/conda/v/conda-forge/pygmt?style=flat-square)](https://anaconda.org/conda-forge/pygmt)\n[![GitHub Actions Tests status](https://github.com/GenericMappingTools/pygmt/workflows/Tests/badge.svg)](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests.yaml)\n[![GitHub Actions GMT Dev Tests status](https://github.com/GenericMappingTools/pygmt/workflows/GMT%20Dev%20Tests/badge.svg)](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Test coverage status](https://codecov.io/gh/GenericMappingTools/pygmt/branch/main/graph/badge.svg?token=78Fu4EWstx)](https://app.codecov.io/gh/GenericMappingTools/pygmt)\n[![CodSpeed Performance Benchmarks](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/GenericMappingTools/pygmt)\n[![Compatible Python versions.](https://img.shields.io/pypi/pyversions/pygmt.svg?style=flat-square)](https://pypi.python.org/pypi/pygmt)\n[![Discourse forum](https://img.shields.io/discourse/status?label=forum&server=https%3A%2F%2Fforum.generic-mapping-tools.org%2F&style=flat-square)](https://forum.generic-mapping-tools.org)\n[![Digital Object Identifier for the Zenodo archive](https://zenodo.org/badge/DOI/10.5281/3781524.svg)](https://doi.org/10.5281/zenodo.3781524)\n[![PyOpenSci](https://tinyurl.com/y22nb8up)](https://github.com/pyOpenSci/software-review/issues/43)\n[![GitHub license](https://img.shields.io/github/license/GenericMappingTools/pygmt?style=flat-square)](https://github.com/GenericMappingTools/pygmt/blob/main/LICENSE.txt)\n[![Contributor Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.1%20adopted-ff69b4.svg)](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md)\n\n<!-- doc-index-start-after -->\n\n## Why PyGMT?\n\nA beautiful map is worth a thousand words. To truly understand how powerful PyGMT is, play with it online on\n[Binder](https://github.com/GenericMappingTools/try-gmt)! For a quicker introduction, check out our\n[3 minute overview](https://youtu.be/4iPnITXrxVU)!\n\nAfterwards, feel free to look at our [Tutorials](https://www.pygmt.org/latest/tutorials), visit the\n[Gallery](https://www.pygmt.org/latest/gallery), and check out some\n[external PyGMT examples](https://www.pygmt.org/latest/external_resources.html)!\n\n![Quick Introduction to PyGMT YouTube Video](doc/_static/scipy2022-youtube-thumbnail.jpg)\n\n## About\n\nPyGMT is a library for processing geospatial and geophysical data and making publication-quality\nmaps and figures. It provides a Pythonic interface for the\n[Generic Mapping Tools (GMT)](https://github.com/GenericMappingTools/gmt), a command-line program\nwidely used across the Earth, Ocean, and Planetary sciences and beyond.\n\n## Project goals\n\n- Make GMT more accessible to new users.\n- Build a Pythonic API for GMT.\n- Interface with the GMT C API directly using ctypes (no system calls).\n- Support for rich display in the Jupyter notebook.\n- Integration with the [PyData ecosystem](https://pydata.org/): `numpy.ndarray` or `pandas.DataFrame` for\n data tables, `xarray.DataArray` for grids, and `geopandas.GeoDataFrame` for geographical data.\n\n## Quickstart\n\n### Installation\n\nSimple installation using [mamba](https://mamba.readthedocs.org/):\n\n```bash\nmamba install --channel conda-forge pygmt\n```\n\nIf you use [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/index.html):\n\n```bash\nconda install --channel conda-forge pygmt\n```\n\nFor other ways to install `pygmt`, see the [full installation instructions](https://www.pygmt.org/latest/install.html).\n\n### Getting started\n\nAs a starting point, you can open a [Python interpreter](https://docs.python.org/3/tutorial/interpreter.html)\nor a [Jupyter notebook](https://docs.jupyter.org/en/latest/running.html), and try the following example:\n\n``` python\nimport pygmt\nfig = pygmt.Figure()\nfig.coast(projection=\"N15c\", region=\"g\", frame=True, land=\"tan\", water=\"lightblue\")\nfig.text(position=\"MC\", text=\"PyGMT\", font=\"80p,Helvetica-Bold,red@75\")\nfig.show()\n```\n\nYou should see a global map with land and water masses colored in tan and lightblue, respectively. On top,\nthere should be the semi-transparent text \"PyGMT\". For more examples, please have a look at the\n[Gallery](https://www.pygmt.org/latest/gallery/index.html) and\n[Tutorials](https://www.pygmt.org/latest/tutorials/index.html).\n\n## Contacting us\n\n- Most discussion happens [on GitHub](https://github.com/GenericMappingTools/pygmt).\n Feel free to [open an issue](https://github.com/GenericMappingTools/pygmt/issues/new) or comment on any open\n issue or pull request.\n- We have a [Discourse forum](https://forum.generic-mapping-tools.org/c/questions/pygmt-q-a) where you can ask\n questions and leave comments.\n\n## Contributing\n\n### Code of conduct\n\nPlease note that this project is released with a\n[Contributor Code of Conduct](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md).\nBy participating in this project you agree to abide by its terms.\n\n### Contributing guidelines\n\nPlease read our [Contributing Guide](https://github.com/GenericMappingTools/pygmt/blob/main/CONTRIBUTING.md)\nto see how you can help and give feedback.\n\n### Imposter syndrome disclaimer\n\n**We want your help.** No, really.\n\nThere may be a little voice inside your head that is telling you that you're not ready to be an open source\ncontributor; that your skills aren't nearly good enough to contribute. What could you possibly offer?\n\nWe assure you that the little voice in your head is wrong.\n\n**Being a contributor doesn't just mean writing code.** Equally important contributions include: writing or\nproof-reading documentation, suggesting or implementing tests, or even giving feedback about the project\n(including giving feedback about the contribution process). If you're coming to the project with fresh eyes,\nyou might see the errors and assumptions that seasoned contributors have glossed over. If you can write any\ncode at all, you can contribute code to open source. We are constantly trying out new skills, making mistakes,\nand learning from those mistakes. That's how we all improve and we are happy to help others learn.\n\n*This disclaimer was adapted from the* [MetPy project](https://github.com/Unidata/MetPy).\n\n## Citing PyGMT\n\nPyGMT is a community developed project. See the\n[AUTHORS.md](https://github.com/GenericMappingTools/pygmt/blob/main/AUTHORS.md) file on GitHub for a list of\nthe people involved and a definition of the term \"PyGMT Developers\". Feel free to cite our work in your\nresearch using the following BibTeX:\n\n```\n@software{\n pygmt_2024_13679420,\n author = {Tian, Dongdong and\n Uieda, Leonardo and\n Leong, Wei Ji and\n Fr\u00f6hlich, Yvonne and\n Schlitzer, William and\n Grund, Michael and\n Jones, Max and\n Toney, Liam and\n Yao, Jiayuan and\n Magen, Yohai and\n Tong, Jing-Hui and\n Materna, Kathryn and\n Belem, Andre and\n Newton, Tyler and\n Anant, Abhishek and\n Ziebarth, Malte and\n Quinn, Jamie and\n Wessel, Paul},\n title = {{PyGMT: A Python interface for the Generic Mapping Tools}},\n month = sep,\n year = 2024,\n publisher = {Zenodo},\n version = {0.13.0},\n doi = {10.5281/zenodo.13679420},\n url = {https://doi.org/10.5281/zenodo.13679420}\n}\n```\n\nTo cite a specific version of PyGMT, go to our Zenodo page at <https://doi.org/10.5281/zenodo.3781524>\nand use the \"Export to BibTeX\" function there. It is also strongly recommended to cite the\n[GMT 6 paper](https://doi.org/10.1029/2019GC008515) (which PyGMT wraps around). Note that some modules\nlike `dimfilter`, `surface`, and `x2sys` also have their dedicated citations. Further information for\nall these can be found at <https://www.generic-mapping-tools.org/cite>.\n\n## License\n\nPyGMT is free software: you can redistribute it and/or modify it under the terms of the\n**BSD 3-clause License**. A copy of this license is provided in\n[LICENSE.txt](https://github.com/GenericMappingTools/pygmt/blob/main/LICENSE.txt).\n\n## Support\n\nThe development of PyGMT has been supported by NSF grants\n[OCE-1558403](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1558403) and\n[EAR-1948603](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1948602).\n\n## Related projects\n\nOther official wrappers for GMT:\n\n- [GMT.jl](https://github.com/GenericMappingTools/GMT.jl): A Julia wrapper for GMT.\n- [gmtmex](https://github.com/GenericMappingTools/gmtmex): A Matlab/Octave wrapper for GMT.\n\n<!-- doc-index-end-before -->\n\n## Minimum supported versions\n\nPyGMT has adopted [SPEC 0](https://scientific-python.org/specs/spec-0000/) alongside the\nrest of the Scientific Python ecosystem, and therefore:\n\n- Support for Python versions be dropped 3 years after their initial release.\n- Support for core package dependencies (NumPy/Pandas/Xarray) be dropped 2 years after\n their initial release.\n\nSimilarly, the PyGMT team has decided to discontinue support for GMT versions 3 years\nafter their initial release.\n\nPlease see [Minimum Supported Versions](https://www.pygmt.org/dev/minversions.html) for\nthe minimum supported versions of GMT, Python and core package dependencies.\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python interface for the Generic Mapping Tools",
"version": "0.13.0",
"project_urls": {
"changelog": "https://www.pygmt.org/latest/changes.html",
"documentation": "https://www.pygmt.org",
"homepage": "https://www.pygmt.org",
"repository": "https://github.com/GenericMappingTools/pygmt"
},
"split_keywords": [
"cartography",
" geodesy",
" geology",
" geophysics",
" geospatial",
" oceanography",
" seismology"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6728d9ad520d4b75ab4c6e373355b17f893ca75bae7fab6a2251378fcce9a2cc",
"md5": "caa4c66a7361fc4106719414fe77e4c4",
"sha256": "403180ba986261364496dfe6c380048bbaec45aff34635bbb87d60856c1eca73"
},
"downloads": -1,
"filename": "pygmt-0.13.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "caa4c66a7361fc4106719414fe77e4c4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 267697,
"upload_time": "2024-09-05T11:55:17",
"upload_time_iso_8601": "2024-09-05T11:55:17.503093Z",
"url": "https://files.pythonhosted.org/packages/67/28/d9ad520d4b75ab4c6e373355b17f893ca75bae7fab6a2251378fcce9a2cc/pygmt-0.13.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "66da9cd4985e323349e1d51daffdae98c2c7c077f04d3a17bc1d04867d27b9b1",
"md5": "df66bedc46f05c05bbaaa27bf7cbc47f",
"sha256": "f44909ff7a87cac537a5eaad37168c324d74a99aef5416c565dce2fe6a7beb39"
},
"downloads": -1,
"filename": "pygmt-0.13.0.tar.gz",
"has_sig": false,
"md5_digest": "df66bedc46f05c05bbaaa27bf7cbc47f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 198467,
"upload_time": "2024-09-05T11:55:19",
"upload_time_iso_8601": "2024-09-05T11:55:19.101041Z",
"url": "https://files.pythonhosted.org/packages/66/da/9cd4985e323349e1d51daffdae98c2c7c077f04d3a17bc1d04867d27b9b1/pygmt-0.13.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-05 11:55:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "GenericMappingTools",
"github_project": "pygmt",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pygmt"
}