Skip to content

Commit

Permalink
Rename PikaApi to PikaSdk and release 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dineshs91 committed Jan 12, 2024
1 parent 5ec709c commit 345537b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ pip install pika-sdk

## Generate image

Initialise `PikaApi`.
Initialise `PikaSdk`.

```python
pa = pika_sdk.PikaApi('sk-he2jdus1cbz1dpt4mktgjyvx')
ps = pika_sdk.PikaSdk('sk-he2jdus1cbz1dpt4mktgjyvx')
```

If you don't have your API key, get one from [Pika.style](https://pika.style).

Check the documentation on [How to get your API key](https://docs.pika.style/docs/basics/getting-api-key).

```python
response = pa.generate_image_from_template('open-graph-image-1', {'title': 'From python sdk new'}, 'base64')
response = ps.generate_image_from_template('open-graph-image-1', {'title': 'From python sdk new'}, 'base64')
print(response['data']['base64'])
```

Expand All @@ -30,8 +30,8 @@ print(response['data']['base64'])
```python
import pika_sdk

pa = pika_sdk.PikaApi('sk-he2jdus1cbz1dpt4mktgjyvx')
response = pa.generate_image_from_template('open-graph-image-1', {'title': 'From python sdk new'}, 'base64')
ps = pika_sdk.PikaSdk('sk-he2jdus1cbz1dpt4mktgjyvx')
response = ps.generate_image_from_template('open-graph-image-1', {'title': 'From python sdk new'}, 'base64')
print(response)

print("Image base64:", response['data']['base64'])
Expand All @@ -51,8 +51,8 @@ from io import BytesIO
import pika_sdk
from PIL import Image

pa = pika_sdk.PikaApi('sk-he2jdus1cbz1dpt4mktgjyvx')
response = pa.generate_image_from_template('open-graph-image-1', {'title': 'From python sdk new'}, 'binary')
ps = pika_sdk.PikaSdk('sk-he2jdus1cbz1dpt4mktgjyvx')
response = ps.generate_image_from_template('open-graph-image-1', {'title': 'From python sdk new'}, 'binary')

with Image.open(BytesIO(response.content)) as im:
im.save('og.png')
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pika-sdk"
version = "0.1.0"
version = "0.2.0"
description = "Pika API python SDK."
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion src/pika_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from pika_sdk.sdk import PikaApi
from pika_sdk.sdk import PikaSdk
2 changes: 1 addition & 1 deletion src/pika_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pika_sdk.exceptions import APIException, BadRequestException


class PikaApi:
class PikaSdk:
def __init__(self, api_key):
self.api_key = api_key

Expand Down

0 comments on commit 345537b

Please sign in to comment.