Many complex systems can be readily modeled as networks and represented as graphs. Such systems include social interactions, transport infrastructures, biological pathways, brains, ecosystems, and many more. A major advantage of representing complex systems as graphs is that the same graph tools and methods can be applied in a wide variety of domains. However, the graph representation has its limitations: many systems contain nodes with multidimensional features, interactions of various types, different levels of hierarchy, or multiple modalities, which deserve to be modeled but cannot be described by simple graphs. Multilayer networks (Kivelä et al., 2014) generalize graphs to capture the rich network data often associated with complex systems, allowing us to study a broad range of phenomena using the same representations, tools, and methods. With pymnet, we introduce a Python package that provides the essential data structures and computational tools for multilayer-network analysis. As highlights, the library offers efficient and scalable implementations for sparse multilayer networks and multiplex networks, integration with bliss to analyze multilayernetwork isomorphisms and automorphisms, and versatile methods for multilayer-network visualization.