├── tests
├── __init__.py
└── test_fuzzyfinder.py
├── docs
├── authors.rst
├── history.rst
├── contributing.rst
├── installation.rst
├── fuzzyfinder.rst
├── index.rst
├── usage.rst
├── Makefile
├── make.bat
└── conf.py
├── screenshots
├── pgcli-fuzzy.gif
└── highlight-demo.gif
├── AUTHORS.rst
├── .readthedocs.yml
├── MANIFEST.in
├── tox.ini
├── fuzzyfinder
├── __init__.py
└── main.py
├── .gitignore
├── CHANGELOG.rst
├── .github
└── workflows
│ ├── ci.yml
│ └── publish.yml
├── pyproject.toml
├── Makefile
├── LICENSE
├── CONTRIBUTING.rst
└── README.rst
/tests/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/authors.rst:
--------------------------------------------------------------------------------
1 | .. include:: ../AUTHORS.rst
2 |
--------------------------------------------------------------------------------
/docs/history.rst:
--------------------------------------------------------------------------------
1 | .. include:: ../CHANGELOG.rst
2 |
--------------------------------------------------------------------------------
/docs/contributing.rst:
--------------------------------------------------------------------------------
1 | .. include:: ../CONTRIBUTING.rst
2 |
--------------------------------------------------------------------------------
/screenshots/pgcli-fuzzy.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amjith/fuzzyfinder/HEAD/screenshots/pgcli-fuzzy.gif
--------------------------------------------------------------------------------
/screenshots/highlight-demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amjith/fuzzyfinder/HEAD/screenshots/highlight-demo.gif
--------------------------------------------------------------------------------
/docs/installation.rst:
--------------------------------------------------------------------------------
1 | ============
2 | Installation
3 | ============
4 |
5 | At the command line, run::
6 |
7 | $ pip install fuzzyfinder
8 |
9 |
--------------------------------------------------------------------------------
/docs/fuzzyfinder.rst:
--------------------------------------------------------------------------------
1 | API Reference
2 | =============
3 |
4 | .. automodule:: fuzzyfinder
5 | :members:
6 | :undoc-members:
7 | :show-inheritance:
8 |
--------------------------------------------------------------------------------
/AUTHORS.rst:
--------------------------------------------------------------------------------
1 |
2 | Credits
3 | =======
4 |
5 | Project lead
6 | ------------
7 |
8 | * Amjith Ramanujam
9 |
10 | Contributors
11 | ------------
12 |
13 | * Gokul Soumya
14 | * Luke Murphy
15 | * Matheus Rosa
16 | * Nace Zavrtanik
17 |
--------------------------------------------------------------------------------
/.readthedocs.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 |
3 | build:
4 | os: ubuntu-22.04
5 | tools:
6 | python: "3.10"
7 |
8 | sphinx:
9 | configuration: docs/conf.py
10 |
11 | python:
12 | install:
13 | - method: pip
14 | path: .
15 | extra_requirements:
16 | - dev
17 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include AUTHORS.rst
2 | include CONTRIBUTING.rst
3 | include CHANGELOG.rst
4 | include LICENSE
5 | include README.rst
6 |
7 | recursive-include tests *
8 | recursive-exclude * __pycache__
9 | recursive-exclude * *.py[co]
10 |
11 | recursive-include docs *.rst conf.py Makefile make.bat
12 |
--------------------------------------------------------------------------------
/tox.ini:
--------------------------------------------------------------------------------
1 | [tox]
2 | envlist = py, typing, style
3 |
4 | [testenv]
5 | deps = pytest
6 | coverage
7 | commands = coverage run -m pytest -v tests
8 | coverage report -m
9 |
10 | [testenv:typing]
11 | skip_install = true
12 | deps = mypy
13 | commands = mypy fuzzyfinder/
14 |
15 | [testenv:style]
16 | skip_install = true
17 | deps = ruff
18 | commands = ruff check --fix
19 | ruff format
20 |
21 |
--------------------------------------------------------------------------------
/fuzzyfinder/__init__.py:
--------------------------------------------------------------------------------
1 | # ruff: noqa
2 | import importlib.metadata
3 |
4 | __version__ = importlib.metadata.version("fuzzyfinder")
5 |
6 | __all__ = []
7 |
8 |
9 | from typing import Callable
10 |
11 |
12 | def export(defn: Callable) -> Callable:
13 | """Decorator to explicitly mark functions that are exposed in a lib."""
14 | globals()[defn.__name__] = defn
15 | __all__.append(defn.__name__)
16 | return defn
17 |
18 |
19 | from . import main
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.py[cod]
2 |
3 | # C extensions
4 | *.so
5 |
6 | # Packages
7 | *.egg
8 | *.egg-info
9 | dist
10 | build
11 | eggs
12 | parts
13 | bin
14 | var
15 | sdist
16 | develop-eggs
17 | .installed.cfg
18 | lib
19 | lib64
20 |
21 | # Environments
22 | .venv
23 |
24 | # Installer logs
25 | pip-log.txt
26 |
27 | # Unit test / coverage reports
28 | .coverage
29 | .tox
30 | nosetests.xml
31 | htmlcov
32 |
33 | # Translations
34 | *.mo
35 |
36 | # Mr Developer
37 | .mr.developer.cfg
38 | .project
39 | .pydevproject
40 |
41 | # Complexity
42 | output/*.html
43 | output/*/index.html
44 |
45 | # Sphinx
46 | docs/_build
47 |
48 | # pytest
49 | .cache
50 |
--------------------------------------------------------------------------------
/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | .. :changelog:
2 |
3 | Changelog
4 | =========
5 |
6 | 2.3.0 (2025-04-20)
7 | ------------------
8 |
9 | * Add highlighting feature.
10 | * Add typing.
11 | * Drop official support for Python 3.9 and older.
12 |
13 | 2.2.0 (2024-09-08)
14 | ------------------
15 |
16 | * Modernize the codebase.
17 | * Add a parameter to enable/disable case insensitivity.
18 |
19 | 2.1.0 (2017-01-25)
20 | ------------------
21 |
22 | * Use lookahead regex to find shortest match. (Gokul Soumya)
23 |
24 | 2.0.0 (2017-01-25)
25 | ------------------
26 |
27 | * Case insensitive matching. (Gokul Soumya)
28 | * Add an accessor function for fuzzy find. (Amjith)
29 | * Support integer inputs. (Matheus)
30 |
31 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: fuzzyfinder
2 |
3 | on:
4 | pull_request:
5 | paths-ignore:
6 | - '**.rst'
7 | - 'docs'
8 |
9 | jobs:
10 | test:
11 | runs-on: ubuntu-latest
12 |
13 | strategy:
14 | matrix:
15 | python-version: ["3.10", "3.11", "3.12", "3.13"]
16 |
17 | steps:
18 | - uses: actions/checkout@v4
19 | - uses: astral-sh/setup-uv@v1
20 | with:
21 | version: "latest"
22 |
23 | - name: Set up Python ${{ matrix.python-version }}
24 | uses: actions/setup-python@v5
25 | with:
26 | python-version: ${{ matrix.python-version }}
27 |
28 | - name: Run unit tests
29 | run: uvx tox -e py${{ matrix.python-version }}
30 |
31 | - name: Run Typing Checks
32 | run: uvx tox -e typing
33 |
34 | - name: Run Style Checks
35 | run: uvx tox -e style
36 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [project]
2 | name = "fuzzyfinder"
3 | dynamic = ["version"]
4 | description = "Fuzzy Finder implemented in Python."
5 | readme = "README.rst"
6 | requires-python = ">=3.10"
7 | license = { text = "BSD" }
8 | authors = [{ name = "Amjith Ramanujam", email = "amjith.r@gmail.com" }]
9 | urls = { "homepage" = "https://github.com/amjith/fuzzyfinder" }
10 |
11 | [project.optional-dependencies]
12 | dev = [
13 | "coverage>=7.2.7",
14 | "pytest>=7.4.4",
15 | "pytest-cov>=4.1.0",
16 | "pdbpp>=0.10.3",
17 | "ruff>=0.11.1",
18 | "sphinx>=8.1.3",
19 | "sphinx-rtd-theme>=3.0.2",
20 | "mypy>=1.15.0",
21 | ]
22 |
23 | [build-system]
24 | requires = [
25 | "setuptools>=64.0",
26 | "setuptools-scm>=8;python_version>='3.8'",
27 | "setuptools-scm<8;python_version<'3.8'",
28 | ]
29 | build-backend = "setuptools.build_meta"
30 |
31 | [tool.setuptools_scm]
32 |
33 | [tool.setuptools.packages.find]
34 | exclude = ["screenshots"]
35 |
36 | [tool.ruff]
37 | line-length = 140
38 | exclude = ["docs"]
39 |
40 | [tool.mypy]
41 | python_version = "3.10"
42 | files = "fuzzyfinder"
43 | disallow_untyped_defs = true
44 | warn_return_any = true
45 | warn_unused_ignores = true
46 | warn_unused_configs = true
47 | warn_unreachable = true
48 | pretty = true
49 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | .PHONY: help clean clean-build clean-pyc clean-test test docs
2 |
3 | help:
4 | @echo "clean - remove all artifacts"
5 | @echo "clean-build - remove build artifacts"
6 | @echo "clean-pyc - remove Python file artifacts"
7 | @echo "clean-test - remove test, coverage, typing and formatting artifacts"
8 | @echo "test - test with coverage and pytest, check types with mypy, format with ruff"
9 | @echo "docs - generate Sphinx HTML documentation, including API docs"
10 |
11 | clean: clean-build clean-pyc clean-test
12 |
13 | clean-build:
14 | rm -fr build/
15 | rm -fr dist/
16 | rm -fr .eggs/
17 | find . -name '*.egg-info' -exec rm -fr {} +
18 | # Directory .tox/, if it exists, contains subdirectories ending with
19 | # "egg", so we need to exclude it from the search.
20 | find . -name '*.egg' -prune -name ".tox" -exec rm -f {} +
21 |
22 | clean-pyc:
23 | find . -name '*.pyc' -exec rm -f {} +
24 | find . -name '*.pyo' -exec rm -f {} +
25 | find . -name '*~' -exec rm -f {} +
26 | find . -name '__pycache__' -exec rm -fr {} +
27 |
28 | clean-test:
29 | rm -fr .tox/
30 | rm -f .coverage
31 | rm -fr htmlcov/
32 | rm -fr .pytest_cache/
33 | rm -fr .mypy_cache/
34 | rm -fr .ruff_cache/
35 |
36 | test:
37 | tox
38 |
39 | docs:
40 | sphinx-apidoc -o docs/ fuzzyfinder
41 | rm docs/modules.rst
42 | $(MAKE) -C docs clean
43 | $(MAKE) -C docs html
44 | open docs/_build/html/index.html
45 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015, Amjith Ramanujam
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5 |
6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 |
8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9 |
10 | * Neither the name of fuzzyfinder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11 |
12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/docs/index.rst:
--------------------------------------------------------------------------------
1 | .. fuzzyfinder documentation master file, created by
2 | sphinx-quickstart on Tue Jul 9 22:26:36 2013.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | Welcome to fuzzyfinder's documentation!
7 | =======================================
8 |
9 | .. image:: https://img.shields.io/pypi/v/fuzzyfinder.svg
10 | :target: https://pypi.python.org/pypi/fuzzyfinder
11 |
12 | .. image:: https://img.shields.io/badge/github-fuzzyfinder-brightgreen?logo=github
13 | :alt: GitHub Badge
14 | :target: https://github.com/amjith/fuzzyfinder
15 |
16 |
17 | **fuzzyfinder** is a fuzzy finder implemented in Python. It matches partial
18 | string entries from a list of strings, and works similar to the fuzzy finder in
19 | SublimeText and Vim's Ctrl-P plugin.
20 |
21 | .. image:: https://raw.githubusercontent.com/amjith/fuzzyfinder/master/screenshots/highlight-demo.gif
22 |
23 | Some notable features of fuzzyfinder are:
24 |
25 | * **Simple**, easy to understand code.
26 | * **No external dependencies**, just the Python standard library.
27 |
28 | An in-depth overview of the algorithm behind fuzzyfinder is available in
29 | `this blog post`__.
30 |
31 | __ http://blog.amjith.com/fuzzyfinder-in-10-lines-of-python
32 |
33 |
34 | .. toctree::
35 | :maxdepth: 3
36 | :caption: User Guide
37 |
38 | installation
39 | usage
40 | fuzzyfinder
41 |
42 | .. toctree::
43 | :maxdepth: 2
44 | :caption: Development
45 |
46 | contributing
47 | authors
48 |
49 | .. toctree::
50 | :maxdepth: 2
51 | :caption: Versions
52 |
53 | history
54 |
55 |
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Publish Python Package
2 |
3 | on:
4 | release:
5 | types: [created]
6 |
7 | permissions:
8 | contents: read
9 |
10 | jobs:
11 | test:
12 | runs-on: ubuntu-latest
13 |
14 | strategy:
15 | matrix:
16 | python-version: ["3.10", "3.11", "3.12", "3.13"]
17 |
18 | steps:
19 | - uses: actions/checkout@v4
20 | - uses: astral-sh/setup-uv@v1
21 | with:
22 | version: "latest"
23 |
24 | - name: Set up Python ${{ matrix.python-version }}
25 | uses: actions/setup-python@v5
26 | with:
27 | python-version: ${{ matrix.python-version }}
28 |
29 | - name: Run unit tests
30 | run: uvx tox -e py${{ matrix.python-version }}
31 |
32 | - name: Run Typing Checks
33 | run: uvx tox -e typing
34 |
35 | - name: Run Style Checks
36 | run: uvx tox -e style
37 |
38 | build:
39 | runs-on: ubuntu-latest
40 | needs: [test]
41 |
42 | steps:
43 | - uses: actions/checkout@v4
44 | - uses: astral-sh/setup-uv@v1
45 | with:
46 | version: "latest"
47 |
48 | - name: Set up Python
49 | uses: actions/setup-python@v5
50 | with:
51 | python-version: '3.13'
52 |
53 | - name: Install dependencies
54 | run: uv sync -p 3.13
55 |
56 | - name: Build
57 | run: uv build
58 |
59 | - name: Store the distribution packages
60 | uses: actions/upload-artifact@v4
61 | with:
62 | name: python-packages
63 | path: dist/
64 |
65 | publish:
66 | name: Publish to PyPI
67 | runs-on: ubuntu-latest
68 | if: startsWith(github.ref, 'refs/tags/')
69 | needs: [build]
70 | environment: release
71 | permissions:
72 | id-token: write
73 | steps:
74 | - name: Download distribution packages
75 | uses: actions/download-artifact@v4
76 | with:
77 | name: python-packages
78 | path: dist/
79 | - name: Publish to PyPI
80 | uses: pypa/gh-action-pypi-publish@release/v1
81 |
--------------------------------------------------------------------------------
/CONTRIBUTING.rst:
--------------------------------------------------------------------------------
1 | ============
2 | Contributing
3 | ============
4 |
5 | Contributions are welcome, and they are greatly appreciated! Every
6 | little bit helps, and credit will always be given.
7 |
8 | You can contribute in many ways:
9 |
10 | Types of contributions
11 | ----------------------
12 |
13 | Report bugs
14 | ~~~~~~~~~~~
15 |
16 | Report bugs at https://github.com/amjith/fuzzyfinder/issues.
17 |
18 | If you are reporting a bug, please include:
19 |
20 | * Your operating system name and version.
21 | * Any details about your local setup that might be helpful in troubleshooting.
22 | * Detailed steps to reproduce the bug.
23 |
24 | Fix bugs
25 | ~~~~~~~~
26 |
27 | Look through the GitHub issues for bugs. Anything tagged with `bug`
28 | is open to whomever wants to implement it.
29 |
30 | Implement features
31 | ~~~~~~~~~~~~~~~~~~
32 |
33 | Look through the GitHub issues for features. Anything tagged with `feature`
34 | is open to whomever wants to implement it.
35 |
36 | Write documentation
37 | ~~~~~~~~~~~~~~~~~~~
38 |
39 | fuzzyfinder could always use more documentation, whether as part of the
40 | official fuzzyfinder docs, in docstrings, or even on the web in blog posts,
41 | articles, and such.
42 |
43 | Submit feedback
44 | ~~~~~~~~~~~~~~~
45 |
46 | The best way to send feedback is to file an issue at https://github.com/amjith/fuzzyfinder/issues.
47 |
48 | Get started!
49 | ------------
50 |
51 | Ready to contribute? Here's how to set up `fuzzyfinder` for local development.
52 |
53 | 1. Fork the `fuzzyfinder` repo on GitHub.
54 | 2. Clone your fork locally::
55 |
56 | $ git clone git@github.com:your_name_here/fuzzyfinder.git
57 |
58 | 3. Create a branch for local development::
59 |
60 | $ git checkout -b name-of-your-bugfix-or-feature
61 |
62 | Now you can make your changes locally.
63 |
64 | 4. When you're done making changes, check that your changes pass the tests and
65 | type checks, and respect the project's code style. This project uses ``tox``
66 | for running tests on multiple versions of Python (with ``pytest`` and
67 | ``coverage``), for type checking (with ``mypy``), and for formatting (with
68 | ``ruff``)::
69 |
70 | $ pip install tox
71 | $ tox -e py310,py311,py312,py313 # add any other supported versions
72 | $ tox -e typing
73 | $ tox -e style
74 |
75 | 5. Commit your changes and push your branch to GitHub::
76 |
77 | $ git add .
78 | $ git commit -m "Your detailed description of your changes."
79 | $ git push origin name-of-your-bugfix-or-feature
80 |
81 | 6. Submit a pull request through the GitHub website.
82 |
--------------------------------------------------------------------------------
/README.rst:
--------------------------------------------------------------------------------
1 | ===========
2 | fuzzyfinder
3 | ===========
4 |
5 | .. image:: https://img.shields.io/pypi/v/fuzzyfinder.svg
6 | :target: https://pypi.python.org/pypi/fuzzyfinder
7 |
8 | .. image:: https://img.shields.io/badge/github-fuzzyfinder-brightgreen?logo=github
9 | :alt: GitHub Badge
10 | :target: https://github.com/amjith/fuzzyfinder
11 |
12 | .. image:: https://img.shields.io/badge/docs-fuzzyfinder-hotpink?logo=readthedocs&logoColor=white
13 | :alt: ReadTheDocs Badge
14 | :target: https://fuzzyfinder.readthedocs.io/
15 |
16 |
17 | **fuzzyfinder** is a fuzzy finder implemented in Python. It matches partial
18 | string entries from a list of strings, and works similar to the fuzzy finder in
19 | SublimeText and Vim's Ctrl-P plugin.
20 |
21 | .. image:: https://raw.githubusercontent.com/amjith/fuzzyfinder/master/screenshots/highlight-demo.gif
22 |
23 | Some notable features of fuzzyfinder are:
24 |
25 | * **Simple**, easy to understand code.
26 | * **No external dependencies**, just the Python standard library.
27 |
28 | An in-depth overview of the algorithm behind fuzzyfinder is available in
29 | `this blog post`__.
30 |
31 | __ http://blog.amjith.com/fuzzyfinder-in-10-lines-of-python
32 |
33 | Quick Start
34 | -----------
35 |
36 | Installation
37 | ^^^^^^^^^^^^
38 | ::
39 |
40 | $ pip install fuzzyfinder
41 |
42 | Usage
43 | ^^^^^
44 |
45 | .. code:: python
46 |
47 | >>> from fuzzyfinder import fuzzyfinder
48 |
49 | >>> suggestions = fuzzyfinder('abc', ['acb', 'defabca', 'abcd', 'aagbec', 'xyz', 'qux'])
50 | >>> list(suggestions)
51 | ['abcd', 'defabca', 'aagbec']
52 |
53 | >>> # Use a user-defined function to obtain the string against which fuzzy matching is done
54 | >>> collection = ['aa bbb', 'aca xyz', 'qx ala', 'xza az', 'bc aa', 'xy abca']
55 | >>> suggestions = fuzzyfinder('aa', collection, accessor=lambda x: x.split()[1])
56 | >>> list(suggestions)
57 | ['bc aa', 'qx ala', 'xy abca']
58 |
59 | >>> # With the appropriate accessor you can pass non-string collections, too
60 | >>> collection = [1234, 5678, 7537, 888, 57, 77]
61 | >>> suggestions = fuzzyfinder('57', collection, accessor=str)
62 | >>> list(suggestions)
63 | [57, 5678, 7537]
64 |
65 | >>> # Make filtering case-sensitive
66 | >>> collection = ['bAB', 'aaB', 'Aab', 'xyz', 'adb', 'aAb']
67 | >>> suggestions = fuzzyfinder('Ab', collection, ignore_case=False)
68 | >>> list(suggestions)
69 | ['aAb', 'Aab']
70 |
71 | >>> # By default, elements with matches of same rank are sorted alpha-numerically
72 | >>> suggestions = fuzzyfinder('aa', ['aac', 'aaa', 'aab', 'xyz', 'ada'])
73 | >>> list(suggestions)
74 | ['aaa', 'aab', 'aac', 'ada']
75 |
76 | >>> # Preserve original order of elements if matches have same rank
77 | >>> suggestions = fuzzyfinder('aa', ['aac', 'aaa', 'aab', 'xyz', 'ada'], sort_results=False)
78 | >>> list(suggestions)
79 | ['aac', 'aaa', 'aab', 'ada']
80 |
81 | >>> # Highlight matching substrings when printing to the terminal
82 | >>> collection = ['apple', 'banana', 'grape', 'orange', 'pineapple']
83 | >>> suggestions = fuzzyfinder('ape', collection, highlight=True)
84 | >>> list(suggestions)
85 | ['gr\x1b[42mape\x1b[0m', '\x1b[42map\x1b[0mpl\x1b[42me\x1b[0m', 'pine\x1b[42map\x1b[0mpl\x1b[42me\x1b[0m']
86 |
87 | >>> # Custom highlighting (use with ANSI, HTML, etc.)
88 | >>> parentheses = '(', ')'
89 | >>> suggestions = fuzzyfinder('ape', collection, highlight=parentheses)
90 | >>> list(suggestions)
91 | ['gr(ape)', '(ap)pl(e)', 'pine(ap)pl(e)']
92 |
93 | Similar Projects
94 | ----------------
95 |
96 | * https://github.com/seatgeek/thefuzz - Fuzzy matching and auto-correction using levenshtein distance.
97 |
--------------------------------------------------------------------------------
/docs/usage.rst:
--------------------------------------------------------------------------------
1 | =====
2 | Usage
3 | =====
4 |
5 | Start by importing :code:`fuzzyfinder` from the fuzzyfinder package:
6 |
7 | .. code:: python
8 |
9 | >>> from fuzzyfinder import fuzzyfinder
10 |
11 | Standard usage
12 | --------------
13 |
14 | In the standard use case, fuzzyfinder looks for ocurrences of the input string
15 | in the elements of a collection. For an element to match, it must contain the
16 | entire input string, with all of its characters in the same order, but not
17 | necessarily adjacent to each other.
18 |
19 | .. code:: python
20 |
21 | >>> suggestions = fuzzyfinder('abc', ['acb', 'defabca', 'abcd', 'aagbec', 'xyz', 'qux'])
22 | >>> list(suggestions)
23 | ['abcd', 'defabca', 'aagbec']
24 |
25 | Custom matching
26 | ---------------
27 |
28 | By passing the :code:`accessor` keyword argument, you can influence how the
29 | fuzzy matching is done. The accessor must be a function which returns a string.
30 | This accessor function is used on each element of the collection, with the
31 | resulting strings being used for the fuzzy matching instead of the original
32 | elements.
33 |
34 | Custom string matching
35 | ^^^^^^^^^^^^^^^^^^^^^^
36 |
37 | Only use the second word of the string for matching.
38 |
39 | .. code:: python
40 |
41 | >>> collection = ['aa bbb', 'aca xyz', 'qx ala', 'xza az', 'bc aa', 'xy abca']
42 | >>> suggestions = fuzzyfinder('aa', collection, accessor=lambda x: x.split()[1])
43 | >>> list(suggestions)
44 | ['bc aa', 'qx ala', 'xy abca']
45 |
46 | Matching non-string collections
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 |
49 | Match integers by converting them to strings.
50 |
51 | .. code:: python
52 |
53 | >>> collection = [1234, 5678, 7537, 888, 57, 77]
54 | >>> suggestions = fuzzyfinder('57', collection, accessor=str)
55 | >>> list(suggestions)
56 | [57, 5678, 7537]
57 |
58 | .. note::
59 | Suggestions retain their original types.
60 |
61 | Case-sensitive matching
62 | -----------------------
63 |
64 | By deafult, fuzzyfinder performs case-insensitive matching. To perform matching
65 | that respects the case, you can pass :literal:`False` to the
66 | :code:`ignore_case` keyword argument.
67 |
68 | .. code:: python
69 |
70 | >>> collection = ['bAB', 'aaB', 'Aab', 'xyz', 'adb', 'aAb']
71 | >>> suggestions = fuzzyfinder('Ab', collection, ignore_case=False)
72 | >>> list(suggestions)
73 | ['aAb', 'Aab']
74 |
75 | Preserving original order
76 | -------------------------
77 |
78 | By default, if several elements have matches of the same rank, fuzzyfinder
79 | sorts those elements *alpha-numerically*. If you want to preserve the original
80 | order of elements with matches of the same rank, you can pass :literal:`False`
81 | to the :code:`sort_results` keyword argument.
82 |
83 | .. code:: python
84 |
85 | >>> collection = ['aac', 'aaa', 'aba', 'xyz', 'ada']
86 |
87 | >>> # Alpha-numerically sort elements if matches have same rank (default)
88 | >>> suggestions = fuzzyfinder('aa', collection)
89 | >>> list(suggestions)
90 | ['aaa', 'aac', 'aba', 'ada']
91 |
92 | >>> # Preserve original order of elements if matches have same rank
93 | >>> suggestions = fuzzyfinder('aa', collection, sort_results=False)
94 | >>> list(suggestions)
95 | ['aac', 'aaa', 'aba', 'ada']
96 |
97 | Highlighting matches
98 | --------------------
99 |
100 | When displaying fuzzyfinder's suggestions, it is often convenient do visually
101 | emphasize the matched substring within each suggestion. You can control such
102 | behavior with the :code:`highlight` keyword argment.
103 |
104 | .. note::
105 | Highlighting only works for collections of strings.
106 |
107 | Highlighting in the terminal
108 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109 |
110 | In the terminal, characters are highlighted using ANSI escape codes. They are
111 | inserted into individual suggestion strings, and are rendered as colors when
112 | the string is printed.
113 |
114 | By passing :literal:`True` to the :code:`highlight` keyword argument, the
115 | matching substring will be highlighted in the default color (*green*).
116 |
117 | .. code:: python
118 |
119 | >>> collection = ['apple', 'banana', 'grape', 'orange', 'pineapple']
120 | >>> suggestions = fuzzyfinder('ape', collection, highlight=True)
121 | >>> # Print individual elements to render highlights
122 | >>> list(suggestions)
123 | ['gr\x1b[42mape\x1b[0m', '\x1b[42map\x1b[0mpl\x1b[42me\x1b[0m', 'pine\x1b[42map\x1b[0mpl\x1b[42me\x1b[0m']
124 |
125 | Alternatively, you can pass a string argument, which will apply highlights of
126 | the corresponding color. Accepted values are ``'red'``, ``'green'``,
127 | ``'yellow'``, ``'blue'``, ``'magenta'``, and ``'cyan'``.
128 |
129 | For more flexibility, see the next subsection.
130 |
131 | Custom highlighting
132 | ^^^^^^^^^^^^^^^^^^^
133 |
134 | You can apply custom highlighting by passing to the :code:`highlight` keyword
135 | argument, as a :code:`tuple`, a prefix-suffix pair. The prefix and suffix are
136 | prepended and appended to contiguous matching substring chunks, and can range
137 | from anything like parentheses or ANSI escape codes to HTML tags with class or
138 | style attributes.
139 |
140 | Parentheses
141 | """""""""""
142 |
143 | .. code:: python
144 |
145 | >>> collection = ['apple', 'banana', 'grape', 'orange', 'pineapple']
146 | >>> parentheses = '(', ')'
147 | >>> suggestions = fuzzyfinder('ape', collection, highlight=parentheses)
148 | >>> list(suggestions)
149 | ['gr(ape)', '(ap)pl(e)', 'pine(ap)pl(e)']
150 |
151 | ANSI
152 | """"
153 |
154 | .. code:: python
155 |
156 | >>> collection = ['apple', 'banana', 'grape', 'orange', 'pineapple']
157 | >>> bold_with_peach_bg = "\033[48;5;209m\033[1m", "\033[0m"
158 | >>> suggestions = fuzzyfinder('ape', collection, highlight=bold_with_peach_bg)
159 | >>> list(suggestions)
160 | ['gr\x1b[48;5;209m\x1b[1mape\x1b[0m', '\x1b[48;5;209m\x1b[1map\x1b[0mpl\x1b[48;5;209m\x1b[1me\x1b[0m', 'pine\x1b[48;5;209m\x1b[1map\x1b[0mpl\x1b[48;5;209m\x1b[1me\x1b[0m']
161 |
162 | HTML
163 | """"
164 |
165 | .. code:: python
166 |
167 | >>> collection = ['apple', 'banana', 'grape', 'orange', 'pineapple']
168 | >>> html_class = '', ''
169 | >>> suggestions = fuzzyfinder('ape', collection, highlight=html_class)
170 | >>> list(suggestions)
171 | ['grape', 'apple', 'pineapple']
172 |
--------------------------------------------------------------------------------
/tests/test_fuzzyfinder.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | """
5 | test_fuzzyfinder
6 | ----------------------------------
7 |
8 | Tests for `fuzzyfinder` module.
9 | """
10 |
11 | import pytest
12 | from fuzzyfinder import fuzzyfinder
13 |
14 |
15 | @pytest.fixture
16 | def collection():
17 | return [
18 | "migrations.py",
19 | "django_migrations.py",
20 | "django_admin_log.py",
21 | "api_user.doc",
22 | "user_group.doc",
23 | "users.txt",
24 | "accounts.txt",
25 | "123.py",
26 | "test123test.py",
27 | ]
28 |
29 |
30 | @pytest.fixture
31 | def cased_collection():
32 | return [
33 | "MIGRATIONS.py",
34 | "django_MiGRations.py",
35 | "django_admin_log.py",
36 | "migrations.doc",
37 | "user_group.doc",
38 | "users.txt",
39 | ]
40 |
41 |
42 | @pytest.fixture
43 | def dict_collection():
44 | return [
45 | {"name": "migrations.py"},
46 | {"name": "django_migrations.py"},
47 | {"name": "django_admin_log.py"},
48 | {"name": "api_user.doc"},
49 | {"name": "user_group.doc"},
50 | {"name": "users.txt"},
51 | {"name": "accounts.txt"},
52 | ]
53 |
54 |
55 | @pytest.fixture
56 | def highlighting_collection():
57 | return ["fuuz", "fuz", "fufuz", "afbcfdzeuffzhijkl", "python"]
58 |
59 |
60 | def test_substring_match(collection):
61 | text = "txt"
62 | results = fuzzyfinder(text, collection)
63 | expected = ["users.txt", "accounts.txt"]
64 | assert list(results) == expected
65 |
66 |
67 | def test_case_insensitive_substring_match(cased_collection):
68 | text = "miGr"
69 | results = fuzzyfinder(text, cased_collection)
70 | expected = ["MIGRATIONS.py", "migrations.doc", "django_MiGRations.py"]
71 | assert list(results) == expected
72 |
73 |
74 | def test_case_sensitive_substring_match(cased_collection):
75 | text = "MiGR"
76 | results = fuzzyfinder(text, cased_collection, ignore_case=False)
77 | expected = ["django_MiGRations.py"]
78 | assert list(results) == expected
79 |
80 |
81 | def test_use_shortest_match_if_matches_overlap():
82 | collection_list = ["fuuz", "fuz", "fufuz"]
83 | text = "fuz"
84 | results = fuzzyfinder(text, collection_list)
85 | expected = ["fuz", "fufuz", "fuuz"]
86 | assert list(results) == expected
87 |
88 |
89 | def test_substring_match_with_dot(collection):
90 | text = ".txt"
91 | results = fuzzyfinder(text, collection)
92 | expected = ["users.txt", "accounts.txt"]
93 | assert list(results) == expected
94 |
95 |
96 | def test_fuzzy_match(collection):
97 | text = "djmi"
98 | results = fuzzyfinder(text, collection)
99 | expected = ["django_migrations.py", "django_admin_log.py"]
100 | assert list(results) == expected
101 |
102 |
103 | def test_fuzzy_match_ranking(collection):
104 | text = "mi"
105 | results = fuzzyfinder(text, collection)
106 | expected = ["migrations.py", "django_migrations.py", "django_admin_log.py"]
107 | assert list(results) == expected
108 |
109 |
110 | def test_fuzzy_match_greedy(collection):
111 | text = "user"
112 | results = fuzzyfinder(text, collection)
113 | expected = ["user_group.doc", "users.txt", "api_user.doc"]
114 | assert list(results) == expected
115 |
116 |
117 | def test_fuzzy_integer_input(collection):
118 | text = 123
119 | results = fuzzyfinder(text, collection)
120 | expected = ["123.py", "test123test.py"]
121 | assert list(results) == expected
122 |
123 |
124 | def test_accessor(dict_collection):
125 | text = "user"
126 | results = fuzzyfinder(text, dict_collection, lambda x: x["name"])
127 | expected = [{"name": "user_group.doc"}, {"name": "users.txt"}, {"name": "api_user.doc"}]
128 | assert list(results) == expected
129 |
130 |
131 | def test_no_alpha_num_sort():
132 | collection = ["zzfuz", "nnfuz", "aafuz", "ttfuz", "wow!", "python"]
133 | text = "fuz"
134 | results = fuzzyfinder(text, collection, sort_results=False)
135 | expected = ["zzfuz", "nnfuz", "aafuz", "ttfuz"]
136 | assert list(results) == expected
137 |
138 |
139 | def test_highlight_boolean_input(highlighting_collection):
140 | text = "fuz"
141 | results = fuzzyfinder(text, highlighting_collection, highlight=True)
142 | expected = [
143 | "\033[42mfuz\033[0m",
144 | "\033[42mfu\033[0mfu\033[42mz\033[0m",
145 | "\033[42mfu\033[0mu\033[42mz\033[0m",
146 | "a\033[42mf\033[0mbcfdze\033[42mu\033[0mff\033[42mz\033[0mhijkl",
147 | ]
148 | assert list(results) == expected
149 |
150 |
151 | @pytest.mark.parametrize(
152 | ("color", "ansi_code"),
153 | [
154 | ("red", "\033[41m"),
155 | ("green", "\033[42m"),
156 | ("yellow", "\033[43m"),
157 | ("blue", "\033[44m"),
158 | ("magenta", "\033[45m"),
159 | ("cyan", "\033[46m"),
160 | ],
161 | )
162 | def test_highlight_string_input(highlighting_collection, color, ansi_code):
163 | text = "fuz"
164 | results = fuzzyfinder(text, highlighting_collection, highlight=color)
165 | expected = [
166 | f"{ansi_code}fuz\033[0m",
167 | f"{ansi_code}fu\033[0mfu{ansi_code}z\033[0m",
168 | f"{ansi_code}fu\033[0mu{ansi_code}z\033[0m",
169 | f"a{ansi_code}f\033[0mbcfdze{ansi_code}u\033[0mff{ansi_code}z\033[0mhijkl",
170 | ]
171 | assert list(results) == expected
172 |
173 |
174 | def test_highlight_ansi_tuple_input(highlighting_collection):
175 | text = "fuz"
176 | bold_with_peach_bg = "\033[48;5;209m\033[1m", "\033[0m"
177 | results = fuzzyfinder(text, highlighting_collection, highlight=bold_with_peach_bg)
178 | expected = [
179 | "\033[48;5;209m\033[1mfuz\033[0m",
180 | "\033[48;5;209m\033[1mfu\033[0mfu\033[48;5;209m\033[1mz\033[0m",
181 | "\033[48;5;209m\033[1mfu\033[0mu\033[48;5;209m\033[1mz\033[0m",
182 | "a\033[48;5;209m\033[1mf\033[0mbcfdze\033[48;5;209m\033[1mu\033[0mff\033[48;5;209m\033[1mz\033[0mhijkl",
183 | ]
184 | assert list(results) == expected
185 |
186 |
187 | def test_highlight_html_tuple_input(highlighting_collection):
188 | text = "fuz"
189 | html_class = "", ""
190 | results = fuzzyfinder(text, highlighting_collection, highlight=html_class)
191 | expected = [
192 | "fuz",
193 | "fufuz",
194 | "fuuz",
195 | "afbcfdzeuffzhijkl",
196 | ]
197 | assert list(results) == expected
198 |
199 |
200 | def test_highlight_case_sensitive(cased_collection):
201 | text = "mi"
202 | parentheses = "(", ")"
203 | results = fuzzyfinder(text, cased_collection, ignore_case=False, highlight=parentheses)
204 | expected = [
205 | "(mi)grations.doc",
206 | "django_ad(mi)n_log.py",
207 | ]
208 | assert list(results) == expected
209 |
--------------------------------------------------------------------------------
/fuzzyfinder/main.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import operator
3 | from typing import Any, Callable, Iterable, Iterator, Optional, Tuple, Union
4 | import re
5 | from . import export
6 |
7 |
8 | COLORS_TO_ANSI = {
9 | "red": "\033[41m",
10 | "green": "\033[42m",
11 | "yellow": "\033[43m",
12 | "blue": "\033[44m",
13 | "magenta": "\033[45m",
14 | "cyan": "\033[46m",
15 | }
16 | ANSI_RESET = "\033[0m"
17 |
18 |
19 | def highlight_substring(
20 | substring: str,
21 | string: str,
22 | highlight: Union[bool, str, Tuple[str, str]],
23 | ignore_case: bool,
24 | ) -> str:
25 | """Apply `highlight` to contiguous chunks of `substring` within `string`."""
26 | assert highlight, "called function when 'highlight' was falsy"
27 | default_highlight = "green"
28 | if highlight is True:
29 | highlight = default_highlight
30 | if isinstance(highlight, str):
31 | if not (ansi_code := COLORS_TO_ANSI.get(highlight.lower())):
32 | raise ValueError(f"highlight, if a string, must be one of: {str(list(COLORS_TO_ANSI)).strip('[]')}")
33 | highlight = ansi_code, ANSI_RESET
34 | assert isinstance(highlight, tuple), "incorrect type for 'highlight'"
35 |
36 | # We apply to the main string, pairwise, styling prefixes and suffixes
37 | # which mark the matched substring. We iterate over both the main string
38 | # and the substring exactly once, and make sure that prefix-suffix pairs
39 | # wrap entire chunks of adjacent matched characters as opposed to each
40 | # character individually.
41 | prefix, suffix = highlight
42 | highlighted_string = ""
43 | # We use an iterator for iterating over the main string. This ensures that:
44 | # (1) for each substring character, we start iteration where we stopped for
45 | # the previous substring character;
46 | # (2) after matching the final substring character, the remainder of the
47 | # main string's characters is preserved within the iterator.
48 | string_iter = iter(string)
49 | unpaired_prefix = False
50 | for substring_char in substring:
51 | for string_char in string_iter:
52 | match = string_char == substring_char
53 | case_insensitive_match = string_char.lower() == substring_char.lower()
54 | if match or (ignore_case and case_insensitive_match):
55 | if not unpaired_prefix:
56 | highlighted_string += prefix
57 | unpaired_prefix = True
58 | highlighted_string += string_char
59 | break
60 | else:
61 | if unpaired_prefix:
62 | highlighted_string += suffix
63 | unpaired_prefix = False
64 | highlighted_string += string_char
65 | # If the final match is between the last characters of both strings,
66 | # a prefix is left unpaired, so we check for it here.
67 | if unpaired_prefix:
68 | highlighted_string += suffix
69 | remainder = "".join(string_iter)
70 | highlighted_string += remainder
71 | return highlighted_string
72 |
73 |
74 | @export
75 | def fuzzyfinder(
76 | input: str,
77 | collection: Iterable[Any],
78 | accessor: Optional[Callable[[Any], str]] = None,
79 | sort_results: bool = True,
80 | ignore_case: bool = True,
81 | highlight: Union[bool, str, Tuple[str, str]] = False,
82 | ) -> Iterator[Any]:
83 | """Filter a collection of objects by fuzzy matching against an input string.
84 |
85 | Args:
86 | input:
87 | A partial string which is typically entered by a user.
88 | collection:
89 | An iterable of objects which will be filtered based on the
90 | ``input``. If the objects are not strings, an appropriate
91 | ``accessor`` keyword argument must be passed.
92 | accessor:
93 | If the ``collection`` is not an iterable of strings, then use the
94 | accessor to fetch the string that will be used for fuzzy matching.
95 | Defaults to the identity function (simply returns the argument it
96 | received as input).
97 | sort_results:
98 | The suggestions are sorted by considering the smallest contiguous
99 | match, followed by where the match is found in the full string. If
100 | two suggestions have the same rank, they are then sorted
101 | alpha-numerically. This parameter controls the
102 | *last tie-breaker-alpha-numeric sorting*. The sorting based on
103 | match length and position will be intact.
104 | Defaults to ``True``.
105 | ignore_case:
106 | If this parameter is set to ``False``, the filtering is
107 | case-sensitive.
108 | Defaults to ``True``.
109 | highlight:
110 | Highlight the matching substrings when printed to the terminal, or
111 | elsewhere.
112 | If ``True``, when printed to the terminal, the matching substrings
113 | will have the default highlight (*green*).
114 | If this parameter is a ``str``, when printed to the terminal, the
115 | matching substrings will be highlighted in the corresponding color.
116 | Accepted values are: ``'red'``, ``'green'``, ``'yellow'``,
117 | ``'blue'``, ``'magenta'``, and ``'cyan'``.
118 | If this parameter is a ``tuple``, it must be a 2-tuple consisting
119 | of a prefix and a suffix string. The prefix and suffix are
120 | prepended and appended to contiguous substring chunks, and can
121 | range from anything like parentheses or ANSI escape codes to HTML
122 | tags with class or style attributes.
123 | Defaults to ``False``.
124 |
125 | Returns:
126 | Iterator[Any]:
127 | A generator object that produces a list of suggestions narrowed
128 | down from ``collection`` using the ``input``.
129 |
130 | Example:
131 | >>> suggestions = fuzzyfinder('abc', ['acb', 'defabca', 'abcd', 'aagbec', 'xyz', 'qux'])
132 | >>> list(suggestions)
133 | ['abcd', 'defabca', 'aagbec']
134 | """
135 | suggestions = []
136 | input = str(input) if not isinstance(input, str) else input
137 | pat = ".*?".join(map(re.escape, input))
138 | pat = "(?=({0}))".format(pat) # lookahead regex to manage overlapping matches
139 | regex = re.compile(pat, re.IGNORECASE if ignore_case else 0)
140 | for item in collection:
141 | accessed_item = item if accessor is None else accessor(item)
142 | r = tuple(regex.finditer(accessed_item))
143 | if r:
144 | best = min(r, key=lambda x: len(x.group(1))) # find shortest match
145 | suggestions.append((len(best.group(1)), best.start(), accessed_item, item))
146 |
147 | if sort_results:
148 | suggestions.sort()
149 | else:
150 | suggestions.sort(key=lambda x: x[:2])
151 | results: Iterator[Any] = map(operator.itemgetter(-1), suggestions)
152 |
153 | if highlight:
154 | results = (highlight_substring(input, result, highlight, ignore_case) for result in results)
155 |
156 | return results
157 |
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line.
5 | SPHINXOPTS =
6 | SPHINXBUILD = sphinx-build
7 | PAPER =
8 | BUILDDIR = _build
9 |
10 | # User-friendly check for sphinx-build
11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13 | endif
14 |
15 | # Internal variables.
16 | PAPEROPT_a4 = -D latex_paper_size=a4
17 | PAPEROPT_letter = -D latex_paper_size=letter
18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19 | # the i18n builder cannot share the environment and doctrees with the others
20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
21 |
22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23 |
24 | help:
25 | @echo "Please use \`make ' where is one of"
26 | @echo " html to make standalone HTML files"
27 | @echo " dirhtml to make HTML files named index.html in directories"
28 | @echo " singlehtml to make a single large HTML file"
29 | @echo " pickle to make pickle files"
30 | @echo " json to make JSON files"
31 | @echo " htmlhelp to make HTML files and a HTML help project"
32 | @echo " qthelp to make HTML files and a qthelp project"
33 | @echo " devhelp to make HTML files and a Devhelp project"
34 | @echo " epub to make an epub"
35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
36 | @echo " latexpdf to make LaTeX files and run them through pdflatex"
37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
38 | @echo " text to make text files"
39 | @echo " man to make manual pages"
40 | @echo " texinfo to make Texinfo files"
41 | @echo " info to make Texinfo files and run them through makeinfo"
42 | @echo " gettext to make PO message catalogs"
43 | @echo " changes to make an overview of all changed/added/deprecated items"
44 | @echo " xml to make Docutils-native XML files"
45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes"
46 | @echo " linkcheck to check all external links for integrity"
47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)"
48 |
49 | clean:
50 | rm -rf $(BUILDDIR)/*
51 |
52 | html:
53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54 | @echo
55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56 |
57 | dirhtml:
58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
59 | @echo
60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
61 |
62 | singlehtml:
63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
64 | @echo
65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
66 |
67 | pickle:
68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
69 | @echo
70 | @echo "Build finished; now you can process the pickle files."
71 |
72 | json:
73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
74 | @echo
75 | @echo "Build finished; now you can process the JSON files."
76 |
77 | htmlhelp:
78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
79 | @echo
80 | @echo "Build finished; now you can run HTML Help Workshop with the" \
81 | ".hhp project file in $(BUILDDIR)/htmlhelp."
82 |
83 | qthelp:
84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
85 | @echo
86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \
87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/fuzzyfinder.qhcp"
89 | @echo "To view the help file:"
90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/fuzzyfinder.qhc"
91 |
92 | devhelp:
93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
94 | @echo
95 | @echo "Build finished."
96 | @echo "To view the help file:"
97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/fuzzyfinder"
98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/fuzzyfinder"
99 | @echo "# devhelp"
100 |
101 | epub:
102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
103 | @echo
104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
105 |
106 | latex:
107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
108 | @echo
109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \
111 | "(use \`make latexpdf' here to do that automatically)."
112 |
113 | latexpdf:
114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
115 | @echo "Running LaTeX files through pdflatex..."
116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf
117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
118 |
119 | latexpdfja:
120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121 | @echo "Running LaTeX files through platex and dvipdfmx..."
122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
124 |
125 | text:
126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
127 | @echo
128 | @echo "Build finished. The text files are in $(BUILDDIR)/text."
129 |
130 | man:
131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
132 | @echo
133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
134 |
135 | texinfo:
136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
137 | @echo
138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
139 | @echo "Run \`make' in that directory to run these through makeinfo" \
140 | "(use \`make info' here to do that automatically)."
141 |
142 | info:
143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
144 | @echo "Running Texinfo files through makeinfo..."
145 | make -C $(BUILDDIR)/texinfo info
146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
147 |
148 | gettext:
149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
150 | @echo
151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
152 |
153 | changes:
154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
155 | @echo
156 | @echo "The overview file is in $(BUILDDIR)/changes."
157 |
158 | linkcheck:
159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
160 | @echo
161 | @echo "Link check complete; look for any errors in the above output " \
162 | "or in $(BUILDDIR)/linkcheck/output.txt."
163 |
164 | doctest:
165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
166 | @echo "Testing of doctests in the sources finished, look at the " \
167 | "results in $(BUILDDIR)/doctest/output.txt."
168 |
169 | xml:
170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
171 | @echo
172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
173 |
174 | pseudoxml:
175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
176 | @echo
177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
178 |
--------------------------------------------------------------------------------
/docs/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | REM Command file for Sphinx documentation
4 |
5 | if "%SPHINXBUILD%" == "" (
6 | set SPHINXBUILD=sphinx-build
7 | )
8 | set BUILDDIR=_build
9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
10 | set I18NSPHINXOPTS=%SPHINXOPTS% .
11 | if NOT "%PAPER%" == "" (
12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
14 | )
15 |
16 | if "%1" == "" goto help
17 |
18 | if "%1" == "help" (
19 | :help
20 | echo.Please use `make ^` where ^ is one of
21 | echo. html to make standalone HTML files
22 | echo. dirhtml to make HTML files named index.html in directories
23 | echo. singlehtml to make a single large HTML file
24 | echo. pickle to make pickle files
25 | echo. json to make JSON files
26 | echo. htmlhelp to make HTML files and a HTML help project
27 | echo. qthelp to make HTML files and a qthelp project
28 | echo. devhelp to make HTML files and a Devhelp project
29 | echo. epub to make an epub
30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
31 | echo. text to make text files
32 | echo. man to make manual pages
33 | echo. texinfo to make Texinfo files
34 | echo. gettext to make PO message catalogs
35 | echo. changes to make an overview over all changed/added/deprecated items
36 | echo. xml to make Docutils-native XML files
37 | echo. pseudoxml to make pseudoxml-XML files for display purposes
38 | echo. linkcheck to check all external links for integrity
39 | echo. doctest to run all doctests embedded in the documentation if enabled
40 | goto end
41 | )
42 |
43 | if "%1" == "clean" (
44 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
45 | del /q /s %BUILDDIR%\*
46 | goto end
47 | )
48 |
49 |
50 | %SPHINXBUILD% 2> nul
51 | if errorlevel 9009 (
52 | echo.
53 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
54 | echo.installed, then set the SPHINXBUILD environment variable to point
55 | echo.to the full path of the 'sphinx-build' executable. Alternatively you
56 | echo.may add the Sphinx directory to PATH.
57 | echo.
58 | echo.If you don't have Sphinx installed, grab it from
59 | echo.http://sphinx-doc.org/
60 | exit /b 1
61 | )
62 |
63 | if "%1" == "html" (
64 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
65 | if errorlevel 1 exit /b 1
66 | echo.
67 | echo.Build finished. The HTML pages are in %BUILDDIR%/html.
68 | goto end
69 | )
70 |
71 | if "%1" == "dirhtml" (
72 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
73 | if errorlevel 1 exit /b 1
74 | echo.
75 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
76 | goto end
77 | )
78 |
79 | if "%1" == "singlehtml" (
80 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
81 | if errorlevel 1 exit /b 1
82 | echo.
83 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
84 | goto end
85 | )
86 |
87 | if "%1" == "pickle" (
88 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
89 | if errorlevel 1 exit /b 1
90 | echo.
91 | echo.Build finished; now you can process the pickle files.
92 | goto end
93 | )
94 |
95 | if "%1" == "json" (
96 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
97 | if errorlevel 1 exit /b 1
98 | echo.
99 | echo.Build finished; now you can process the JSON files.
100 | goto end
101 | )
102 |
103 | if "%1" == "htmlhelp" (
104 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
105 | if errorlevel 1 exit /b 1
106 | echo.
107 | echo.Build finished; now you can run HTML Help Workshop with the ^
108 | .hhp project file in %BUILDDIR%/htmlhelp.
109 | goto end
110 | )
111 |
112 | if "%1" == "qthelp" (
113 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
114 | if errorlevel 1 exit /b 1
115 | echo.
116 | echo.Build finished; now you can run "qcollectiongenerator" with the ^
117 | .qhcp project file in %BUILDDIR%/qthelp, like this:
118 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\fuzzyfinder.qhcp
119 | echo.To view the help file:
120 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\fuzzyfinder.ghc
121 | goto end
122 | )
123 |
124 | if "%1" == "devhelp" (
125 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
126 | if errorlevel 1 exit /b 1
127 | echo.
128 | echo.Build finished.
129 | goto end
130 | )
131 |
132 | if "%1" == "epub" (
133 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
134 | if errorlevel 1 exit /b 1
135 | echo.
136 | echo.Build finished. The epub file is in %BUILDDIR%/epub.
137 | goto end
138 | )
139 |
140 | if "%1" == "latex" (
141 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
142 | if errorlevel 1 exit /b 1
143 | echo.
144 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
145 | goto end
146 | )
147 |
148 | if "%1" == "latexpdf" (
149 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
150 | cd %BUILDDIR%/latex
151 | make all-pdf
152 | cd %BUILDDIR%/..
153 | echo.
154 | echo.Build finished; the PDF files are in %BUILDDIR%/latex.
155 | goto end
156 | )
157 |
158 | if "%1" == "latexpdfja" (
159 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
160 | cd %BUILDDIR%/latex
161 | make all-pdf-ja
162 | cd %BUILDDIR%/..
163 | echo.
164 | echo.Build finished; the PDF files are in %BUILDDIR%/latex.
165 | goto end
166 | )
167 |
168 | if "%1" == "text" (
169 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
170 | if errorlevel 1 exit /b 1
171 | echo.
172 | echo.Build finished. The text files are in %BUILDDIR%/text.
173 | goto end
174 | )
175 |
176 | if "%1" == "man" (
177 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
178 | if errorlevel 1 exit /b 1
179 | echo.
180 | echo.Build finished. The manual pages are in %BUILDDIR%/man.
181 | goto end
182 | )
183 |
184 | if "%1" == "texinfo" (
185 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
186 | if errorlevel 1 exit /b 1
187 | echo.
188 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
189 | goto end
190 | )
191 |
192 | if "%1" == "gettext" (
193 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
194 | if errorlevel 1 exit /b 1
195 | echo.
196 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
197 | goto end
198 | )
199 |
200 | if "%1" == "changes" (
201 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
202 | if errorlevel 1 exit /b 1
203 | echo.
204 | echo.The overview file is in %BUILDDIR%/changes.
205 | goto end
206 | )
207 |
208 | if "%1" == "linkcheck" (
209 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
210 | if errorlevel 1 exit /b 1
211 | echo.
212 | echo.Link check complete; look for any errors in the above output ^
213 | or in %BUILDDIR%/linkcheck/output.txt.
214 | goto end
215 | )
216 |
217 | if "%1" == "doctest" (
218 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
219 | if errorlevel 1 exit /b 1
220 | echo.
221 | echo.Testing of doctests in the sources finished, look at the ^
222 | results in %BUILDDIR%/doctest/output.txt.
223 | goto end
224 | )
225 |
226 | if "%1" == "xml" (
227 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
228 | if errorlevel 1 exit /b 1
229 | echo.
230 | echo.Build finished. The XML files are in %BUILDDIR%/xml.
231 | goto end
232 | )
233 |
234 | if "%1" == "pseudoxml" (
235 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
236 | if errorlevel 1 exit /b 1
237 | echo.
238 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
239 | goto end
240 | )
241 |
242 | :end
243 |
--------------------------------------------------------------------------------
/docs/conf.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | #
4 | # fuzzyfinder documentation build configuration file, created by
5 | # sphinx-quickstart on Tue Jul 9 22:26:36 2013.
6 | #
7 | # This file is execfile()d with the current directory set to its
8 | # containing dir.
9 | #
10 | # Note that not all possible configuration values are present in this
11 | # autogenerated file.
12 | #
13 | # All configuration values have a default; values that are commented out
14 | # serve to show the default.
15 |
16 | import sys
17 | import os
18 | import importlib.metadata
19 |
20 | # If extensions (or modules to document with autodoc) are in another
21 | # directory, add these directories to sys.path here. If the directory is
22 | # relative to the documentation root, use os.path.abspath to make it
23 | # absolute, like shown here.
24 | #sys.path.insert(0, os.path.abspath('.'))
25 |
26 | # Get the project root dir, which is the parent dir of this
27 | cwd = os.getcwd()
28 | project_root = os.path.dirname(cwd)
29 |
30 | # Insert the project root dir as the first element in the PYTHONPATH.
31 | # This lets us ensure that the source package is imported, and that its
32 | # version is used.
33 | sys.path.insert(0, project_root)
34 |
35 | import fuzzyfinder
36 |
37 | # -- General configuration ---------------------------------------------
38 |
39 | # If your documentation needs a minimal Sphinx version, state it here.
40 | #needs_sphinx = '1.0'
41 |
42 | # Add any Sphinx extension module names here, as strings. They can be
43 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
44 | extensions = [
45 | 'sphinx.ext.autodoc',
46 | 'sphinx.ext.autodoc.typehints',
47 | 'sphinx.ext.viewcode',
48 | 'sphinx.ext.napoleon',
49 | ]
50 | autodoc_typehints = 'description'
51 |
52 | # Add any paths that contain templates here, relative to this directory.
53 | templates_path = ['_templates']
54 |
55 | # The suffix of source filenames.
56 | source_suffix = '.rst'
57 |
58 | # The encoding of source files.
59 | #source_encoding = 'utf-8-sig'
60 |
61 | # The master toctree document.
62 | master_doc = 'index'
63 |
64 | # General information about the project.
65 | project = u'fuzzyfinder'
66 | copyright = u'2015, Amjith Ramanujam'
67 |
68 | # The version info for the project you're documenting, acts as replacement
69 | # for |version| and |release|, also used in various other places throughout
70 | # the built documents.
71 | #
72 | # The short X.Y version.
73 | version = fuzzyfinder.__version__
74 | # The full version, including alpha/beta/rc tags.
75 | release = fuzzyfinder.__version__
76 |
77 | # The language for content autogenerated by Sphinx. Refer to documentation
78 | # for a list of supported languages.
79 | #language = None
80 |
81 | # There are two options for replacing |today|: either, you set today to
82 | # some non-false value, then it is used:
83 | #today = ''
84 | # Else, today_fmt is used as the format for a strftime call.
85 | #today_fmt = '%B %d, %Y'
86 |
87 | # List of patterns, relative to source directory, that match files and
88 | # directories to ignore when looking for source files.
89 | exclude_patterns = ['_build']
90 |
91 | # The reST default role (used for this markup: `text`) to use for all
92 | # documents.
93 | #default_role = None
94 |
95 | # If true, '()' will be appended to :func: etc. cross-reference text.
96 | #add_function_parentheses = True
97 |
98 | # If true, the current module name will be prepended to all description
99 | # unit titles (such as .. function::).
100 | #add_module_names = True
101 |
102 | # If true, sectionauthor and moduleauthor directives will be shown in the
103 | # output. They are ignored by default.
104 | #show_authors = False
105 |
106 | # The name of the Pygments (syntax highlighting) style to use.
107 | pygments_style = 'sphinx'
108 |
109 | # A list of ignored prefixes for module index sorting.
110 | #modindex_common_prefix = []
111 |
112 | # If true, keep warnings as "system message" paragraphs in the built
113 | # documents.
114 | #keep_warnings = False
115 |
116 |
117 | # -- Options for HTML output -------------------------------------------
118 |
119 | # The theme to use for HTML and HTML Help pages. See the documentation for
120 | # a list of builtin themes.
121 | html_theme = 'sphinx_rtd_theme'
122 | try:
123 | importlib.metadata.version(html_theme)
124 | except importlib.metadata.PackageNotFoundError:
125 | print(f"HTML theme '{html_theme}' not installed, falling back to 'default'")
126 | html_theme = 'default'
127 |
128 | # Theme options are theme-specific and customize the look and feel of a
129 | # theme further. For a list of options available for each theme, see the
130 | # documentation.
131 | #html_theme_options = {}
132 |
133 | # Add any paths that contain custom themes here, relative to this directory.
134 | #html_theme_path = []
135 |
136 | # The name for this set of Sphinx documents. If None, it defaults to
137 | # " v documentation".
138 | #html_title = None
139 |
140 | # A shorter title for the navigation bar. Default is the same as
141 | # html_title.
142 | #html_short_title = None
143 |
144 | # The name of an image file (relative to this directory) to place at the
145 | # top of the sidebar.
146 | #html_logo = None
147 |
148 | # The name of an image file (within the static path) to use as favicon
149 | # of the docs. This file should be a Windows icon file (.ico) being
150 | # 16x16 or 32x32 pixels large.
151 | #html_favicon = None
152 |
153 | # Add any paths that contain custom static files (such as style sheets)
154 | # here, relative to this directory. They are copied after the builtin
155 | # static files, so a file named "default.css" will overwrite the builtin
156 | # "default.css".
157 | html_static_path = []
158 |
159 | # If not '', a 'Last updated on:' timestamp is inserted at every page
160 | # bottom, using the given strftime format.
161 | #html_last_updated_fmt = '%b %d, %Y'
162 |
163 | # If true, SmartyPants will be used to convert quotes and dashes to
164 | # typographically correct entities.
165 | #html_use_smartypants = True
166 |
167 | # Custom sidebar templates, maps document names to template names.
168 | #html_sidebars = {}
169 |
170 | # Additional templates that should be rendered to pages, maps page names
171 | # to template names.
172 | #html_additional_pages = {}
173 |
174 | # If false, no module index is generated.
175 | #html_domain_indices = True
176 |
177 | # If false, no index is generated.
178 | #html_use_index = True
179 |
180 | # If true, the index is split into individual pages for each letter.
181 | #html_split_index = False
182 |
183 | # If true, links to the reST sources are added to the pages.
184 | #html_show_sourcelink = True
185 |
186 | # If true, "Created using Sphinx" is shown in the HTML footer.
187 | # Default is True.
188 | #html_show_sphinx = True
189 |
190 | # If true, "(C) Copyright ..." is shown in the HTML footer.
191 | # Default is True.
192 | #html_show_copyright = True
193 |
194 | # If true, an OpenSearch description file will be output, and all pages
195 | # will contain a tag referring to it. The value of this option
196 | # must be the base URL from which the finished HTML is served.
197 | #html_use_opensearch = ''
198 |
199 | # This is the file name suffix for HTML files (e.g. ".xhtml").
200 | #html_file_suffix = None
201 |
202 | # Output file base name for HTML help builder.
203 | htmlhelp_basename = 'fuzzyfinderdoc'
204 |
205 |
206 | # -- Options for LaTeX output ------------------------------------------
207 |
208 | latex_elements = {
209 | # The paper size ('letterpaper' or 'a4paper').
210 | #'papersize': 'letterpaper',
211 |
212 | # The font size ('10pt', '11pt' or '12pt').
213 | #'pointsize': '10pt',
214 |
215 | # Additional stuff for the LaTeX preamble.
216 | #'preamble': '',
217 | }
218 |
219 | # Grouping the document tree into LaTeX files. List of tuples
220 | # (source start file, target name, title, author, documentclass
221 | # [howto/manual]).
222 | latex_documents = [
223 | ('index', 'fuzzyfinder.tex',
224 | u'fuzzyfinder Documentation',
225 | u'Amjith Ramanujam', 'manual'),
226 | ]
227 |
228 | # The name of an image file (relative to this directory) to place at
229 | # the top of the title page.
230 | #latex_logo = None
231 |
232 | # For "manual" documents, if this is true, then toplevel headings
233 | # are parts, not chapters.
234 | #latex_use_parts = False
235 |
236 | # If true, show page references after internal links.
237 | #latex_show_pagerefs = False
238 |
239 | # If true, show URL addresses after external links.
240 | #latex_show_urls = False
241 |
242 | # Documents to append as an appendix to all manuals.
243 | #latex_appendices = []
244 |
245 | # If false, no module index is generated.
246 | #latex_domain_indices = True
247 |
248 |
249 | # -- Options for manual page output ------------------------------------
250 |
251 | # One entry per manual page. List of tuples
252 | # (source start file, name, description, authors, manual section).
253 | man_pages = [
254 | ('index', 'fuzzyfinder',
255 | u'fuzzyfinder Documentation',
256 | [u'Amjith Ramanujam'], 1)
257 | ]
258 |
259 | # If true, show URL addresses after external links.
260 | #man_show_urls = False
261 |
262 |
263 | # -- Options for Texinfo output ----------------------------------------
264 |
265 | # Grouping the document tree into Texinfo files. List of tuples
266 | # (source start file, target name, title, author,
267 | # dir menu entry, description, category)
268 | texinfo_documents = [
269 | ('index', 'fuzzyfinder',
270 | u'fuzzyfinder Documentation',
271 | u'Amjith Ramanujam',
272 | 'fuzzyfinder',
273 | 'One line description of project.',
274 | 'Miscellaneous'),
275 | ]
276 |
277 | # Documents to append as an appendix to all manuals.
278 | #texinfo_appendices = []
279 |
280 | # If false, no module index is generated.
281 | #texinfo_domain_indices = True
282 |
283 | # How to display URL addresses: 'footnote', 'no', or 'inline'.
284 | #texinfo_show_urls = 'footnote'
285 |
286 | # If true, do not generate a @detailmenu in the "Top" node's menu.
287 | #texinfo_no_detailmenu = False
288 |
--------------------------------------------------------------------------------