{"id":19423769,"url":"https://github.com/limansky/beanpuree","last_synced_at":"2025-08-24T03:38:13.611Z","repository":{"id":19194915,"uuid":"86473197","full_name":"limansky/beanpuree","owner":"limansky","description":"Middle layer between JavaBeans and shapeless","archived":false,"fork":false,"pushed_at":"2025-08-03T08:32:59.000Z","size":479,"stargazers_count":46,"open_issues_count":3,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-03T10:14:53.479Z","etag":null,"topics":["java-bean","scala","shapeless","typelevel"],"latest_commit_sha":null,"homepage":null,"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/limansky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2017-03-28T14:57:39.000Z","updated_at":"2025-08-03T08:33:03.000Z","dependencies_parsed_at":"2023-02-17T04:00:39.213Z","dependency_job_id":"088f4233-71b4-42a3-abde-8a89b6af4143","html_url":"https://github.com/limansky/beanpuree","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/limansky/beanpuree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limansky%2Fbeanpuree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limansky%2Fbeanpuree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limansky%2Fbeanpuree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limansky%2Fbeanpuree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limansky","download_url":"https://codeload.github.com/limansky/beanpuree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limansky%2Fbeanpuree/sbom","scorecard":{"id":589964,"data":{"date":"2025-08-11","repo":{"name":"github.com/limansky/beanpuree","commit":"d07d449952c77dc8b04a89d497ff13f945c0eed2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.1,"checks":[{"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":"Code-Review","score":8,"reason":"Found 11/13 approved changesets -- score normalized to 8","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":"Maintained","score":10,"reason":"20 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.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":"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:17: update your workflow using https://app.stepsecurity.io/secureworkflow/limansky/beanpuree/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/limansky/beanpuree/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/limansky/beanpuree/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/limansky/beanpuree/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/limansky/beanpuree/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/limansky/beanpuree/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/limansky/beanpuree/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/limansky/beanpuree/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/limansky/beanpuree/ci.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 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":"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":"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":"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":"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":"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 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-20T21:36:23.797Z","repository_id":19194915,"created_at":"2025-08-20T21:36:23.797Z","updated_at":"2025-08-20T21:36:23.797Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271786348,"owners_count":24820667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["java-bean","scala","shapeless","typelevel"],"created_at":"2024-11-10T13:40:43.279Z","updated_at":"2025-08-24T03:38:13.596Z","avatar_url":"https://github.com/limansky.png","language":"Scala","readme":"BeanPurée\n=========\n\n**BeanPurée** is a middle layer between JavaBeans and [shapeless][shapeless].\n\n\u003e NOTE: The library is in active development stage. So the API might be changed.\n\n[![Build Status](https://github.com/limansky/beanpuree/actions/workflows/ci.yml/badge.svg)](https://github.com/limansky/beanpuree/actions/workflows/ci.yml)\n[![Join the chat at https://gitter.im/limansky/beanpuree](https://badges.gitter.im/limansky/beanpuree.svg)](https://gitter.im/limansky/beanpuree?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![codecov](https://codecov.io/gh/limansky/beanpuree/branch/master/graph/badge.svg)](https://codecov.io/gh/limansky/beanpuree)\n[![Maven Central](https://img.shields.io/maven-central/v/me.limansky/beanpuree_2.12.svg)](https://maven-badges.herokuapp.com/maven-central/me.limansky/beanpuree_2.12)\n\n## Motivation\n\nEven though Scala is compatible with Java, the languages are different, and the\ncoding styles are different too.  In Scala we prefer to use immutable case classes,\nbut in Java world mutable JavaBeans are common building blocks.  Moreover, many\nScala libraries provide API which requires case classes (e.g. different serializers).\nAs result, we need to have similar model classes for Java and Scala.  This library\nhelps to convert data between JavaBeans and case classes.\n\n## Usage\n\nBeanPurée is available for 2.11, 2.12 and 2.13. You can add it to your project\nadding in `build.sbt`\n\n```Scala\nlibraryDependencies += \"me.limansky\" %% \"beanpuree\" % \"0.7\"\n```\n\nIf you'd like to use development version:\n\n```Scala\nresolvers += Resolver.sonatypeCentralSnapshots\n\nlibraryDependencies += \"me.limansky\" %% \"beanpuree\" % \"0.8-SNAPSHOT\"\n```\n\nThe core of BeanPurée is `BeanGeneric` class, which have a same role with\nshapeless `Generic`, but for JavaBeans.  Assume we have class:\n\n```Java\npublic class Foo {\n    private int a;\n    private String b;\n\n    public int getA() { return a; }\n    public void setA(int a) { this.a = a; }\n\n    public String getB() { return b; }\n    public void setB(String b) { this.b = b; }\n\n    public String toString() {\n        return \"Foo(\" + a + \", \\\"\" + b + \"\\\")\";\n    }\n}\n\n```\n\nNow we can create `BeanGeneric` instance and convert bean to HList and backward:\n\n```Scala\nscala\u003e val gen = BeanGeneric[Foo]\ngen: me.limansky.beanpuree.BeanGeneric[Foo]{type Repr = shapeless.::[Int,shapeless.::[String,shapeless.HNil]]}\n\nscala\u003e val foo = gen.from(5 :: \"aaa\" :: HNil)\nfoo: Foo = Foo(5, \"aaa\")\n\nscala\u003e foo.setB(\"changed\")\n\nscala\u003e gen.to(foo)\nres2: gen.Repr = 5 :: changed :: HNil\n```\n\nAnother important thing is `LabelledBeanGeneric`, which is a `LabelledGeneric` adopted\nfor the beans.  It's important to note, that it uses \"field names\" generated from the\ngetters names.  E.g.  `getStartTime` become `startTime` and `isEven` become `even`.\n\n`JavaTypeMapper[J, S]` provides converters for different Java and Scala classes.\nThere are converter instances from Java numeric classes to corresponding Scala ones.\nIt also can convert nullable value to `Option`.  You can convert `HList`s of convertable\nvalues as well.\n\n```Scala\nscala\u003e type JavaType = Integer :: String :: java.lang.Long :: HNil\ndefined type alias JavaType\n\nscala\u003e type ScalaType = Int :: String :: Option[Long] :: HNil\ndefined type alias ScalaType\n\nscala\u003e val m = JavaTypeMapper[JavaType, ScalaType]\nm: me.limansky.beanpuree.JavaTypeMapper[JavaType,ScalaType] = me.limansky.beanpuree.JavaTypeMapper$$anon$1@41bbc4c4\n\nscala\u003e m.javaToScala(6 :: \"test\" :: null :: HNil)\nres0: ScalaType = 6 :: test :: None :: HNil\n\nscala\u003e m.scalaToJava(42 :: null :: Some(66l) :: HNil)\nres1: JavaType = 42 :: null :: 66 :: HNil\n```\n\nThe next thing is a `BeanConverter` and `StrictBeanConverter` classes.  They use\n`LabelledBeanGeneric` and `LabelledGeneric` to convert between beans and case classes.\n\n```Scala\nscala\u003e case class Bar(a: Int, b: String)\ndefined class Bar\n\nscala\u003e val conv = BeanConverter[Foo, Bar]\nconv: me.limansky.beanpuree.BeanConverter[Foo,Bar] = me.limansky.beanpuree.BeanConverter$$anon$1@4eae0bc5\n\nscala\u003e conv.beanToProduct(foo)\nres3: Bar = Bar(5,changed)\n\nscala\u003e conv.productToBean(Bar(15, \"bar\"))\nres4: Foo = Foo(15, \"bar\")\n```\n\nThe converters doesn't care about fields order.  The difference between these two\nclasses is that `StrictBeanConverter` requires the same fields of  converting classes\nhaving the same types.  It means that if the bean uses Java\nnumeric classes (like java.lang.Integer), the case class also should have the\nfield with Java class.\n\n`BeanConverter` is more intelligent.  It uses `JavaTypeMapper` to convert field types.\nYou should be careful using it.  For example if you have an Integer field in Java class\nand Int in Scala, you might get a NullPointerException if the value is null.  Use `Option[Int]`\nto make it safe.\n\n[shapeless]: http://github.com/milessabin/shapeless\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimansky%2Fbeanpuree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimansky%2Fbeanpuree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimansky%2Fbeanpuree/lists"}