How to install Conda on Linux/OSX for python

Mastering Python Package Management and Email Testing with Conda and MailSlurp: A Step-by-Step Guide for Developers

  • Table of contents

Conda is a package management tool that can install code to your machine for development with python.

Official documentation

Using pip with conda

To add interoperability with pip you can enable conda config for this:

conda config --set pip_interop_enabled True

Email libraries in python

MailSlurp is an email library for sending and receiving emails in Python. Create disposable fake email accounts for testing and development.

Installing

You can install the email client with pip in conjunction with conda.

pip install mailslurp-client

Usage

To configure a client and create an email address use the follow example:

import mailslurp_client

configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = "your-api-key-here"

def create_inbox_example():
    with mailslurp_client.ApiClient(configuration) as api_client:

        # create an inbox using the inbox controller
        api_instance = mailslurp_client.InboxControllerApi(api_client)
        inbox = api_instance.create_inbox()

        # check the id and email_address of the inbox
        assert len(inbox.id) > 0
        assert "mailslurp.com" in inbox.email_address
Email and SMS Platform
Create a free account in 3 clicks