Enchant your library
Enchanted library is an artifact creature on the battlefield with power and toughness each equal to the number of cards in it. It's still a library.
If enchanted library would leave the battlefield, exile Animate Library instead.