Metadata-Version: 2.4
Name: northstart-sdk
Version: 0.2.1
Summary: Python client and payment helpers for the Northstar API
Project-URL: Homepage, https://pypi.org/project/northstart-sdk/
Author: Pan
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9
Requires-Dist: cryptography>=42.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# northstart-sdk

Python client and payment helpers for the Northstar API.

## Install

```bash
python -m pip install northstart-sdk
```

## API client

```python
from northstart_sdk import NorthstarClient

client = NorthstarClient(
    base_url="https://api.example.com",
    sdk_secret="your-sdk-secret",
)

for asset in client.list_assets(status="active"):
    print(asset.id, asset.name)
```

`sdk_secret` may also be provided through the `NORTHSTAR_SDK_SECRET`
environment variable. When no secret is configured, requests are sent without
the Northstar signature headers.

## Payment request

```python
from northstart_sdk import PaymentClient

payments = PaymentClient(
    appid="your-app-id",
    app_private_key_string=open("app_private_key.pem").read(),
    gateway_public_key_string=open("gateway_public_key.pem").read(),
    gateway_url="https://gateway.example.com/gateway.do",
)

request = payments.create_payment_order(
    out_trade_no="order-1001",
    total_amount="19.99",
    subject="Example order",
)
print(request.url)
```

RSA2 uses RSA PKCS#1 v1.5 signatures with SHA-256. PEM keys and unwrapped
base64 key bodies are both accepted.
