skillfed

regions

An Astropy coordinated package for region handling

regions v0.12 118.9K downloads/30d#12,097 on PyPI65
Permissive license BSD-3-Clause Active released

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 regions

uv

uv add regions

poetry

poetry add regions

Installing 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

Intended Audience :: Science/ResearchNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Astronomy

Tags

astronomical region handlingsky region geometryastropy regionscelestial coordinate regionsastronomy region maskspixel region definitionssky aperture tools
astronomyastropy-ecosystemspatial-geometry

More Astronomy packages