{"id":22825887,"url":"https://github.com/tylerburdsall/lazy-cartesian-product-python","last_synced_at":"2025-08-14T19:08:04.644Z","repository":{"id":95611129,"uuid":"126080410","full_name":"tylerburdsall/lazy-cartesian-product-python","owner":"tylerburdsall","description":"Find the Nth entry in a Cartesian Product","archived":false,"fork":false,"pushed_at":"2018-04-18T01:30:25.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T21:05:04.863Z","etag":null,"topics":["cartesian","cartesian-product","combination","generate","nth","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tylerburdsall.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":"2018-03-20T20:47:17.000Z","updated_at":"2018-05-03T21:24:16.000Z","dependencies_parsed_at":"2023-05-21T02:30:20.763Z","dependency_job_id":null,"html_url":"https://github.com/tylerburdsall/lazy-cartesian-product-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tylerburdsall/lazy-cartesian-product-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerburdsall%2Flazy-cartesian-product-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerburdsall%2Flazy-cartesian-product-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerburdsall%2Flazy-cartesian-product-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerburdsall%2Flazy-cartesian-product-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tylerburdsall","download_url":"https://codeload.github.com/tylerburdsall/lazy-cartesian-product-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylerburdsall%2Flazy-cartesian-product-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270467672,"owners_count":24588807,"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-14T02:00:10.309Z","response_time":75,"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":["cartesian","cartesian-product","combination","generate","nth","python"],"created_at":"2024-12-12T17:12:23.837Z","updated_at":"2025-08-14T19:08:02.070Z","avatar_url":"https://github.com/tylerburdsall.png","language":"Python","readme":"# lazy-cartesian-product\nFind the Nth entry in a Cartesian Product\n\n## Usage\nGiven a list of lists, you can find the Nth entry in a Cartesian Product without precomputing every combination. This saves memory and time while also maintaning close to O(1) performance:\n\n```\nfrom LazyCartesianProduct import LazyCartesianProduct\n\ndef example():\n  a = [ 1, 2, 3, 4, 5 ]\n  b = [ 'foo', 'bar' ]\n  c = [ 'x', 'y', 'z' ]\n  d = [ 'one', 'two', 'three' ]\n\n  sets = [ a, b, c, d ]\n\n  cp = LazyCartesianProduct(sets)\n\n  result1 = cp.entryAt(8)\n  print(result1)\n\n  result2 = cp.entryAt(32)\n  print(result2)\n\n  result3 = cp.entryAt(67)\n  print(result3)\n  \n example()\n```\n\nWhen ran, the following output is produced:\n\n```\n$ python example.py\n[1, 'foo', 'z', 'three']\n[2, 'bar', 'y', 'three']\n[4, 'bar', 'y', 'two']\n$\n```\n\n## License\nBSD-2, see LICENSE\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerburdsall%2Flazy-cartesian-product-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylerburdsall%2Flazy-cartesian-product-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerburdsall%2Flazy-cartesian-product-python/lists"}