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
- Install the package using pip:
pip install pinnacle-python
- 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.
- 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.
- Install the Pinnacle CLI:
pip install pinnacle-cli
- Deploy the endpoint using the CLI:
pinnacle dev
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pinnacle_python-0.0.2a0.tar.gz
.
File metadata
- Download URL: pinnacle_python-0.0.2a0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92f383f74d1389a44c292f6c4b54bd8411c577ba647d858221b4c6338c92902f |
|
MD5 | d101c2804cd609afb82ff068dddc41ac |
|
BLAKE2b-256 | 43f39dfb63af29e3e0c03896095d7554d2bd9a0e5c24fc76cbfe487660948d47 |
File details
Details for the file pinnacle_python-0.0.2a0-py3-none-any.whl
.
File metadata
- Download URL: pinnacle_python-0.0.2a0-py3-none-any.whl
- Upload date:
- Size: 3.7 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdbe3130276dc713c20bd5ae9dcaccd506b34aa4e6cb48f6b3d5d561479b1d77 |
|
MD5 | 0006cda4239c9c69c135b8368ce6593b |
|
BLAKE2b-256 | eca926fb4a5f527be0622491783571aed22fa0c3c53355ba993c8811bd1a4185 |