pika_sdk 0.1.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -16
- data/lib/pika_sdk/client.rb +1 -1
- data/lib/pika_sdk/version.rb +2 -2
- data/lib/pika_sdk.rb +1 -1
- data/pika_sdk.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 761d54b607516e99b86b18976893c99aa08c0443a24406202f7fe1e24f17bf6e
|
4
|
+
data.tar.gz: 8b3ca1c82b99e4d6519cdadc267c2dad3ed515124f91a249d9daf4c21cd43889
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bff87e3d33fdcdbca018763d374b8504d182c7686391692e8c991e684df408d14e4d3348951c25c8e33fe73dffdb2588a67d9837c588222a2c7a3c599345b20
|
7
|
+
data.tar.gz: b95bbd4eaa4e58ed74d27fc40bf35a3f4dadb550f22ac2f1f36162a2755d05529e9f9439d79c34bf75f9e5d8a09f4bd925670f23da8da26da8513411690e2621
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# Pika API Ruby Gem
|
2
|
+
|
3
|
+
View on Rubygems: [rubygems.org/gems/pika_sdk](https://rubygems.org/gems/pika_sdk)
|
2
4
|
|
3
5
|
## Installation
|
4
6
|
|
@@ -18,33 +20,31 @@ Or install it yourself as:
|
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
21
|
-
|
23
|
+
If you don't have your API key, get one from [pika.style](https://pika.style/pricing). Check the documentation on [how to get your API key](https://docs.pika.style/docs/basics/getting-api-key)
|
22
24
|
|
23
|
-
Initialise a client
|
25
|
+
### Initialise a client
|
24
26
|
|
25
27
|
```ruby
|
26
28
|
require 'pika_sdk'
|
27
29
|
|
28
|
-
client =
|
30
|
+
client = PikaSdk::Client.new('sk-he2jdus1cbz1dpt4mktgjyvx')
|
29
31
|
```
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
Check the documentation on [How to get your API key](https://docs.pika.style/docs/basics/getting-api-key).
|
33
|
+
### Generate image
|
34
34
|
|
35
35
|
```ruby
|
36
36
|
response = client.generate_image_from_template('open-graph-image-1', {'title': 'From python sdk new'}, 'base64')
|
37
37
|
puts response['data']['base64']
|
38
38
|
```
|
39
39
|
|
40
|
-
|
40
|
+
## Example
|
41
41
|
|
42
|
-
`Base64` response format
|
42
|
+
### `Base64` response format
|
43
43
|
|
44
44
|
```ruby
|
45
45
|
require 'pika_sdk'
|
46
46
|
|
47
|
-
client =
|
47
|
+
client = PikaSdk::Client.new('sk-he2jdus1cbz1dpt4mktgjyvx')
|
48
48
|
|
49
49
|
response = client.generate_image_from_template('open-graph-image-1', {'title': 'From ruby sdk'}, 'base64')
|
50
50
|
puts response['data']['base64']
|
@@ -56,12 +56,12 @@ Base64 output
|
|
56
56
|
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABLAAAAJ2CAYAAABPQHtcAAAAAXNSR0IArs4c6QAAIABJREFUeJzs3XmYJXdZL/Bvna37dM90FghLCBAQkC1BCBAMShLFBJAgKnofroBeFUUF5LrhiihXcV8BQRYVUUAlIewIGPbFmLCFLWwCYZEtzPR+trp/TM/......
|
57
57
|
```
|
58
58
|
|
59
|
-
`Binary` response format
|
59
|
+
### `Binary` response format
|
60
60
|
|
61
61
|
```ruby
|
62
62
|
require 'pika_sdk'
|
63
63
|
|
64
|
-
client =
|
64
|
+
client = PikaSdk::Client.new('sk-he2jdus1cbz1dpt4mktgjyvx')
|
65
65
|
|
66
66
|
File.open("og.png", "w") do |file|
|
67
67
|
response = client.generate_image_from_template('open-graph-image-1', {'title': 'From ruby sdk'}, 'binary')
|
@@ -70,7 +70,7 @@ File.open("og.png", "w") do |file|
|
|
70
70
|
end
|
71
71
|
```
|
72
72
|
|
73
|
-
This example writes the binary image to the file `og.png
|
73
|
+
This example writes the binary image to the file `og.png`
|
74
74
|
|
75
75
|
## generate_image_from_template
|
76
76
|
|
@@ -82,7 +82,7 @@ Use this function to generate an image. It takes in 3 arguments
|
|
82
82
|
|`modifications` | Yes | Modifications for the selected template. |
|
83
83
|
|`response_format` | No | `base64` or `binary` (Defaults to `base64`). |
|
84
84
|
|
85
|
-
For available templates and
|
85
|
+
For available templates and their modifications refer [image generation api templates](https://pika.style/image-generation-api/templates)
|
86
86
|
|
87
87
|
## Development
|
88
88
|
|
@@ -92,7 +92,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
92
92
|
|
93
93
|
## Contributing
|
94
94
|
|
95
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
95
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/rishimohan/pika-api-ruby-gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
96
96
|
|
97
97
|
## License
|
98
98
|
|
@@ -100,4 +100,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
100
100
|
|
101
101
|
## Code of Conduct
|
102
102
|
|
103
|
-
Everyone interacting in the PikaApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
103
|
+
Everyone interacting in the PikaApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rishimohan/pika-api-ruby-gem/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/pika_sdk/client.rb
CHANGED
data/lib/pika_sdk/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "0.
|
1
|
+
module PikaSdk
|
2
|
+
VERSION = "0.2.2"
|
3
3
|
end
|
data/lib/pika_sdk.rb
CHANGED
data/pika_sdk.gemspec
CHANGED
@@ -5,13 +5,13 @@ require "pika_sdk/version"
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "pika_sdk"
|
8
|
-
spec.version =
|
8
|
+
spec.version = PikaSdk::VERSION
|
9
9
|
spec.authors = ["rishimohan"]
|
10
10
|
spec.email = ["iamrishi.ms@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = "Pika API sdk for ruby"
|
13
13
|
spec.description = "Pika API sdk for ruby"
|
14
|
-
spec.homepage = "https://
|
14
|
+
spec.homepage = "https://pika.style/image-generation-api"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pika_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rishimohan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,12 +72,12 @@ files:
|
|
72
72
|
- lib/pika_sdk/client.rb
|
73
73
|
- lib/pika_sdk/version.rb
|
74
74
|
- pika_sdk.gemspec
|
75
|
-
homepage: https://
|
75
|
+
homepage: https://pika.style/image-generation-api
|
76
76
|
licenses:
|
77
77
|
- MIT
|
78
78
|
metadata:
|
79
79
|
allowed_push_host: https://rubygems.org/
|
80
|
-
homepage_uri: https://
|
80
|
+
homepage_uri: https://pika.style/image-generation-api
|
81
81
|
source_code_uri: https://github.com/rishimohan/pika-api-ruby-gem
|
82
82
|
changelog_uri: https://github.com/rishimohan/pika-api-ruby-gem
|
83
83
|
post_install_message:
|