In this article, we describe the Differential Equations and Optimization Environment DOpElib. DOpElib is a software library that provides a unified interface to high level algorithms such as time-stepping methods, nonlinear solvers and optimization routines. This structure ensures that, first of all, the user is only required to write those sections of code that are specific to the considered problem. Second, the exchange of parts of the used routines is possible with only a few lines of code to change instead of large reimplementations. The article illustrates the design principles and various features of DOpElib and provides some numerical results as demonstration for the versatility of the software.