Skip to main content

A library to index text files, and generate passphrases from them

Project description

funny-passphrase

This is the repository of a library and command line tools to index text files, and generate passphrases from sets of them.

Passphrase generator

The passphrase generator takes one or more sets of indexed text files, and it generates one or more passphrases composed by the number of specified words. The program keeps rotating on the sets, choosing a word from all the words in the indexed files composing the set. being specified

usage: funny-passphrase [-h] --wg WGS [WGS ...] -w WORDS [-n NUM] [-o OUTPUT]

Funny passphrase generator

optional arguments:
  -h, --help            show this help message and exit
  --wg WGS [WGS ...]    The indexed files which integrate this group (default: None)
  -w WORDS, --words WORDS
                        Number of words to generate in each passphrase (default: None)
  -n NUM, --num NUM     Number of passphrases to generate (default: 1)
  -o OUTPUT, --output OUTPUT
                        Output file (default stdout) (default: -)

Text indexer

The indexed text files consumed by the passphrase generator are generated through the text indexer. A indexed text file is a seekable xz file with two streams: the first one is the text itself; and the second stream contains the offsets to the different lines in the text.

usage: fp-indexer [-h] input output

Funny passphrase indexer

positional arguments:
  input       Input file. If the name is '-', standard input will be used
  output      Output file

optional arguments:
  -h, --help  show this help message and exit

Command line usage

Usual pattern is indexing at least one text file (for instance, the list English adjectives and nouns and Spanish adjectives from Wiktionary), and then use the passphrase generator as many times as needed:

wiktionary-fetcher --lang en --terms nouns en-nouns.txt
wiktionary-fetcher --lang en --terms adjectives en-adjectives.txt
wiktionary-fetcher --lang es --terms adjectives es-adjectives.txt

fp-indexer en-nouns.txt en_nouns.txt.xz_idx
fp-indexer en-adjectives.txt en_adjectives.txt.xz_idx
fp-indexer es-adjectives.txt es_adjectives.txt.xz_idx

# Generate 10 passphrases of 6 words each,
# rotating between adjectives and nouns
funny-passphrase --wg en_adjectives.txt.xz_idx es_adjectives.txt.xz_idx --wg en_nouns.txt.xz_idx -w 6 -n 10

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

funny-passphrase-0.2.3.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

funny_passphrase-0.2.3-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file funny-passphrase-0.2.3.tar.gz.

File metadata

  • Download URL: funny-passphrase-0.2.3.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for funny-passphrase-0.2.3.tar.gz
Algorithm Hash digest
SHA256 fbf333e8d909584ee3ecbec5cb1f525f216eb8df35e9a0892e6fcbcc4defb8af
MD5 ac7f32ec252e9420787dca33efe9e267
BLAKE2b-256 5308e4238f72b12772d840f85c76c3a2d196a0157696baed7641dfa797a9ba79

See more details on using hashes here.

File details

Details for the file funny_passphrase-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for funny_passphrase-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e484361afc8498fdfb13476e6bcc3c00f0d795d374c624c386885e2887c39a7c
MD5 bbd42514dfdbfd79337af37e8394100f
BLAKE2b-256 cc1cba5273b5e11515b04d83125e169dd510f7ec43b18f9989f570b648dbd936

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page