regions
An Astropy coordinated package for region handling
What it is and what it does
Regions is an Astropy package that provides a unified interface for working with astronomical regions—geometric shapes defined on the celestial sphere or in pixel coordinates. It handles the creation, manipulation, and analysis of regions commonly used in astronomy workflows. The package integrates tightly with astropy and numpy, allowing astronomers to work with regions in a Pythonic way.
The package is actively maintained as part of the Astropy ecosystem and supports current Python versions. It includes both sky-based regions and pixel-based regions, enabling flexible region handling across different astronomical data types and workflows.
Use it for:
- Define apertures for photometric measurements on astronomical images
- Create masks to exclude or include specific regions when analyzing survey data
- Convert between different region coordinate systems in astronomical workflows
- Store and retrieve region definitions for reproducible astronomical analysis
- Filter astronomical catalogs based on spatial region membership
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Regions provides tools for defining, manipulating, and analyzing astronomical regions—geometric shapes on the sky used in astronomy data analysis.
Yes, if you work with astronomical data and need to define or manipulate spatial regions. The package is actively maintained, has no known vulnerabilities, and integrates with the Astropy ecosystem. The medium install friction is typical for scientific Python packages with compiled dependencies. BSD-3-Clause licensing poses no restrictions for most use cases.
Install
regions on PyPI
pip
pip install regionsuv
uv add regionspoetry
poetry add regionsInstalling regions
Before you install
Medium install friction due to compiled dependencies. Active maintenance with recent release; last commit was 2026-08-07. Requires Python 3.11 or later.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions, provided the license notice is retained.
Quickstart
pip install regions
import regions
import numpy
import astropy
# Create a region for astronomical analysis
region = regions.Region()
Requires Python 3.11 or later; astropy and numpy must be installed.
Verify before relying
- Specific region types supported (circular, elliptical, polygonal, etc.)
- Whether regions can be serialized to/from standard formats (FITS, DS9, etc.)
- Performance characteristics for large region sets or complex geometries
- Concrete usage examples beyond basic region creation
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — astropy, numpy |
| Maintenance | actively maintained — 51 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 118,922/month — #12,097 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: regions-0.12-cp311-abi3-macosx_10_9_x86_64.whl; regions-0.12-cp311-abi3-macosx_11_0_arm64.whl; regions-0.12-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; regions-0.12-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; regions-0.12-cp311-abi3-win_amd64.whl; regions-0.12-cp311-abi3-win_arm64.whl
Keywords: astronomy, astrophysics, astropy, regions
Tags
More Astronomy packages
Albumentations applies image transformations to…
permissive · top 5,000 on PyPI
convertdateConverts dates between the Gregorian calendar…
permissive · top 5,000 on PyPI
jdcalConverts between Julian dates and Gregorian or…
permissive · top 5,000 on PyPI
pyerfaPyERFA wraps the ERFA C library (Essential…
permissive · top 5,000 on PyPI
PyMeeusPyMeeus implements astronomical algorithms from…
copyleft · top 5,000 on PyPI
ephemPyEphem computes high-precision positions of…
permissive · top 5,000 on PyPI
astropy-healpixProvides HEALPix spherical pixelization for…
permissive · top 15,000 on PyPI
photutilsPhotutils provides tools for detecting and…
permissive · top 15,000 on PyPI
regionmaskregionmask creates spatial masks for gridded…
permissive · top 15,000 on PyPI
gwcsGWCS provides tools for managing World…
unclear · top 15,000 on PyPI
PyAVMPyAVM reads, writes, and embeds Astronomy…
permissive · top 15,000 on PyPI
reprojectReproject astronomical images between different…
permissive · top 15,000 on PyPI
specutilsSpecutils provides Python representations of…
permissive · top 15,000 on PyPI
astroqueryAstroquery provides a Python interface to query…
permissive · top 15,000 on PyPI
healpyhealpy wraps the HEALPix C++ library to handle…
copyleft · top 15,000 on PyPI
pyvoPyVO provides Python access to Virtual…
permissive · top 15,000 on PyPI