Skip to main content

kopeechka

kopeechka - This module is a representation of the kopeechka.store API in Python

API documentation RUS https://link.kopeechka.store/CzXxp6?lang=ru&k=API

API documentation ENG https://link.kopeechka.store/CzXxp6?lang=en&k=API

Installation

Install the current version with pip:

pip install kopeechka

Usage

You can get a token in your personal account on the kopeechka.store website

from kopeechka import MailActivations

api = MailActivations(api_token="TOKEN")

Logger

In version 8.0 there's no longer. We've decide to delete it, because it was useless

Exception handling

You can import KopeechkaApiError to catch errors To catching timeout error import TimeOut

Example:

from kopeechka import KopeechkaApiError, MailActivations, TimeOut

api = MailActivations(api_token="WRONG_TOKEN")

try:
    api.user_balance()
except KopeechkaApiError as e:
    print(e) # -> BAD_TOKEN
except TimeOut as e:
    print(e) # -> If it timed out, it return "Timed out"

Types

You can import all types from kopeechka or kopeechka.kopeechka_types

Sync methods

You can import class to work with methods from kopeechka

from kopeechka import Methods

api = Methods(api_token="TOKEN")

Sync example

from kopeechka import MailActivations, KopeechkaApiError

api = MailActivations("TOKEN")


def main():
    try:
        ans_1 = api.user_balance()
        print(ans_1)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_2 = api.mailbox_get_email("vk.com")
        print(ans_2)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_3 = api.mailbox_get_message(ans_2.id, 1)
        print(ans_3)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_4 = api.mailbox_cancel(ans_2.id)
        print(ans_4)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_5 = api.mailbox_reorder("vk.com", ans_2.mail)
        print(ans_5)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_6 = api.mailbox_get_fresh_id("vk.com", ans_2.mail)
        print(ans_6)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_7 = api.mailbox_get_domains()
        print(ans_7)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_8 = api.mailbox_zones(1, 1)
        print(ans_8)
    except KopeechkaApiError as e:
        print(e)


if __name__ == '__main__':
    main()

Async methods

You can import class to work with async methods from kopeechka

from kopeechka import AsyncMethods

api = AsyncMethods(api_token="TOKEN")

Async example

from kopeechka import AsyncMailActivations, KopeechkaApiError
import asyncio

api = AsyncMailActivations("TOKEN")


async def main():
    try:
        ans_1 = await api.user_balance()
        print(ans_1)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_2 = await api.mailbox_get_email("vk.com")
        print(ans_2)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_3 = await api.mailbox_get_message(ans_2.id, 1)
        print(ans_3)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_4 = await api.mailbox_cancel(ans_2.id)
        print(ans_4)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_5 = await api.mailbox_reorder("vk.com", ans_2.mail)
        print(ans_5)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_6 = await api.mailbox_get_fresh_id("vk.com", ans_2.mail)
        print(ans_6)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_7 = await api.mailbox_get_domains()
        print(ans_7)
    except KopeechkaApiError as e:
        print(e)

    try:
        ans_8 = await api.mailbox_zones(1, 1)
        print(ans_8)
    except KopeechkaApiError as e:
        print(e)


if __name__ == '__main__':
    asyncio.run(main())

Metadata

Release files for kopeechka 8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kopeechka 8.0
File Size Uploaded Provenance
kopeechka-8.0.tar.gz 5.4 kB Without provenance Details

Release files / kopeechka-8.0.tar.gz

Download URL kopeechka-8.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
351ae203a9c30fcede734246c33b44cc13fe46647d5aec6d4be49eff4baecc60
BLAKE2b-256 checksum
How to use checksums
78d63741f5b68267132ce5fdbec077e7cc13ee97b52d2b62bdbeedd3a2e41530
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.7

Security for kopeechka 8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page