{"id":18984445,"url":"https://github.com/timvw/stringmapper","last_synced_at":"2025-10-13T09:10:44.533Z","repository":{"id":40367161,"uuid":"308021008","full_name":"timvw/stringmapper","owner":"timvw","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-15T14:36:57.000Z","size":23,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T01:38:50.201Z","etag":null,"topics":[],"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/timvw.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}},"created_at":"2020-10-28T13:14:19.000Z","updated_at":"2024-12-09T19:54:31.000Z","dependencies_parsed_at":"2024-11-08T16:22:43.703Z","dependency_job_id":"b615a442-ae83-42ae-b2f5-8a66e7fe334d","html_url":"https://github.com/timvw/stringmapper","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/timvw/stringmapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timvw%2Fstringmapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timvw%2Fstringmapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timvw%2Fstringmapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timvw%2Fstringmapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timvw","download_url":"https://codeload.github.com/timvw/stringmapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timvw%2Fstringmapper/sbom","scorecard":{"id":886940,"data":{"date":"2025-08-11","repo":{"name":"github.com/timvw/stringmapper","commit":"d420d5db1bea771a56b36a14775a7f136606e5d4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":-1,"reason":"No tokens found","details":null,"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":"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":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"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":"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"}}]},"last_synced_at":"2025-08-24T10:21:55.943Z","repository_id":40367161,"created_at":"2025-08-24T10:21:55.943Z","updated_at":"2025-08-24T10:21:55.943Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014484,"owners_count":26085535,"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-10-13T02:00:06.723Z","response_time":61,"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":[],"created_at":"2024-11-08T16:21:29.798Z","updated_at":"2025-10-13T09:10:44.497Z","avatar_url":"https://github.com/timvw.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# String Mapper\n\nThis library automates the task of mapping Strings to Things.\nA typical use-case is parsing CSV into a case class.\n\n[![Build Status](https://api.travis-ci.org/timvw/stringmapper.png?branch=master)](https://travis-ci.org/timvw/stringmapper)\n[![Maven Central](https://img.shields.io/maven-central/v/be.icteam/stringmapper_2.12.svg)](https://maven-badges.herokuapp.com/maven-central/be.icteam/stringmapper_2.12)\n\n## Usage\n\n```scala\nimport be.icteam.stringmapper._\n\ncase class Item(title: String, name: String, id: Int, last: Option[String])\n\nval conformInput = \"sir,mike,3,x\"\nval malformedLeadingSpaceInId = \"sir,mike, 3,x\"\nval malformedMissingColumn = \"sir,mike,3\"\nval malformedAdditionalColumn = \"sir,mike,3,x,BAD\"\n\nval itemCsvParser = CsvParser[Item]\nassert(itemCsvParser.parse(conformInput) == Right(Item(\"sir\", \"mike\", 3, Some(\"x\"))))\nassert(itemCsvParser.parse(malformedLeadingSpaceInId) == Left(List(\"java.lang.NumberFormatException: For input string: \\\" 3\\\"\")))\nassert(itemCsvParser.parse(malformedMissingColumn) == Left(List(\"unexpected end of line, still need to parse columns..\")))\nassert(itemCsvParser.parse(malformedAdditionalColumn) == Left(List(\"expected end of line, but still have 'BAD'\")))\n```\n\nCustomizing StringToThing:\n\n```scala\n\nval stringToItem: StringsToThing[Item] = {\n\n    implicit def customIntFieldParser[K \u003c: Symbol]: StringToThing[FieldType[K, Int]] = {\n        // in this example we trim eventual whitespace\n        StringToThing.stringTofieldType[K, Int](StringToThing[Int](_.trim.toInt))\n    }\n\n    implicit def customStringFieldParser[K \u003c: Symbol](implicit witness: Witness.Aux[K]): StringToThing[FieldType[K, String]] = {\n        // in this example we UPPERCASE the value of the 'name' field\n        val nameParser = StringToThing[String](_.toUpperCase())\n        val hParserToUse =\n            if(witness.value == Symbol(\"name\")) nameParser\n            else implicitly[StringToThing[String]]\n        StringToThing.stringTofieldType[K, String](hParserToUse)\n    }\n\n    implicitly[StringsToThing[Item]]\n}\n\nimplicit val customStringToItem = stringToItem\nval customItemCsvParser = CsvParser[Item]\n// the whitespace in ' 3' is ignored and name is in uppercase\nassert(customItemCsvParser.parse(malformedLeadingSpaceInId) == Right(Item(\"sir\", \"MIKE\", 3, Some(\"x\"))))\n```\n\n## Development\n\nCompile and test:\n\n```bash\nsbt +clean; +cleanFiles; +compile; +test\n```\n\nInstall a snapshot in your local maven repository:\n\n```bash\nsbt +publishM2\n```\n\n## Release\n\nSet the following environment variables:\n- PGP_PASSPHRASE\n- PGP_SECRET\n- SONATYPE_USERNAME\n- SONATYPE_PASSWORD\n\n```bash\nexport SONATYPE_USERNAME=timvw\nexport SONATYPE_PASSWORD=XXX\nexport PGP_PASSPHRASE=XXX\nexport PGP_SECRET=$(gpg --armor --export-secret-keys 0x6E4CD7D2EAC83E19 | base64)\n```\n\nLeveraging the [ci-release](https://github.com/olafurpg/sbt-ci-release) plugin:\n\n```bash\nsbt ci-release # release a SNAPSHOT version\nCI_COMMIT_TAG=v0.0.2 sbt 'set version := \"0.0.2\"' ci-release # release 0.0.2\n```\n\nFind the most recent release:\n\n```bash\ngit ls-remote --tags | \\\n  awk -F\"/\" '{print $3}' | \\\n  grep '^v[0-9]*\\.[0-9]*\\.[0-9]*' | \\\n  grep -v {} | \\\n  sort --version-sort | \\\n  tail -n1\n```\n\nPush a new tag to trigger a release via [travis-ci](https://travis-ci.org/github/timvw/stringmapper):\n\n```bash\nv=v1.0.5\ngit tag -a $v  -m $v\ngit push origin $v\n```\n\n## License\n\nCode is provided under the Apache 2.0 license available at http://opensource.org/licenses/Apache-2.0, as well as in the LICENSE file. This is the same license used as Spark and Frameless.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimvw%2Fstringmapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimvw%2Fstringmapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimvw%2Fstringmapper/lists"}