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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f659b6d06293ce587938c8bf9c68173d5a76c0f361c505e5b1b6958720fe18b3
4
- data.tar.gz: 2900dfb5af5863c96bca8c8d0d439f48f41d8974c2b6cadea3cc8209224da18f
3
+ metadata.gz: 761d54b607516e99b86b18976893c99aa08c0443a24406202f7fe1e24f17bf6e
4
+ data.tar.gz: 8b3ca1c82b99e4d6519cdadc267c2dad3ed515124f91a249d9daf4c21cd43889
5
5
  SHA512:
6
- metadata.gz: 56aa314045257aea4f5c5eefa0d21bb01208d464108868a39ad68dd785596d83a81a5718b6f99dfc4eff50a8e7f2cf8cff7069f150d45757c317f6dc8b0fad5c
7
- data.tar.gz: effe28274f13987d4a688e120867d63adbe304f9cfce7d3b0eab9e453e8ff13b70bdfe7a701cdb227642f8f8766054c6dfad6a114ec20e02b0f3c5a9ebe74b07
6
+ metadata.gz: 1bff87e3d33fdcdbca018763d374b8504d182c7686391692e8c991e684df408d14e4d3348951c25c8e33fe73dffdb2588a67d9837c588222a2c7a3c599345b20
7
+ data.tar.gz: b95bbd4eaa4e58ed74d27fc40bf35a3f4dadb550f22ac2f1f36162a2755d05529e9f9439d79c34bf75f9e5d8a09f4bd925670f23da8da26da8513411690e2621
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # PikaApi
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
- ### Generate image
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 = PikaApi::Client.new('sk-he2jdus1cbz1dpt4mktgjyvx')
30
+ client = PikaSdk::Client.new('sk-he2jdus1cbz1dpt4mktgjyvx')
29
31
  ```
30
32
 
31
- If you don't have your API key, get one from [Pika.style](https://pika.style).
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
- **Example:**
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 = PikaApi::Client.new('sk-he2jdus1cbz1dpt4mktgjyvx')
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 = PikaApi::Client.new('sk-he2jdus1cbz1dpt4mktgjyvx')
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 it's modifications refer [image generation api templates](https://pika.style/image-generation-api/templates).
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/[USERNAME]/pika_api. 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.
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/[USERNAME]/pika_api/blob/master/CODE_OF_CONDUCT.md).
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).
@@ -3,7 +3,7 @@ require "json"
3
3
  require "net/http"
4
4
  require "httparty"
5
5
 
6
- module PikaApi
6
+ module PikaSdk
7
7
  class Client
8
8
  def initialize(api_key)
9
9
  @api_key = api_key
@@ -1,3 +1,3 @@
1
- module PikaApi
2
- VERSION = "0.1.0"
1
+ module PikaSdk
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/pika_sdk.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'pika_sdk/version'
2
2
  require 'pika_sdk/client'
3
3
 
4
- module PikaApi
4
+ module PikaSdk
5
5
  class Error < StandardError; end
6
6
  end
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 = PikaApi::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://github.com/rishimohan/pika-api-ruby-gem"
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.1.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-01-11 00:00:00.000000000 Z
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://github.com/rishimohan/pika-api-ruby-gem
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://github.com/rishimohan/pika-api-ruby-gem
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: