Kraken

Temurin: 21Temurin21 Kotlin: 2.2Kotlin2.2 Version: v0.4.0Versionv0.4.0

Gradle: 9.2Gradle9.2 Spotless: 8.0.0Spotless8.0.0

Status: BetaStatusBeta License: MITLicenseMIT

pipeline: failurepipelinefailure

A Java/Kotlin wrapper for the Metron API.

Installation

Add Kraken as a dependency.

repositories {
maven("https://codeberg.org/api/packages/BuriedInCode/maven")
}

dependencies {
implementation("codeberg.buriedincode:Kraken:0.5.0")
}

Example Usage

import codeberg.buriedincode.kraken.Metron
import codeberg.buriedincode.kraken.SQLiteCache
import codeberg.buriedincode.kraken.AuthenticationException
import codeberg.buriedincode.kraken.RateLimitException
import codeberg.buriedincode.kraken.ServiceException

fun main() {
try {
val session = Metron(username="Username", password="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(re: RatelimitException) {
println("Rate limit exceeded. Please try again later.")
} catch (se: ServiceException) {
println("Unsuccessful request: ${se.message}")
}
}

Documentation

Bugs/Requests

Please use the Issue Tracker to submit bugs or request features.

Socials

FOSSTODON: @BURIEDINCODEFOSSTODON@BURIEDINCODE
MATRIX: #THE-DEV-ENVIRONMENTMATRIX#THE-DEV-ENVIRONMENT

Packages

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard