Let's Encrypt has a public API for managing certificates. One use case where this is handy is for creating/modifying certificates for each customer-controlled domain/subdomain of your multi-tenant web service.
Let's Encrypt certificates expire after 30 days. The reason for that is to mitigate problems with old certs and to encourage automation so there's less danger of a server being left unsecured because an admin forgotten to update something. This sort of library is aimed at [sys|web|dev]ops rather than developers per se.
Ultimately services like LE will get to the point where certificates will expire in hours rather than days, so a problem like Heartbleed will 'self-heal' because certificates can be fixed and servers will automatically get the patch within a day.