{"id":14956921,"url":"https://github.com/medeia/medeia","last_synced_at":"2026-04-07T22:01:19.921Z","repository":{"id":38326026,"uuid":"187773193","full_name":"medeia/medeia","owner":"medeia","description":"A BSON libary for scala using typeclasses","archived":false,"fork":false,"pushed_at":"2026-03-26T21:37:32.000Z","size":685,"stargazers_count":17,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-27T09:31:45.934Z","etag":null,"topics":["bson","cats","codec","decoding","encoding","mongodb","scala","typeclass","typeclass-derivation"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/medeia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-21T06:15:08.000Z","updated_at":"2026-03-26T21:37:36.000Z","dependencies_parsed_at":"2022-07-14T05:50:32.002Z","dependency_job_id":"cfa65c5a-429e-4292-8784-ff0c95616228","html_url":"https://github.com/medeia/medeia","commit_stats":{"total_commits":630,"total_committers":12,"mean_commits":52.5,"dds":0.6777777777777778,"last_synced_commit":"c670a896cc4a54c325e556982507b4a5eec714ad"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"purl":"pkg:github/medeia/medeia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medeia%2Fmedeia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medeia%2Fmedeia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medeia%2Fmedeia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medeia%2Fmedeia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/medeia","download_url":"https://codeload.github.com/medeia/medeia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medeia%2Fmedeia/sbom","scorecard":{"id":634034,"data":{"date":"2025-08-11","repo":{"name":"github.com/medeia/medeia","commit":"76b56150ee653c88ce814090ca1412888a16b0d3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.9,"checks":[{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/clean.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:106: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:122: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:127: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:132: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:145: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:156: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:166: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:209: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:214: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:219: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:232: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:243: update your workflow using https://app.stepsecurity.io/secureworkflow/medeia/medeia/ci.yml/main?enable=pin","Info:   0 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T08:37:39.265Z","repository_id":38326026,"created_at":"2025-08-21T08:37:39.265Z","updated_at":"2025-08-21T08:37:39.265Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31530647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bson","cats","codec","decoding","encoding","mongodb","scala","typeclass","typeclass-derivation"],"created_at":"2024-09-24T13:13:44.466Z","updated_at":"2026-04-07T22:01:19.891Z","avatar_url":"https://github.com/medeia.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# medeia\n[![Maven Central](https://img.shields.io/maven-central/v/de.megaera/medeia_2.13.svg?label=Maven%20Central)](https://central.sonatype.com/namespace/de.megaera)\n[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)\n\u003ca href=\"https://typelevel.org/cats/\"\u003e\u003cimg src=\"https://typelevel.org/cats/img/cats-badge.svg\" height=\"40px\" align=\"right\" alt=\"Cats friendly\" /\u003e\u003c/a\u003e\n\nmedeia is a BSON library for Scala.\n\n## Goal / Scope\n\nThe goal of medeia is to make bson decoding / encoding as easy and fun as JSON decoding / encoding is with circe or argonaut.\n\nmedeia includes decoders and encoders for common data structures as well as automatic derivation of decoders and encoders.\n\n## Quickstart\n\n### Add to sbt\n\n```sbt\n  libraryDependencies += \"de.megaera\" %% \"medeia\" % \"1.0.0\"\n```\n\nCurrently no complete documentation is present, additional examples(including Scala 3 derives syntax) can be found in the test suites.\nIf you have questions: don't hesitate to ask via github issues.\n\n### decoding and encoding example:\n\n```scala\n  import org.mongodb.scala.bson._\n\n  import medeia.syntax._\n\n  val stringList = List(\"a\", \"b\")\n  val encoded = stringList.toBson\n  // BsonArray{values=[BsonString{value='a'}, BsonString{value='b'}]}\n  val bsonArray = BsonArray(\"a\", \"b\")\n  val decoded = bsonArray.fromBson[List[String]]\n  // Right(List(a,b)\n```\n\n### automatic derivation examples for case classes, sealed traits and Scala 3 enums:\n\n#### Scala 3\n```scala\n  import org.mongodb.scala.bson.*\n\n  import medeia.codec.*\n  import medeia.syntax.*\n\n  case class Simple(int: Int, string: Option[String]) derives BsonDocumentCodec\n  val encoded = Simple(1, Some(\"a\")).toBson\n  // {\"string\": \"a\", \"int\": 1}\n\n  val doc = BsonDocument(\"int\" -\u003e 1, \"string\" -\u003e \"string\")\n  val decoded = doc.fromBson[Simple]\n  // Right(Simple(1,Some(string)))\n\n  enum Enum derives BsonDocumentCodec:\n    case Foo(answer: Int)\n    case Bar(bar: String)\n\n  val e = Enum.Foo(42)\n  val encodedEnum = e.toBson\n  // {\"answer\": 42, \"type\": \"Foo\"}\n```\n\nA transformation function for keynames can be provided as follows:\n\n```scala\n  import medeia.codec.*\n  import medeia.generic.GenericDerivationOptions\n  import medeia.syntax.*\n\n  case class Simple(fieldInScala: Int) derives BsonDocumentCodec\n  object Simple:\n    given GenericDerivationOptions[Simple] =\n      GenericDerivationOptions { case \"fieldInScala\" =\u003e \"fieldInBson\" }\n  val encoded = Simple(1).toBson\n  // {\"fieldInBson\": 1}\n```\n\nGenericDerivationOptions works for encoding and decoding.\nIf the provided partial function is not defined for a key no transformation is used.\n\n#### Scala 2\n```scala\n  import org.mongodb.scala.bson._\n\n  import medeia.encoder.BsonEncoder\n  import medeia.decoder.BsonDecoder\n  import medeia.codec._\n  import medeia.syntax._\n\n  case class Simple(int: Int, string: Option[String])\n  implicit val simpleEncoder: BsonEncoder[Simple] = BsonDocumentEncoder.derived\n  val encoded = Simple(1, Some(\"a\")).toBson\n  // {\"string\": \"a\", \"int\": 1}\n\n  implicit val simpleDecoder: BsonDecoder[Simple] = BsonDocumentDecoder.derived\n  val doc = BsonDocument(\"int\" -\u003e 1, \"string\" -\u003e \"string\")\n  val decoded = doc.fromBson[Simple]\n  // Right(Simple(1,Some(string)))\n\n  sealed trait Trait\n  case class Foo(answer: Int) extends Trait\n  case class Bar(bar: String) extends Trait\n\n  implicit val traitCodec: BsonDocumentCodec[Trait] = BsonDocumentCodec.derived\n\n  val encoded = Foo(42).toBson\n  // {\"answer\": 42, \"type\": \"Foo\"}\n```\n\nA transformation function for keynames can be provided as follows:\n\n```scala\n  import medeia.generic.GenericDerivationOptions\n  import medeia.encoder.BsonEncoder\n  import medeia.syntax._\n\n  case class Simple(fieldInScala: Int)\n  implicit val genericDerivationOptions: GenericDerivationOptions[Simple] =\n    GenericDerivationOptions { case \"fieldInScala\" =\u003e \"fieldInBson\" }\n  implicit val simpleEncoder: BsonDocumentEncoder[Simple] = BsonDocumentEncoder.derived\n  val encoded = Simple(1).toBson\n  // {\"fieldInBson\": 1}\n```\n\nGenericDerivationOptions works for encoding and decoding.\nIf the provided partial function is not defined for a key no transformation is used.\n\n### Enumeratum\n\nA separate module exists for encoding and decoding [enumeratum](https://github.com/lloydmeta/enumeratum) enums:\n\n#### Add sbt dependency\n\n```sbt\n  libraryDependencies += \"de.megaera\" %% \"medeia-enumeratum\" % \"1.0.0\"\n```\n\n#### Usage\n\n```scala\n  import medeia.syntax._\n  import medeia.enumeratum.Enumeratum\n\n  import enumeratum.Enum\n  import enumeratum.EnumEntry\n\n  import scala.collection.immutable\n\n  sealed abstract class TestEnum(override val entryName: String) extends EnumEntry\n\n  object TestEnum extends Enum[TestEnum] {\n    override val values: immutable.IndexedSeq[TestEnum] = findValues\n\n    case object A extends TestEnum(\"A\")\n    case object B extends TestEnum(\"B\")\n    case object C extends TestEnum(\"C\")\n\n    implicit val codec: BsonCodec[TestEnum] = Enumeratum.codec(TestEnum)\n  }\n\n  TestEnum.A.toBson\n  // \"A\"\n```\n\n### Refined\n\nBsonEncoder/BsonDecoder for `eu.timepit:refined` can be found in the `medeia-refined` module\n\n#### Add sbt dependency\n\n```sbt\n  libraryDependencies += \"de.megaera\" %% \"medeia-refined\" % \"1.0.0\"\n```\n\n#### Usage\n\n```scala\n  import eu.timepit.refined.api.Refined\n  import eu.timepit.refined.auto._\n  import eu.timepit.refined.collection._\n  import medeia.syntax._\n  import medeia.refined._\n\n  val refinedString: String Refined NonEmpty = \"test\"\n  refinedString.toBson\n  // BsonString{value='test'}\n```\n\n## License\n\nmedeia is licensed under the Apache License, Version 2.0 (the “License”); you may not use this software except in compliance with the License.\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedeia%2Fmedeia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmedeia%2Fmedeia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedeia%2Fmedeia/lists"}