  Modern instrumentation in radioastronomy constitutes a valuable tool for
studying the Universe: ALMA has reached unprecedented sensitivities and spatial
resolution, while Herschel/HIFI has opened a new window for probing molecular
warm gas (~50-1000 K). On the other hand, the software SHAPE has emerged in the
past few years as a standard tool for determining the morphology and velocity
field of different kinds of gaseous emission nebulae via spatio-kinematical
modelling. SHAPE implements radiative transfer solving, but it is only
available for atomic species and not for molecules. Being aware of the growing
importance of the development of tools for simplifying the analyses of
molecular data, we introduce shapemol, a complement to SHAPE, with which we
intend to fill the so-far under-developed molecular niche. shapemol enables
user-friendly, spatio-kinematic modelling with accurate non-LTE calculations of
excitation and radiative transfer in CO lines. It allows radiative transfer
solving in the 12CO and 13CO J=1-0 to J=17-16 lines, but its implementation
permits easily extending the code to different molecular species. shapemol
allows easily generating synthetic maps and line profiles to match against
interferometric or single-dish observations. We fully describe shapemol and
discuss its limitations and the sources of uncertainty to be expected in the
final synthetic profiles or maps. As an example of the power and versatility of
shapemol, we build a model of the molecular envelope of the planetary nebula
NGC 6302 and compare it with 12CO and 13CO J=2-1 interferometric maps from SMA
and high-J transitions from Herschel/HIFI. We find the molecular envelope to
have a complex, broken ring-like structure with an inner, hotter region and
several 'fingers' and high-velocity blobs, emerging outwards from the plane of
the ring. We derive a mass of 0.11 Msun for the molecular envelope.
