sqlmap is a penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a detection engine, many niche features, and a broad range of switches including database fingerprinting, data fetching from the database, and accessing the underlying file system and executing commands on the operating system via out-of-band connections.
PyMetasploit is a full-fledged msfrpc client library for the Metasploit server (msfrpcd). The library features an easy-to-use object-oriented approach to accessing all the features available within the Metasploit framework. With only a few simple lines of code, developers can select exploit/payload/auxiliary modules, configure them, and execute them.