{"id":15494266,"url":"https://github.com/andyglow/scala-range","last_synced_at":"2025-09-07T21:36:44.888Z","repository":{"id":39849401,"uuid":"172811258","full_name":"andyglow/scala-range","owner":"andyglow","description":"Little Scala Range implementation","archived":false,"fork":false,"pushed_at":"2025-09-07T13:51:35.000Z","size":200,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-07T15:27:32.585Z","etag":null,"topics":["iterator","range","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andyglow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-27T00:13:24.000Z","updated_at":"2025-09-07T13:51:39.000Z","dependencies_parsed_at":"2023-02-19T08:16:12.873Z","dependency_job_id":"1b8cf455-06cd-455a-9125-b32d185347c2","html_url":"https://github.com/andyglow/scala-range","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/andyglow/scala-range","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyglow%2Fscala-range","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyglow%2Fscala-range/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyglow%2Fscala-range/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyglow%2Fscala-range/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andyglow","download_url":"https://codeload.github.com/andyglow/scala-range/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyglow%2Fscala-range/sbom","scorecard":{"id":195191,"data":{"date":"2025-08-11","repo":{"name":"github.com/andyglow/scala-range","commit":"56c7b68151d1faef10b4fcf94a8fd5dcc593df1f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"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":"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":"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":"Maintained","score":5,"reason":"7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5","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":-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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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 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-16T21:42:24.002Z","repository_id":39849401,"created_at":"2025-08-16T21:42:24.002Z","updated_at":"2025-08-16T21:42:24.002Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274101080,"owners_count":25222444,"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-09-07T02:00:09.463Z","response_time":67,"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":["iterator","range","scala"],"created_at":"2024-10-02T08:12:57.490Z","updated_at":"2025-09-07T21:36:44.871Z","avatar_url":"https://github.com/andyglow.png","language":"Scala","readme":"# scala-range\n[![Build Status](https://cloud.drone.io/api/badges/andyglow/scala-range/status.svg)](https://cloud.drone.io/andyglow/scala-range)\n[![codecov](https://codecov.io/gh/andyglow/scala-range/branch/master/graph/badge.svg?token=3674BUQYDA)](https://codecov.io/gh/andyglow/scala-range)\n[![mvn](https://img.shields.io/badge/dynamic/json.svg?label=mvn\u0026query=%24.response.docs%5B0%5D.latestVersion\u0026url=https%3A%2F%2Fsearch.maven.org%2Fsolrsearch%2Fselect%3Fq%3Dscalax-range_2.13%26start%3D0%26rows%3D1)](https://search.maven.org/artifact/com.github.andyglow/scalax-range_2.13/)\n\nInstall\n```scala\nlibraryDependencies += \"com.github.andyglow\" %% \"scalax-range\" % Version\n```\n\nUse\n```scala\nimport scalax.range._\n\n// numeric\nfor { x \u003c- inclusive(1) to 10 by 1 } println(x)\n(exclusive(1) to 10 by 1) foreach println\n(inclusive(0.0) until 1.0 by 0.1) foreach println\n\n// date\nimport scalax.range.date._\nimport scala.concurrent.duration.FiniteDuration\nimport java.time.{Duration =\u003e JDuration}\n\nfor { d \u003c- inclusive(new java.util.Date(0)) to new java.util.Date(100) by 1 } println(x)\nfor { d \u003c- inclusive(new java.util.Date(0)) to new java.util.Date(1000000) by 1.second } println(x)\nfor { d \u003c- inclusive(new java.util.Date(0)) to new java.util.Date(1000000) by JDuration.ofSeconds(1) } println(x)\n```\n\n# Introduction\nThis simple dsl tries to overcome limitation of a standard `scala.collection.immutable.Range` which is implemented for only Int.\n\nBy using `scala-range` you may leverage the same approach with extended amount of types.\n\n## Supported types\n\nAll types which has Numeric type-class implemented\n- `Byte`\n- `Char`\n- `Short`\n- `Int`\n- `Long`\n- `Float`\n- `Double`\n- `BigInt`\n- `BigDecimal`\nFor iterating through range of numeric types you need use the same type to specify a step. \nSo Int is the only possible way to traverse through the range of ints, Double for doubles and so on.\n\nFor Date related types the step may be defined as `java.time.Duration` \nor `scala.concurrent.duration.FiniteDuration`.   \n \nStandard Date \u0026 Time related types\n- `java.util.Date`\n- `java.time.Instant`\n- `java.time.LocalDate`\n- `java.time.LocalTime`\n- `java.time.LocalDateTime`\n- `java.time.OffsetDateTime`\n- `java.time.ZonedDateTime`\n\n### JodaTime\nJodaTime Date \u0026 Time related types\n- `org.joda.time.Instant`\n- `org.joda.time.LocalDate`\n- `org.joda.time.LocalTime`\n- `org.joda.time.DateTime`\n\nIn order to add joda time support please add additional dependency:\n```scala\nlibraryDependencies += \"com.github.andyglow\" %% \"scalax-range-joda-time\" % Version\n```\nAlso additional import line will be required:\n```scala\nimport scalax.range.jodatime._\n```\nThis will also make you able to use `org.joda.time.Duration` as a step definition.\n\n### Numerics to define a Step in Date based Ranges\nThere is also a way to use numeric types to define a step.\nThe way it will be treated is different for different types used to define a range. \nBasically the numeric will get converted into `Long` and then this long gets treated uniquely.\n\n- `java.util.Date` (num is seconds)\n- `java.time.Instant` (num is seconds)\n- `java.time.LocalDate` (num is days)\n- `java.time.LocalTime` (num is minutes)\n- `java.time.LocalDateTime` (num is hours)\n- `java.time.OffsetDateTime` (num is hours)\n- `java.time.ZonedDateTime` (num is hours)\n- `org.joda.time.Instant` (num is seconds)\n- `org.joda.time.LocalDate` (num is days)\n- `org.joda.time.LocalTime` (num is minutes)\n- `org.joda.time.DateTime` (num is hours)\n\nTODO:\n- add support for\n  - [ ] https://github.com/typelevel/squants\n  - [ ] https://github.com/typelevel/spire","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyglow%2Fscala-range","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyglow%2Fscala-range","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyglow%2Fscala-range/lists"}