astro96 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +18 -0
- data/lib/astro96.rb +1377 -0
- metadata +45 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: d2770556d96012fef8de3688e210c67f82b8cba2be5dc133c54ccf19db3a9b99
|
|
4
|
+
data.tar.gz: bfef968b9d89514aed61ac8206230fc42bbbff6c7f3631f82b1b90ce94121a37
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 131c87dde5d2618ac265615843b1619cb64bfef8518ba13ba2b267e6258cd60ae4eda78bff79896b44d5dc6ed3f40874ecc2b548d58a9876c9c1a3393448a505
|
|
7
|
+
data.tar.gz: 86087da1cb8ad59c8e768eb97a508ab14ee17edefba4d86be39810f38e2fba5108b4f156b2ec00e3f22e3fc879be1e8a315e5131622e5e2dc219cb4783fd8745
|
data/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# 96Astro API client for Ruby
|
|
2
|
+
|
|
3
|
+
Compiled and run in our tests on the oldest version named below: `tools/sdk/thin_conformance/run.py` checks its requests, retries and errors, and makes one real call to the API. Here each method takes a Hash or a JSON string, and returns the parsed response.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Copy `lib/astro96.rb` into your project, or build the gem from `astro96.gemspec`. It needs Ruby 3 and has no dependencies.
|
|
8
|
+
|
|
9
|
+
## Use
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
astro = Astro96::Client.new(api_key: ENV.fetch("ASTRO_API_KEY"))
|
|
13
|
+
answer = astro.planet_positions({ datetime: "1990-10-18T14:30:00", timezone: "Asia/Kolkata", latitude: 28.6139, longitude: 77.209 })
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
There is one method for each capability in the [API reference](https://96astroapi.com/docs/reference). Each takes the request as a JSON string and returns the response as a JSON string, so you can parse it with whatever your app already uses.
|
|
17
|
+
|
|
18
|
+
Keep your secret key on your server, and never ship it in an app. The API's error `code` is on the error this client raises. Calls that fail with a retryable error are retried with the same idempotency key, so they are never charged twice.
|