{"id":21451847,"url":"https://github.com/reity/are","last_synced_at":"2025-09-13T16:20:28.885Z","repository":{"id":91235032,"uuid":"260603894","full_name":"reity/are","owner":"reity","description":"Library for defining and working with abstract regular expressions that support strings/sequences with elements of any symbol type, with an emphasis on supporting scenarios in which it is necessary to work with regular expressions as abstract mathematical objects.","archived":false,"fork":false,"pushed_at":"2022-08-04T06:07:05.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T02:45:10.754Z","etag":null,"topics":["data-structures","python","python-library","re-to-nfa","regular-expressions","regular-languages","theory-of-computation"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/are","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reity.png","metadata":{"files":{"readme":"README.rst","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-05-02T03:08:39.000Z","updated_at":"2022-08-04T07:02:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"e29aab64-579c-4b18-b0eb-41f5097c07cd","html_url":"https://github.com/reity/are","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/reity/are","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reity%2Fare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reity%2Fare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reity%2Fare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reity%2Fare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reity","download_url":"https://codeload.github.com/reity/are/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reity%2Fare/sbom","scorecard":{"id":769529,"data":{"date":"2025-08-11","repo":{"name":"github.com/reity/are","commit":"9eb15e8a9652d0a6cfdec31d1b8692084ddc5f74"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/lint-test-cover-docs.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/lint-test-cover-docs.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/reity/are/lint-test-cover-docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-test-cover-docs.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/reity/are/lint-test-cover-docs.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/lint-test-cover-docs.yml:20","Warn: pipCommand not pinned by hash: .github/workflows/lint-test-cover-docs.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/lint-test-cover-docs.yml:32","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 pipCommand 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":"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":"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: MIT License: 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 'main'"],"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"}}]},"last_synced_at":"2025-08-23T01:51:51.949Z","repository_id":91235032,"created_at":"2025-08-23T01:51:51.949Z","updated_at":"2025-08-23T01:51:51.949Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274990029,"owners_count":25386571,"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-13T02:00:10.085Z","response_time":70,"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":["data-structures","python","python-library","re-to-nfa","regular-expressions","regular-languages","theory-of-computation"],"created_at":"2024-11-23T04:26:23.220Z","updated_at":"2025-09-13T16:20:28.856Z","avatar_url":"https://github.com/reity.png","language":"Python","readme":"===\nare\n===\n\nLibrary for defining and working with abstract regular expressions that support strings/sequences with elements of any symbol type, with an emphasis on supporting scenarios in which it is necessary to work with regular expressions as abstract mathematical objects.\n\n|pypi| |readthedocs| |actions| |coveralls|\n\n.. |pypi| image:: https://badge.fury.io/py/are.svg\n   :target: https://badge.fury.io/py/are\n   :alt: PyPI version and link.\n\n.. |readthedocs| image:: https://readthedocs.org/projects/are/badge/?version=latest\n   :target: https://are.readthedocs.io/en/latest/?badge=latest\n   :alt: Read the Docs documentation status.\n\n.. |actions| image:: https://github.com/reity/are/workflows/lint-test-cover-docs/badge.svg\n   :target: https://github.com/reity/are/actions/workflows/lint-test-cover-docs.yml\n   :alt: GitHub Actions status.\n\n.. |coveralls| image:: https://coveralls.io/repos/github/reity/are/badge.svg?branch=main\n   :target: https://coveralls.io/github/reity/are?branch=main\n   :alt: Coveralls test coverage summary\n\nPurpose\n-------\nThis library provides classes that enable concise construction of abstract regular expressions. In the case of this library, the term *abstract* refers to the fact that the symbols that constitute the abstract *strings* (*i.e.*, iterable sequences) that satisfy an abstract regular expression can be values or objects of any immutable type. Thus, this library also makes it possible to determine whether an iterable containing zero or more objects satisfies a given abstract regular expression. Any abstract regular expression can also be converted into a nondeterministic finite automaton (as implemented within `another package \u003chttps://pypi.org/project/nfa/\u003e`__) that accepts exactly those iterables which satisfy that abstract regular expression.\n\nInstallation and Usage\n----------------------\nThis library is available as a `package on PyPI \u003chttps://pypi.org/project/are\u003e`__::\n\n    python -m pip install are\n\nThe library can be imported in the usual way::\n\n    import are\n    from are import *\n\nExamples\n^^^^^^^^\n\n.. |are| replace:: ``are``\n.. _are: https://are.readthedocs.io/en/2.1.0/_source/are.html#are.are.are\n\n.. |lit| replace:: ``lit``\n.. _lit: https://are.readthedocs.io/en/2.1.0/_source/are.html#are.are.lit\n\n.. |con| replace:: ``con``\n.. _con: https://are.readthedocs.io/en/2.1.0/_source/are.html#are.are.con\n\nThis library makes it possible to construct abstract regular expressions (represented as instances of the |are|_ class) that work with a chosen symbol type. In the example below, a regular expression is defined (using the literal operator |lit|_ and concatenation operator |con|_) in which symbols are integers. It is then applied to an iterable of integers. This returns the iterable's length (as an integer) if that iterable satisfies the abstract regular expression::\n\n    \u003e\u003e\u003e from are import *\n    \u003e\u003e\u003e a = con(lit(1), con(lit(2), lit(3)))\n    \u003e\u003e\u003e a([1, 2, 3])\n    3\n\nIf the longest prefix of an iterable that satisfies an abstract regular expression is desired, the ``full`` parameter can be set to ``False``::\n\n    \u003e\u003e\u003e a([1, 2, 3, 4, 5], full=False)\n    3\n\nOperators for alternation and repetition of abstract regular expressions are also available::\n\n    \u003e\u003e\u003e a = rep(con(lit(1), lit(2)))\n    \u003e\u003e\u003e a([1, 2, 1, 2, 1, 2])\n    6\n    \u003e\u003e\u003e a = alt(rep(lit(2)), rep(lit(3)))\n    \u003e\u003e\u003e a([2, 2, 2, 2, 2])\n    5\n    \u003e\u003e\u003e a([3, 3, 3, 3])\n    4\n\n.. |emp| replace:: ``emp``\n.. _emp: https://are.readthedocs.io/en/2.1.0/_source/are.html#are.are.emp\n\nThe |emp|_ constructor can be used to create an abstract regular expression that is satisfied by the empty iterable::\n\n    \u003e\u003e\u003e a = emp()\n    \u003e\u003e\u003e a([])\n    0\n\n.. |nul| replace:: ``nul``\n.. _nul: https://are.readthedocs.io/en/2.1.0/_source/are.html#are.are.nul\n\nThe |nul|_ constructor can be used to create an abstract regular expression that cannot be satisfied::\n\n    \u003e\u003e\u003e a = nul()\n    \u003e\u003e\u003e a([]) is None\n    True\n    \u003e\u003e\u003e a([1, 2, 3]) is None\n    True\n\nAn abstract regular expression that has only string symbols can be converted into a regular expression string that is compatible with the built-in `re \u003chttps://docs.python.org/3/library/re.html\u003e`__ library::\n\n    \u003e\u003e\u003e a = alt(lit('x'), rep(lit('y')))\n    \u003e\u003e\u003e r = a.to_re()\n    \u003e\u003e\u003e r\n    '(((x)*)|((y)*))'\n    \u003e\u003e\u003e import re\n    \u003e\u003e\u003e r = re.compile(a.to_re())\n    \u003e\u003e\u003e r.fullmatch('yyy')\n    \u003cre.Match object; span=(0, 3), match='yyy'\u003e\n\nAn abstract regular expression can also be converted into an NFA representation (as implemented within the `PyPI \u003chttps://pypi.org/project/nfa\u003e`__ package)::\n\n    \u003e\u003e\u003e a = con(lit(1), con(lit(2), lit(3)))\n    \u003e\u003e\u003e a.to_nfa()\n    nfa({1: nfa({2: nfa({3: nfa()})})})\n\nDevelopment\n-----------\nAll installation and development dependencies are fully specified in ``pyproject.toml``. The ``project.optional-dependencies`` object is used to `specify optional requirements \u003chttps://peps.python.org/pep-0621\u003e`__ for various development tasks. This makes it possible to specify additional options (such as ``docs``, ``lint``, and so on) when performing installation using `pip \u003chttps://pypi.org/project/pip\u003e`__::\n\n    python -m pip install .[docs,lint]\n\nDocumentation\n^^^^^^^^^^^^^\nThe documentation can be generated automatically from the source files using `Sphinx \u003chttps://www.sphinx-doc.org\u003e`__::\n\n    python -m pip install .[docs]\n    cd docs\n    sphinx-apidoc -f -E --templatedir=_templates -o _source .. \u0026\u0026 make html\n\nTesting and Conventions\n^^^^^^^^^^^^^^^^^^^^^^^\nAll unit tests are executed and their coverage is measured when using `pytest \u003chttps://docs.pytest.org\u003e`__ (see the ``pyproject.toml`` file for configuration details)::\n\n    python -m pip install .[test]\n    python -m pytest\n\nThe subset of the unit tests included in the module itself can be executed using `doctest \u003chttps://docs.python.org/3/library/doctest.html\u003e`__::\n\n    python src/are/are.py -v\n\nStyle conventions are enforced using `Pylint \u003chttps://pylint.pycqa.org\u003e`__::\n\n    python -m pip install .[lint]\n    python -m pylint src/are test/test_are.py\n\nContributions\n^^^^^^^^^^^^^\nIn order to contribute to the source code, open an issue or submit a pull request on the `GitHub page \u003chttps://github.com/reity/are\u003e`__ for this library.\n\nVersioning\n^^^^^^^^^^\nBeginning with version 0.1.0, the version number format for this library and the changes to the library associated with version number increments conform with `Semantic Versioning 2.0.0 \u003chttps://semver.org/#semantic-versioning-200\u003e`__.\n\nPublishing\n^^^^^^^^^^\nThis library can be published as a `package on PyPI \u003chttps://pypi.org/project/are\u003e`__ by a package maintainer. First, install the dependencies required for packaging and publishing::\n\n    python -m pip install .[publish]\n\nEnsure that the correct version number appears in ``pyproject.toml``, and that any links in this README document to the Read the Docs documentation of this package (or its dependencies) have appropriate version numbers. Also ensure that the Read the Docs project for this library has an `automation rule \u003chttps://docs.readthedocs.io/en/stable/automation-rules.html\u003e`__ that activates and sets as the default all tagged versions. Create and push a tag for this version (replacing ``?.?.?`` with the version number)::\n\n    git tag ?.?.?\n    git push origin ?.?.?\n\nRemove any old build/distribution files. Then, package the source into a distribution archive::\n\n    rm -rf build dist src/*.egg-info\n    python -m build --sdist --wheel .\n\nFinally, upload the package distribution archive to `PyPI \u003chttps://pypi.org\u003e`__::\n\n    python -m twine upload dist/*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freity%2Fare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freity%2Fare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freity%2Fare/lists"}