-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from drish/rename
renamed to resend
- Loading branch information
Showing
10 changed files
with
56 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
# Klotty Python SDK | ||
# Resend Python SDK | ||
|
||
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | ||
![Build](https://github.com/drish/klotty-py/actions/workflows/test.yaml/badge.svg) | ||
[![codecov](https://codecov.io/gh/drish/klotty-py/branch/main/graph/badge.svg?token=GGD39PPFM0)](https://codecov.io/gh/drish/klotty-py) | ||
![Build](https://github.com/drish/resend-py/actions/workflows/test.yaml/badge.svg) | ||
[![codecov](https://codecov.io/gh/drish/resend-py/branch/main/graph/badge.svg?token=GGD39PPFM0)](https://codecov.io/gh/drish/resend-py) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) | ||
[![PyPI](https://img.shields.io/pypi/v/klotty)](https://pypi.org/project/klotty/) | ||
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/klotty)](https://pypi.org/project/klotty) | ||
[![PyPI](https://img.shields.io/pypi/v/resend)](https://pypi.org/project/resend/) | ||
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/resend)](https://pypi.org/project/resend) | ||
--- | ||
|
||
## Installation | ||
|
||
To install Klotty Python SDK, simply execute the following command in a terminal: | ||
To install Resend Python SDK, simply execute the following command in a terminal: | ||
|
||
``` | ||
pip install klotty | ||
pip install resend | ||
``` | ||
|
||
## Setup | ||
|
||
First, you need to get an API key, which is available in the [Klotty Dashboard](https://klotty.com). | ||
First, you need to get an API key, which is available in the [Resend Dashboard](https://resend.com). | ||
|
||
```py | ||
from klotty import Klotty | ||
from resend import Resend | ||
|
||
client = Klotty(api_key="kl_123") | ||
client = Resend(api_key="kl_123") | ||
``` | ||
|
||
## Example | ||
|
||
```py | ||
from klotty import Klotty | ||
from resend import Resend | ||
|
||
client = Klotty(api_key=os.environ["KLOTTY_API_KEY"]) | ||
client = Resend(api_key=os.environ["RESEND_API_KEY"]) | ||
|
||
client.send_email( | ||
to="[email protected]", | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .api import Resend | ||
from .version import get_version | ||
|
||
__all__ = ["get_version", "Resend"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,20 +2,20 @@ | |
|
||
from setuptools import setup | ||
|
||
from klotty.version import get_version | ||
from resend.version import get_version | ||
|
||
install_requires = open("requirements.txt").readlines() | ||
|
||
setup( | ||
name="klotty", | ||
name="resend", | ||
version=get_version(), | ||
description="Klotty Python SDK", | ||
description="Resend Python SDK", | ||
long_description=open("README.md", encoding="utf8").read(), | ||
long_description_content_type="text/markdown", | ||
author="Derich Pacheco", | ||
author_email="[email protected]", | ||
url="https://github.com/drish/klotty-py", | ||
packages=["klotty"], | ||
url="https://github.com/drish/resend-py", | ||
packages=["resend"], | ||
include_package_data=True, | ||
install_requires=install_requires, | ||
zip_safe=False, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,18 @@ | |
|
||
import pytest | ||
|
||
from klotty import Klotty | ||
from klotty.exceptions import MissingRequiredFieldsError | ||
from resend import Resend | ||
from resend.exceptions import MissingRequiredFieldsError | ||
|
||
|
||
class TestKlotty(unittest.TestCase): | ||
class TestResend(unittest.TestCase): | ||
def test_invalid_api_key(self): | ||
with pytest.raises(ValueError): | ||
Klotty(api_key="") | ||
Resend(api_key="") | ||
|
||
def test_invalid_send_email_args(self): | ||
with pytest.raises(ValueError): | ||
client = Klotty(api_key="kl_123") | ||
client = Resend(api_key="kl_123") | ||
client.send_email( | ||
sender="", | ||
to="[email protected]", | ||
|
@@ -23,7 +23,7 @@ def test_invalid_send_email_args(self): | |
) | ||
|
||
with pytest.raises(ValueError): | ||
client = Klotty(api_key="kl_123") | ||
client = Resend(api_key="kl_123") | ||
client.send_email( | ||
sender="[email protected]", | ||
to="", | ||
|
@@ -32,7 +32,7 @@ def test_invalid_send_email_args(self): | |
) | ||
|
||
with pytest.raises(ValueError): | ||
client = Klotty(api_key="kl_123") | ||
client = Resend(api_key="kl_123") | ||
client.send_email( | ||
sender="[email protected]", | ||
to="[email protected]", | ||
|
@@ -41,7 +41,7 @@ def test_invalid_send_email_args(self): | |
) | ||
|
||
def test_request_missing_fields(self): | ||
patcher = patch("klotty.Klotty._make_request") | ||
patcher = patch("resend.Resend._make_request") | ||
mock = patcher.start() | ||
mock.status_code = 422 | ||
m = MagicMock() | ||
|
@@ -60,7 +60,7 @@ def mock_json(): | |
mock.return_value = m | ||
|
||
with pytest.raises(MissingRequiredFieldsError) as e: | ||
client = Klotty(api_key="kl_123") | ||
client = Resend(api_key="kl_123") | ||
client.send_email( | ||
to="[email protected]", | ||
sender="[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters