{"id":15492298,"url":"https://github.com/stranger6667/unicode-intervals","last_synced_at":"2026-03-05T00:32:55.197Z","repository":{"id":154066537,"uuid":"630621287","full_name":"Stranger6667/unicode-intervals","owner":"Stranger6667","description":"Search for Unicode code points intervals by including/excluding categories, ranges, and custom characters sets.","archived":false,"fork":false,"pushed_at":"2023-04-27T12:04:34.000Z","size":138,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-19T10:44:50.373Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Stranger6667.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2023-04-20T19:23:04.000Z","updated_at":"2023-11-22T01:32:24.000Z","dependencies_parsed_at":"2023-06-06T01:45:46.223Z","dependency_job_id":null,"html_url":"https://github.com/Stranger6667/unicode-intervals","commit_stats":{"total_commits":34,"total_committers":1,"mean_commits":34.0,"dds":0.0,"last_synced_commit":"2d9392ecbf2b79d93316c22eef681a8c99750733"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stranger6667%2Funicode-intervals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stranger6667%2Funicode-intervals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stranger6667%2Funicode-intervals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stranger6667%2Funicode-intervals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stranger6667","download_url":"https://codeload.github.com/Stranger6667/unicode-intervals/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250310087,"owners_count":21409597,"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","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-10-02T08:00:08.737Z","updated_at":"2026-03-05T00:32:55.123Z","avatar_url":"https://github.com/Stranger6667.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"unicode-intervals\n=================\n\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/github-8da0cb?style=flat-square\u0026labelColor=555555\u0026logo=github\" height=\"20\"\u003e](https://github.com/Stranger6667/unicode-intervals)\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/unicode-intervals.svg?style=flat-square\u0026color=fc8d62\u0026logo=rust\" height=\"20\"\u003e](https://crates.io/crates/unicode-intervals)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/badge/docs.rs-unicode_intervals-66c2a5?style=flat-square\u0026labelColor=555555\u0026logo=docs.rs\" height=\"20\"\u003e](https://docs.rs/unicode-intervals)\n[\u003cimg alt=\"build status\" src=\"https://img.shields.io/github/actions/workflow/status/Stranger6667/unicode-intervals/ci.yml?branch=main\u0026style=flat-square\" height=\"20\"\u003e](https://github.com/Stranger6667/unicode-intervals/actions?query=branch%3Amain)\n[\u003cimg alt=\"codecov.io\" src=\"https://img.shields.io/codecov/c/gh/Stranger6667/unicode-intervals?logo=codecov\u0026style=flat-square\u0026token=tOzvV4kDY0\" height=\"20\"\u003e](https://app.codecov.io/github/Stranger6667/unicode-intervals)\n\nThis library provides a way to search for Unicode code point intervals by categories, ranges, and custom character sets.\n\nThe main purpose of `unicode-intervals` is to simplify generating strings that matching specific criteria.\n\n```toml\n[dependencies]\nunicode-intervals = \"0.2\"\n```\n\n\u003cbr\u003e\n\n## Examples\n\nThe example below will produce code point intervals of uppercase \u0026 lowercase letters less than 128 and will include the `☃` character.\n\n```rust\nuse unicode_intervals::UnicodeCategory;\n\nlet intervals = unicode_intervals::query()\n    .include_categories(\n        UnicodeCategory::UPPERCASE_LETTER | \n        UnicodeCategory::LOWERCASE_LETTER\n    )\n    .max_codepoint(128)\n    .include_characters(\"☃\")\n    .intervals()\n    .expect(\"Invalid query input\");\nassert_eq!(intervals, \u0026[(65, 90), (97, 122), (9731, 9731)]);\n```\n\n`IntervalSet` for index-like access to the underlying codepoints:\n\n```rust\nlet interval_set = unicode_intervals::query()\n    .max_codepoint(128)\n    .interval_set()\n    .expect(\"Invalid query input\");\n// Get 10th codepoint in this interval set\nassert_eq!(interval_set.codepoint_at(10), Some('K' as u32));\nassert_eq!(interval_set.index_of('K'), Some(10));\n```\n\nQuery specific Unicode version:\n\n```rust\nuse unicode_intervals::UnicodeVersion;\n\nlet intervals = UnicodeVersion::V11_0_0.query()\n    .max_codepoint(128)\n    .include_characters(\"☃\")\n    .intervals()\n    .expect(\"Invalid query input\");\nassert_eq!(intervals, \u0026[(0, 128), (9731, 9731)]);\n```\n\nRestrict the output to code points within a certain range:\n\n```rust\nlet intervals = unicode_intervals::query()\n    .min_codepoint(65)\n    .max_codepoint(128)\n    .intervals()\n    .expect(\"Invalid query input\");\nassert_eq!(intervals, \u0026[(65, 128)])\n```\n\nInclude or exclude specific characters:\n\n```rust\nuse unicode_intervals::UnicodeCategory;\n\nlet intervals = unicode_intervals::query()\n    .include_categories(UnicodeCategory::PARAGRAPH_SEPARATOR)\n    .include_characters(\"-123\")\n    .intervals()\n    .expect(\"Invalid query input\");\nassert_eq!(intervals, \u0026[(45, 45), (49, 51), (8233, 8233)])\n```\n\n## Unicode version support\n\n`unicode-intervals` supports Unicode 9.0.0 - 15.0.0.\n\n#### License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n\n\u003cbr\u003e\n\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this crate by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstranger6667%2Funicode-intervals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstranger6667%2Funicode-intervals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstranger6667%2Funicode-intervals/lists"}