© ESO, 2016. Context. We investigate two stripped-envelope supernovae (SNe) discovered in the nearby galaxy NGC 5806 by the (intermediate) Palomar Transient Factory [(i)PTF]. These SNe, designated PTF12os/SN 2012P and iPTF13bvn, exploded within ∼520 days of one another at a similar distance from the host-galaxy center. We classify PTF12os as a Type IIb SN based on our spectral sequence; iPTF13bvn has previously been classified as Type Ib having a likely progenitor with zero age main sequence (ZAMS) mass below ∼17 M⊙. Because of the shared and nearby host, we are presented with a unique opportunity to compare these two SNe. Aims. Our main objective is to constrain the explosion parameters of iPTF12os and iPTF13bvn, and to put constraints on the SN progenitors. We also aim to spatially map the metallicity in the host galaxy, and to investigate the presence of hydrogen in early-time spectra of both SNe. Methods. We present comprehensive datasets collected on PTF12os and iPTF13bvn, and introduce a new automatic reference-subtraction photometry pipeline (FPipe) currently in use by the iPTF. We perform a detailed study of the light curves (LCs) and spectral evolution of the SNe. The bolometric LCs are modeled using the hydrodynamical code hyde. We analyze early spectra of both SNe to investigate the presence of hydrogen; for iPTF13bvn we also investigate the regions of the Paschen lines in infrared spectra. We perform spectral line analysis of helium and iron lines to map the ejecta structure of both SNe. We use nebular models and late-time spectroscopy to constrain the ZAMS mass of the progenitors. We also perform image registration of ground-based images of PTF12os to archival HST images of NGC 5806 to identify a potential progenitor candidate. Results. We find that our nebular spectroscopy of iPTF13bvn remains consistent with a low-mass progenitor, likely having a ZAMS mass of ∼12M⊙. Our late-time spectroscopy of PTF12os is consistent with a ZAMS mass of ∼15M⊙. We successfully identify a source in pre-explosion HST images coincident with PTF12os. The colors and absolute magnitude of this object are consistent between pre-explosion and late-time HST images, implying it is a cluster of massive stars. Our hydrodynamical modeling suggests that the progenitor of PTF12os had a compact He core with a mass of 3.25+ 0.77-0.56M⊙ at the time of the explosion, which had a total kinetic energy of 0.54+ 0.41-0.25 × 1051 erg and synthesized 0.063+ 0.020-0.011M⊙ of strongly mixed 56Ni. Spectral comparisons to the Type IIb SN 2011dh indicate that the progenitor of PTF12os was surrounded by a thin hydrogen envelope with a mass lower than 0.02M⊙. We also find tentative evidence that the progenitor of iPTF13bvn could have been surrounded by a small amount of hydrogen prior to the explosion. This result is supported by possible weak signals of hydrogen in both optical and infrared spectra.