No project description provided
Project description
UCRS - Unified CRS
Working with geospatial data in Python often means juggling multiple libraries, each with its own CRS representation:
- pyproj uses
pyproj.CRS - cartopy uses
cartopy.crs.CRSandcartopy.crs.Projection - GDAL/osgeo uses
osgeo.osr.SpatialReference
Converting between these formats is well documented, but a bit tedious.
UCRS solves this by providing a single wrapper class that accepts any CRS input and lazily converts to an instance of any library you need.
Usage
from ucrs import UCRS
# Create UCRS from any CRS representation
ucrs = UCRS(4326) # EPSG code
ucrs = UCRS("EPSG:4326") # EPSG string
ucrs = UCRS(pyproj.CRS.from_epsg(4326)) # pyproj.CRS
ucrs = UCRS(cartopy.crs.PlateCarree()) # cartopy CRS
ucrs = UCRS(srs) # osgeo.osr.SpatialReference
# Access different representations
ucrs.proj # Always available
ucrs.cartopy # Requires cartopy
ucrs.osgeo # Requires GDAL
How It Works
UCRS uses pyproj.CRS as its internal canonical representation. All conversions follow this pattern:
- Input →
pyproj.CRS(during initialization) pyproj.CRS→ Output format (via cached properties)
Conversions are lazy and cached, so accessing .proj, .cartopy, or .osgeo multiple times returns the same object without re-conversion.
Requirements
- Python 3.10+
- pyproj (required)
- cartopy (optional)
- GDAL (optional)
Installation
# Minimal installation (pyproj only)
pip install ucrs
# With cartopy support
pip install ucrs[cartopy]
# With GDAL support
pip install ucrs[gdal]
# With all optional dependencies
pip install ucrs[full]
License
MIT License - see LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ucrs-0.1.0.tar.gz.
File metadata
- Download URL: ucrs-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.7 Linux/6.17.2-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e88b28516e9b3883b7ce7813dac0c65362a33ead78f0c2277ed38a1042c7f11
|
|
| MD5 |
ea91fc576b24df94094089f734b82e8e
|
|
| BLAKE2b-256 |
6b61e112fef13b3a5dab7dd5203c0de079fbe36c07000dd2bf3334e376097c4f
|
File details
Details for the file ucrs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ucrs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.7 Linux/6.17.2-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb2fe1fdc3f375093ed719ba329e72c7318b7c0bd201de631f88722efc4ec84a
|
|
| MD5 |
ddb2b54090d279f0b7eebf199959b51e
|
|
| BLAKE2b-256 |
696eef25211439eccc3f31a82f539bdcc75c00c1800f7a00cae0aca3eb47579c
|