`astropy.wcs` has properties like `wcs.ra` which give the axis number of the ra axis, for example.  This proposed here is better, but easy enough to build on top of the other.