Skip to main content

turn-python

Documentation Links

Usage

  1. Get an API token from Turn (currently only tokens are supported, not username / passwords)

  2. Add this as an environment variable, or pass in to the turn client

    $ export TURN_AUTH_TOKEN={your token}
    
  3. Usage

    from turn import TurnClient
    
    turn_client = TurnClient(token={optionally add your token here})
    
    # Get a user's whatsapp id
    wa_id = turn_client.contacts.get_whatsapp_id('123456')
    
    # Send a message
    turn_client.messages.send_text(wa_id, 'Hello')
    
    # Send a media file
    with open("example.jpg", "rb") as file:
        turn_client.messages.send_media(
            whatsapp_id=wa_id,
            file=file,
            content_type="image/jpeg",
            media_type="image",
            caption="Here’s an image"
        )
    

Release files for turn-python 1.0.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 turn-python 1.0.0
File Size Uploaded
turn_python-1.0.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for turn-python 1.0.0
File Interpreter ABI Platform
turn_python-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / turn_python-1.0.0.tar.gz

Download URL turn_python-1.0.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4c925ec295b7ef1f48340747ee8f4eaebb5da7b6e9268a034491641f5eec3f7b
BLAKE2b-256 checksum
How to use checksums
4eb3e0d3b3f5d692f7faaa3bde4467e2adb5a0eb9a9d6af9d5efeea8991039be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / turn_python-1.0.0-py3-none-any.whl

Download URL turn_python-1.0.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9556523b6711deb8d8aa0bc5964a935056b5b2659cd1a0a0fc90f13b94607a25
BLAKE2b-256 checksum
How to use checksums
bde20aaa50ccf60b7d30738b473309665bfac611089c6f58873e499179a0aec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

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