Skip to main content

No project description provided

Project description

Pinnacle Python Client

This is the official Python client for the Pinnacle Serverless Backend API.

Pre-requisites

  • Python 3.12 or higher

Usage

  1. Install the package using pip:
pip install pinnacle-python
  1. To define an endpoint, use the @endpoint decorator:
from pinnacle_python import endpoint

@endpoint
def hello_world():
    return "Hello, World!"

This will create a POST endpoint at /hello_world with no parameters.

  1. To define a scheduled script, use the @scheduled decorator:
from pinnacle_python import schedule, Period
@schedule(
    for_time=datetime.datetime.today() + timedelta(minutes=1), 
    repeats=Period(seconds=2)
)
def test_job():
    print("Hello, world!")

This will run the test_job function every 2 seconds starting 1 minute from the time the script is deployed. See the schedule documentation for more information on how to configure the schedule.

  1. Install the Pinnacle CLI:
pip install pinnacle-cli
  1. Deploy the endpoint using the CLI:
pinnacle dev
  1. You can now access the endpoint at http://localhost:8000/hello_world. Calling the endpoint
curl -X POST http://localhost:8000/hello_world \
     -H "Content-Type: application/json" \
     -d '{}'

will return a JSON in the following format:

{
    "data": "Hello, World!"
}

Environment Variables

See the Pinnacle CLI README for a list of environment variables that can be used to configure the Pinnacle CLI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pinnacle_python-0.0.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

pinnacle_python-0.0.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file pinnacle_python-0.0.2.tar.gz.

File metadata

  • Download URL: pinnacle_python-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.5.0

File hashes

Hashes for pinnacle_python-0.0.2.tar.gz
Algorithm Hash digest
SHA256 07a242131094597cb4a7fb413a1aefd4143dd75bb795dfe23c09e6d99197ce5f
MD5 19d240ac29add9e3669808418197b4a2
BLAKE2b-256 839995bc8a829de5680cc239b93536b4899a5cba7296118ae1a452a6373b6898

See more details on using hashes here.

File details

Details for the file pinnacle_python-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pinnacle_python-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.5.0

File hashes

Hashes for pinnacle_python-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 748a6a724ce0966fa593bc37ff6811175c2db8e6c03dbdb3ec655548996e4dd1
MD5 844f423c3e7ffc3b777475b4ec36db24
BLAKE2b-256 8d06407a95c87733e14d1f525f9fd38d0775175b2c0279fe05942d7397cf2780

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page