{"id":28470,"library":"xproj","title":"xproj","description":"xproj is an extension for xarray that adds support for coordinate reference systems (CRS) and map projections. It provides CRS-aware indexes, accessors, and integration with pyproj. The current version is 0.2.1, with an active development cadence.","status":"active","version":"0.2.1","language":"python","source_language":"en","source_url":"https://github.com/xarray-contrib/xproj","tags":["xarray","projection","crs","gis","pyproj","geospatial"],"install":[{"cmd":"pip install xproj","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for xarray data structures","package":"xarray","optional":false},{"reason":"Used for CRS operations and projections","package":"pyproj","optional":false}],"imports":[{"note":"Direct import of xproj registers the accessor; importing submodules is fine but not required for basic use.","wrong":"from xproj import ...","symbol":"xproj","correct":"import xproj"}],"quickstart":{"code":"import xarray as xr\nimport xproj\n\nds = xr.tutorial.open_dataset('air_temperature')\n# assuming lat/lon coordinates with CF attributes\ncrs = ds.xproj.get_crs()\nprint(crs)","lang":"python","description":"Quick example: load a dataset and retrieve its CRS via the xproj accessor."},"warnings":[{"fix":"Replace `_proj_get_crs()` with a `crs` abstract property in your custom index class.","message":"Version 0.2.0 removed the abstract method `_proj_get_crs()` from the CRS-aware index base class. Third-party custom indexes must define a `crs` property instead.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Always run `import xproj` before using the `.xproj` accessor.","message":"The CRS accessor `ds.xproj` is only available if xproj is imported. Forgetting to import xproj will result in an AttributeError.","severity":"gotcha","affected_versions":"all"},{"fix":"Set CRS directly using `ds.xproj.set_crs(crs)` rather than relying on `allow_override`.","message":"The `map_crs` method's `allow_override` parameter may be deprecated in future versions. Use explicit CRS assignment instead.","severity":"deprecated","affected_versions":"<=0.2.1"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Add `import xproj` at the top of your script.","cause":"xproj module not imported before accessing the accessor.","error":"AttributeError: 'Dataset' object has no attribute 'xproj'"},{"fix":"Use `from pyproj import CRS` instead.","cause":"Incorrect import path; CRS class is from pyproj, not xproj.","error":"ImportError: cannot import name 'CRS' from 'xproj'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}