https://github.com/buried-in-code/kalibak
A Java/Kotlin wrapper for the Metron API.
https://github.com/buried-in-code/kalibak
kotlin-jvm metron-api
Last synced: 5 months ago
JSON representation
A Java/Kotlin wrapper for the Metron API.
- Host: GitHub
- URL: https://github.com/buried-in-code/kalibak
- Owner: Buried-In-Code
- License: mit
- Created: 2024-09-13T11:11:57.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-10-21T20:06:26.000Z (8 months ago)
- Last Synced: 2024-10-22T14:10:34.800Z (8 months ago)
- Topics: kotlin-jvm, metron-api
- Language: Kotlin
- Homepage:
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kalibak


[](https://github.com/gradle/gradle)
[](https://github.com/pinterest/ktlint)[](https://github.com/Buried-In-Code/Kalibak/tags)
[](https://opensource.org/licenses/MIT)
[](https://github.com/Buried-In-Code/Kalibak/graphs/contributors)[](https://github.com/Buried-In-Code/Kalibak/actions/workflows/testing.yaml)
A Java/Kotlin wrapper for the [Metron](https://metron.cloud) API.
## Getting started
To get started with Kalibak, add the [JitPack](https://jitpack.io) repository to your `build.gradle.kts`.
```kts
repositories {
maven("https://jitpack.io")
}
```Then, add Kalibak as a dependency.
```kts
dependencies {
implementation("com.github.Buried-In-Code:Kalibak:0.2.3")
}
```### Usage
```kt
import github.buriedincode.kalibak.Metron
import github.buriedincode.kalibak.SQLiteCache
import github.buriedincode.kalibak.AuthenticationException
import github.buriedincode.kalibak.ServiceExceptionfun main() {
try {
val session = Metron("Username", "Password", cache=SQLiteCache())// Get all Marvel comics for the week of 2021-06-07
val thisWeek = session.listIssues(params = mapOf(
"store_date_range_after" to "2021-06-07",
"store_date_range_before" to "2021-06-13",
"publisher_name" to "marvel"
))
// Print the results
thisWeek.forEach {
println("${it.id} ${it.name}")
}// Retrieve the detail for an individual issue
val asm68 = session.getIssue(id = 31660)
// Print the issue Description
println(asm68.description)} catch (ae: AuthenticationException) {
println("Invalid Metron Username/Password.")
} catch (se: ServiceException) {
println("Unsuccessful request: ${se.message}")
}
}
```For a complete list of available query parameters, refer to [Metron's API docs](https://metron.cloud/docs/).
## Socials
[](https://fosstodon.org/@BuriedInCode)\
[](https://matrix.to/#/#The-Dev-Environment:matrix.org)