From 9c4db7820b819e8274f03ecbf725e5f59ab17587 Mon Sep 17 00:00:00 2001 From: lores Date: Thu, 29 May 2025 22:04:31 +0300 Subject: [PATCH] Update README --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ README.rst | 43 ------------------------------------------- pyproject.toml | 2 +- 3 files changed, 40 insertions(+), 44 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 0000000..60fb638 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# NotLetters API Client + +Asynchronous Python SDK for working with the [`https://api.notletters.com/v1`](https://api.notletters.com/v1) service API. Based on [stollen](https://github.com/py-stollen/stollen). + +## Installation + +```bash +pip install notletters +``` + +# MRE + +```python +from notletters import NotLetters, EmailType + +async with NotLetters(api_token="your_api_token") as api: + letters = await api.get_letters( + email="user@example.com", + password="secret", + search="example", + star=False, + ) + for letter in letters: + print(letter.subject, letter.date) + + purchase = await api.buy_emails(count=2, type_email=EmailType.UNLIMITED) + for email in purchase: + print(email.password) + + change_result = await api.change_password( + email="user@example.com", + old_password="old", + new_password="new" + ) + print(change_result) + + me = await api.get_me() + print(me.username, me.balance) +``` diff --git a/README.rst b/README.rst deleted file mode 100644 index 4df9b3e..0000000 --- a/README.rst +++ /dev/null @@ -1,43 +0,0 @@ -NotLetters API Client -===================== - -Asynchronous Python SDK for working with the `https://api.notletters.com/v1` service API. Based on `stollen `_. - -Installation ---------- - -.. code-block:: bash - - pip install notletters - - -MRE -------------- - -.. code-block:: python - - from notletters import NotLetters, EmailType - - async with NotLetters(api_token="your_api_token") as api: - letters = await api.get_letters( - email="user@example.com", - password="secret", - search="example", - star=False, - ) - for letter in letters: - print(letter.subject, letter.date) - - purchase = await api.buy_emails(count=2, type_email=EmailType.UNLIMITED) - for email in purchase: - print(email.password) - - change_result = await api.change_password( - email="user@example.com", - old_password="old", - new_password="new" - ) - print(change_result) - - me = await api.get_me() - print(me.username, me.balance) diff --git a/pyproject.toml b/pyproject.toml index 6b661d9..c37acdb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ keywords = [ ] license-files = ["LICENSE"] name = "notletters" -readme = "README.rst" +readme = "README.md" requires-python = ">=3.9" [project.urls]