Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Pinnacle Python Library

fern shield pypi

The Pinnacle Python library provides convenient access to the Pinnacle APIs from Python.

Table of Contents

Installation

pip install rcs

Reference

A full reference for this library is available here.

Usage

Instantiate and use the client with the following:

from rcs import Pinnacle
from rcs.brands import AutofillBrandOptions

client = Pinnacle(
    api_key="YOUR_API_KEY",
)
client.brands.autofill(
    additional_info="A developer-friendly, compliant API for SMS, MMS, and RCS, built to scale real conversations.",
    name="Pinnacle",
    options=AutofillBrandOptions(
        force_reload=True,
    ),
    website="https://www.pinnacle.sh",
)

Async Client

The SDK also exports an async client so that you can make non-blocking calls to our API.

import asyncio

from rcs import AsyncPinnacle
from rcs.brands import AutofillBrandOptions

client = AsyncPinnacle(
    api_key="YOUR_API_KEY",
)


async def main() -> None:
    await client.brands.autofill(
        additional_info="A developer-friendly, compliant API for SMS, MMS, and RCS, built to scale real conversations.",
        name="Pinnacle",
        options=AutofillBrandOptions(
            force_reload=True,
        ),
        website="https://www.pinnacle.sh",
    )


asyncio.run(main())

Exception Handling

When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error will be thrown.

from rcs.core.api_error import ApiError

try:
    client.brands.autofill(...)
except ApiError as e:
    print(e.status_code)
    print(e.body)

Advanced

Access Raw Response Data

The SDK provides access to raw response data, including headers, through the .with_raw_response property. The .with_raw_response property returns a "raw" client that can be used to access the .headers and .data attributes.

from rcs import Pinnacle

client = Pinnacle(
    ...,
)
response = client.brands.with_raw_response.autofill(...)
print(response.headers)  # access the response headers
print(response.data)  # access the underlying object

Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2).

A request is deemed retryable when any of the following HTTP status codes is returned:

  • 408 (Timeout)
  • 429 (Too Many Requests)
  • 5XX (Internal Server Errors)

Use the max_retries request option to configure this behavior.

client.brands.autofill(..., request_options={
    "max_retries": 1
})

Timeouts

The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.

from rcs import Pinnacle

client = Pinnacle(
    ...,
    timeout=20.0,
)


# Override timeout for a specific method
client.brands.autofill(..., request_options={
    "timeout_in_seconds": 1
})

Custom Client

You can override the httpx client to customize it for your use-case. Some common use-cases include support for proxies and transports.

import httpx
from rcs import Pinnacle

client = Pinnacle(
    ...,
    httpx_client=httpx.Client(
        proxy="http://my.test.proxy.example.com",
        transport=httpx.HTTPTransport(local_address="0.0.0.0"),
    ),
)

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

Metadata

Release files for rcs 2.0.27rc1

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

Source distribution (sdist)

Source distribution for rcs 2.0.27rc1
File Size Uploaded
rcs-2.0.27rc1.tar.gz 236.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rcs 2.0.27rc1
File Interpreter ABI Platform
rcs-2.0.27rc1-py3-none-any.whl Python 3 none any Details

Total release size: 811.9 kB

Release files / rcs-2.0.27rc1.tar.gz

Download URL rcs-2.0.27rc1.tar.gz
Size 236.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a334e1e884cee06458243fabb77b6d009c6791f188e41c63395f1863572cd6b9
BLAKE2b-256 checksum
How to use checksums
8371052eb4b61c618054dda0f8498944fb64b103228538019382d9f480ceda38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.8.18 Linux/6.17.0-1022-azure

Release files / rcs-2.0.27rc1-py3-none-any.whl

Download URL rcs-2.0.27rc1-py3-none-any.whl
Size 575.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
536cf4a0b389b0eb57dcb4f72c33053cf21b675e993687a62e030de4c4ed1f26
BLAKE2b-256 checksum
How to use checksums
ee7f6bc3826b3ab7c787e1af823d6fa5a4c5d32f24c2d61bc5a49568cd5d4586
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.8.18 Linux/6.17.0-1022-azure

Release history Release notifications | RSS feed

2.0.28

2 release files

2.0.27

2 release files

This release

2.0.27rc1 This release

2 release files

2.0.26

2 release files

2.0.22

2 release files

2.0.21

2 release files

2.0.20

2 release files

2.0.19

2 release files

2.0.18

2 release files

2.0.17

2 release files

2.0.15

2 release files

2.0.14

2 release files

2.0.13

2 release files

2.0.10

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.20

2 release files

1.0.19

2 release files

1.0.18

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.5

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