$npx skillfedfor your agent

affine

Matrices describing affine transformation of the plane

Worth itPyPI GISReleased Aug 20265.5M downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — affine-3.0.0-py3-none-any.whl
v3.0.0 · released 2026-08-08 · Python >=3.9 · 1 runtime deps: attrs

Yes. Affine is a stable, actively maintained library (Production/Stable status, released 6 days ago) with no known vulnerabilities, minimal dependencies, and a clear use case in geospatial and graphics work. The permissive license and Python 3.9+ support make it safe to adopt. Install it if you work with georeferenced rasters, need to compose 2D transformations, or integrate with GDAL-based tools.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • Low friction: pure Python wheel with a single lightweight dependency (attrs).
  • Active maintenance with a recent release (6 days old) and steady repository activity.

License · maintenance · safety

permissive license (permissive) — Permissive license allows use in commercial and open-source projects without significant restrictions.

last release 2026-08-08 (6 days) · last repo commit 2026-08-14 · 175 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 5,464,538 downloads/mo, #2,094 on PyPI

Verify before relying

from affine import Affine

# Create a translation transformation
transform = Affine.translation(1.0, 5.0)

# Apply to coordinates
result = transform * (1.0, 1.0)
print(result)  # (2.0, 6.0)

# Combine transformations
combined = Affine.translation(1.0, 5.0) * Affine.rotation(45.0)
  • Whether the package provides inverse transformation computation beyond the ~ operator shown in examples
  • Performance characteristics when applying transformations to large coordinate arrays
  • Support for 3D affine transformations or whether it is strictly 2D
Same gist for agents: .md · .json

What it is and what it does

Affine is a lightweight library for working with 2D affine transformation matrices. It provides a single core class that represents the 3x3 augmented matrix used to describe transformations like translation, rotation, scaling, and shearing in two dimensions. You construct transformations either by passing raw matrix coefficients or by using convenience class methods (identity, translation, scale, rotation, shear), then apply them to coordinate tuples using the * operator or combine multiple transformations by multiplying matrices together.

The package is particularly useful in geospatial and raster imaging workflows, where affine transformations map pixel coordinates to real-world coordinates. It includes a from_gdal() method to convert GDAL GeoTransform tuples (the standard format used by geospatial libraries) into Affine objects, and supports computing inverse transformations with the ~ operator. With only attrs as a runtime dependency and a pure-Python wheel, it installs with minimal friction.

Use it for

  • Convert pixel coordinates to world coordinates in georeferenced raster datasets using GDAL GeoTransform data
  • Compose multiple geometric transformations (rotation, translation, scaling) into a single matrix for efficient batch application
  • Compute inverse transformations to map world coordinates back to image space in GIS workflows
  • Represent and apply 2D coordinate transformations in graphics or image processing pipelines
  • Build geospatial tools that need to work with standard affine transformation matrices from GDAL or similar libraries

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Affine is a stable, actively maintained library (Production/Stable status, released 6 days ago) with no known vulnerabilities, minimal dependencies, and a clear use case in geospatial and graphics work. The permissive license and Python 3.9+ support make it safe to adopt. Install it if you work with georeferenced rasters, need to compose 2D transformations, or integrate with GDAL-based tools.

Install

affine on PyPI

Before you install

Low friction: pure Python wheel with a single lightweight dependency (attrs). Active maintenance with a recent release (6 days old) and steady repository activity.

Requires Python 3.9 or later.

License in practice

Permissive license allows use in commercial and open-source projects without significant restrictions.

Quickstart

from affine import Affine

# Create a translation transformation
transform = Affine.translation(1.0, 5.0)

# Apply to coordinates
result = transform * (1.0, 1.0)
print(result)  # (2.0, 6.0)

# Combine transformations
combined = Affine.translation(1.0, 5.0) * Affine.rotation(45.0)

Verify before relying

  • Whether the package provides inverse transformation computation beyond the ~ operator shown in examples
  • Performance characteristics when applying transformations to large coordinate arrays
  • Support for 3D affine transformations or whether it is strictly 2D

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
attrs
MaintenanceActively maintained 6 days since the last release
Last repo commit
First released
Downloads5,464,538 / month, #2,094 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyTopic :: Multimedia :: Graphics :: Graphics ConversionTopic :: Scientific/Engineering :: GISTyping :: Typed

Evidence: affine-3.0.0-py3-none-any.whl

Tags

Capabilities
2d affine transformation matrixcoordinate transformationimage to world coordinatesgdal geotransformgeometric transformationmatrix multiplicationraster georeferencing
Topics
geospatialmatrix-mathcoordinate-transform
PyPI keywords
affinetransformationmatrix

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “2d affine transformation matrix”

  • affineAffine provides a Python class for representing and manipulating 2D…
  • transforms3dConverts between different 3D geometric transformations—rotation…
  • svgelementssvgelements parses SVG files and provides geometric objects (Path,…

Give your agent the search over MCP, or paste the wish link into any chat.

More GIS packages

shapely Worth it
PyPI · GIS · released Sep 2025

Shapely provides Python tools for creating, manipulating, and analyzing 2D geometric objects (points, lines, polygons) using the GEOS library, with both scalar and vectorized NumPy-based operations.

BSD-3-Clausecompiled wheel · 3.10+
85.8Mdownloads / mo
pyproj Unrated
PyPI · Scientific/Engineering · released Aug 2025

pyproj provides a Python interface to PROJ, enabling cartographic projections and coordinate system transformations for geospatial applications.

MITcompiled wheel · 3.11+
28.0Mdownloads / mo
geopandas Worth it
PyPI · GIS · released Jun 2026

GeoPandas extends pandas DataFrames to handle geographic data, combining pandas operations with shapely geometry and spatial analysis capabilities that would otherwise require a spatial database.

Install it if you work with geographic data in Python and want to avoid setting up a spatial database or learning a separate GIS tool.

BSD-3-Clausepure Python · 3.10+
24.8Mdownloads / mo
geopy Worth it
PyPI · Python Modules · released Jul 2026

geopy is a Python client for geocoding and distance calculation that converts addresses to coordinates and vice versa using multiple web-based geocoding services, and computes geodesic and great-circle distances between geographic points.

Install it if you need geocoding or distance calculations in your application.

MITpure Python · 3.8+
19.0Mdownloads / mo
pyogrio Worth it
PyPI · GIS · released Jun 2026

Pyogrio provides fast, bulk-oriented read and write access to vector spatial data formats (Shapefile, GeoPackage, GeoJSON, etc.) via GDAL/OGR bindings, typically for use with GeoPandas GeoDataFrames.

MITcompiled wheel · 3.10+
17.2Mdownloads / mo
h3 Worth it
PyPI · GIS · released May 2026

h3 provides Python bindings to Uber's H3 geospatial indexing library, converting geographic coordinates into hierarchical hexagonal grid cells and performing spatial operations on them.

Apache-2.0compiled wheel · 3.10+
12.1Mdownloads / mo

See also transforms3d · transformations · gwcs · GDAL · pytransform3d · spatial_image · rasterix · aggdraw · pyquaternion