{"id":21983033,"url":"https://github.com/arsho/opener","last_synced_at":"2025-03-23T01:30:32.580Z","repository":{"id":57449068,"uuid":"300180117","full_name":"arsho/opener","owner":"arsho","description":"Open the lock puzzle solver","archived":false,"fork":false,"pushed_at":"2020-10-02T18:36:40.000Z","size":194,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T20:58:18.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/arsho.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-01T07:02:30.000Z","updated_at":"2020-10-22T20:39:27.000Z","dependencies_parsed_at":"2022-09-14T07:32:02.512Z","dependency_job_id":null,"html_url":"https://github.com/arsho/opener","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsho%2Fopener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsho%2Fopener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsho%2Fopener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arsho%2Fopener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arsho","download_url":"https://codeload.github.com/arsho/opener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245043780,"owners_count":20551837,"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-11-29T17:34:13.863Z","updated_at":"2025-03-23T01:30:32.561Z","avatar_url":"https://github.com/arsho.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Opener\n\n[![Build Status](https://travis-ci.org/arsho/opener.svg?branch=master)](https://travis-ci.org/arsho/opener)\n[![codecov](https://codecov.io/gh/arsho/opener/branch/master/graph/badge.svg)](https://codecov.io/gh/arsho/opener)\n![PyPI](https://img.shields.io/pypi/v/opener)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/opener)\n![Lines of code](https://img.shields.io/tokei/lines/github/arsho/opener)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/arsho/opener)\n![GitHub contributors](https://img.shields.io/github/contributors/arsho/opener)\n![PyPI - License](https://img.shields.io/pypi/l/opener)\n\nOpener is a puzzle solver Python package. Currently it solves the *Open the lock* puzzle.\nThe package can be found in the [Python Package Index (PyPI)](https://pypi.org/project/opener/).\n\nThis package can be used on Linux/Unix, Mac OS and Windows systems.\n\n## Features\n\n- Get keys for *Open the lock* puzzle.\n\n## Installation\n\nYou can install the *opener* from [PyPI](https://pypi.org/project/opener/):\n\n```bash\npip install opener\n```\n\nThe *opener* is supported on Python 2.7, as well as Python 3.4 and above.\n\n## How to use\n\n### Example 1\n\n![Three Digits Open the Lock Puzzle Example](https://raw.githubusercontent.com/arsho/opener/master/examples/open_the_lock_example_1.png)\n\nThe above figure outlines a three digits *Open the Lock* puzzle. A valid unlock key of the above puzzle is: `679`\n\n[example_1.py](https://github.com/arsho/opener/blob/master/examples/example_1.py) shows how to use [opener](https://pypi.org/project/opener/) package to solve the above puzzle.\n\n\nSolution of the above *Open the lock* puzzle:\n\n```python\nfrom opener import get_keys\n\nnumber_of_positions = 3\ninvalid_digits = (5, 2, 3)\nsimilarity_conditions = (\n    ([9, 6, 4], 2),\n    ([2, 8, 6], 1),\n    ([1, 4, 7], 1),\n    ([1, 8, 9], 1)\n)\ninvalid_positioned_values = ((9, 1), (6, 8, 4), (4, 6, 7))\nvalid_positioned_values = ((1,), (8,), (9,))\nunlock_keys = get_keys(number_of_positions,\n                       similarity_conditions,\n                       invalid_digits,\n                       invalid_positioned_values,\n                       valid_positioned_values)\nfor key in unlock_keys:\n    print(key)\n    # 679\n ```\n\n### Example 2\n\n![Four Digits Open the Lock Puzzle Example](https://raw.githubusercontent.com/arsho/opener/master/examples/open_the_lock_example_2.png)\n\nThe above figure outlines another *Open the Lock* puzzle with four digits combination. A valid unlock key of the above puzzle is: `9876`\n\n[example_2.py](https://github.com/arsho/opener/blob/master/examples/example_2.py) shows how to use [opener](https://pypi.org/project/opener/) package to solve the above puzzle.\n\n\nSolution of the above *Open the lock* puzzle:\n\n```python\nfrom opener import get_keys\n\nnumber_of_positions = 4\ninvalid_digits = (5, 1, 2, 4)\nsimilarity_conditions = (\n    ([3, 5, 4, 8], 1),\n    ([4, 6, 7, 1], 2),\n    ([3, 7, 8, 1], 2),\n    ([8, 3, 9, 7], 3),\n    ([2, 9, 3, 4], 1),\n    ([5, 1, 3, 6], 1),\n)\ninvalid_positioned_values = ((3, 8, 2), (5, 7, 3, 9),\n                             (4, 8, 9, 3), (8, 1, 7, 4))\nvalid_positioned_values = ((5,), (1,), (3,), (6,))\nunlock_keys = get_keys(number_of_positions,\n                       similarity_conditions,\n                       invalid_digits,\n                       invalid_positioned_values,\n                       valid_positioned_values)\nfor key in unlock_keys:\n    print(key)\n    # 9876\n\n ```\n\n\n## Authors\n- Maintainer: [Ahmedur Rahman Shovon](https://arshovon.com/)\n- Please see the [list of contributors](https://github.com/arsho/opener/graphs/contributors) to find the contributors of this project.\n\n\n \n## Contribute\n\nContributions are welcome from the community. Questions can be asked on the\n[issues page](https://github.com/arsho/opener/issues). Before creating a new issue, please take a moment to search\nand make sure a similar issue does not already exist. If one does exist, you\ncan comment (most simply even with just a `:+1:`) to show your support for that\nissue.\n\nIf you have direct contributions you would like considered for incorporation\ninto the project you can [fork this repository](https://github.com/arsho/opener) and\n[submit a pull request](https://github.com/arsho/opener/pulls) for review.\n\nPlease read the [development guideline](Development.md) before contribution.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farsho%2Fopener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farsho%2Fopener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farsho%2Fopener/lists"}