{"id":27377948,"url":"https://github.com/jusexton/countersign","last_synced_at":"2025-04-13T13:08:58.216Z","repository":{"id":62564986,"uuid":"266245176","full_name":"jusexton/countersign","owner":"jusexton","description":"Countersign is a light-weight python library for generating highly customizable passwords.","archived":false,"fork":false,"pushed_at":"2020-11-24T23:30:17.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T13:08:55.492Z","etag":null,"topics":["library","passphrase-generator","password-generator"],"latest_commit_sha":null,"homepage":"","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/jusexton.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-05-23T02:05:22.000Z","updated_at":"2020-11-24T23:30:20.000Z","dependencies_parsed_at":"2022-11-03T16:15:22.312Z","dependency_job_id":null,"html_url":"https://github.com/jusexton/countersign","commit_stats":null,"previous_names":["jsextonn/countersign"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jusexton%2Fcountersign","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jusexton%2Fcountersign/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jusexton%2Fcountersign/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jusexton%2Fcountersign/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jusexton","download_url":"https://codeload.github.com/jusexton/countersign/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717241,"owners_count":21150389,"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":["library","passphrase-generator","password-generator"],"created_at":"2025-04-13T13:08:57.602Z","updated_at":"2025-04-13T13:08:58.208Z","avatar_url":"https://github.com/jusexton.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Countersign\n![](https://github.com/jsextonn/countersign/workflows/build/badge.svg)\n\n`countersign - A signal or password given in reply to a soldier on guard.`\n\nCountersign is a light-weight python library for generating highly customizable passwords. \n\n## Installation\n\nRequires python 3.6 or above\n\n`pip install countersign`\n\n## Usage\n\n### Passwords\nIn countersign terms passwords are simply random character strings that are slightly configurable.\n\nTo generate a random password, import the `password()` function.\n\n```python\nfrom countersign.password import password\n\n# By default, generates some random password using 'string.printable' characters of length 8\ngenerated_password = password()\n```\n\nConfiguration can be accomplished as seen below.\n\n```python\nfrom countersign.password import password\n\n# Generates password of all unique characters using\n# the characters '12345' with a length of 2\ngenerated_password = password(characters='12345', length=2, unique=True)\n```\n\nIf you require multiple random passwords to be generated at a time, use the `passwords()` function. The function returns a python generator that yields an unlimited count of random passwords and can bee configured the same as the `password()` function.\n\n```python\nfrom countersign.password import passwords\n\n# Returns a python generator capable of producing passwords with default characteristics\npassword_generator = passwords()\n```\n\n### Passphrases\nPassphrases are more structured passwords following certain configured patterns and even using given world dictionaries. Completely random passwords are great but sometimes a more human memorable pattern is more ideal.\n\nSimilar to passwords, passphrases can be constructed and configured the same way.\n\n```python\nfrom countersign.passphrase import passphrase\n\nwords = ['Test', 'Word', 'More', 'Words']\n\n# Passphrase using the words [Test, Word, More, Words] with no digit generation strategy. By default the passphrase consists of three given words.\n# Produces something like: WordMoreTest\ngenerated_passphrase = passphrase(words)\n```\n\nPassphrases can also be configured with a digit generation strategy which tells the passphrase generator to inject digit groups wherever specified.\n\n```python\nfrom countersign.passphrase import passphrase, DigitGenerationStrategy, DigitPlacementStrategy\n\nwords = ['Test', 'Word', 'More', 'Words']\n\nstrategy = DigitGenerationStrategy(digit_count=3, placement=DigitPlacementStrategy.AFTER)\n\n# Produces something like: WordWordsTest947\ngenerated_passphrase = passphrase(words, digit_strategy=strategy)\n```\n\nDigit placement strategies include:\n- BEFORE `123TestWords`\n\n- AFTER `TestWords123`\n\n- BEFORE_AND_AFTER `123TestWords123`\n\n- IN_BETWEEN `Test123Words`\n\n- AROUND `123Test123Words123`\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjusexton%2Fcountersign","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjusexton%2Fcountersign","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjusexton%2Fcountersign/lists"}