fuzzquery


Namefuzzquery JSON
Version 24.5.28 PyPI version JSON
download
home_pageNone
SummaryA lightweight package for fuzzy word/phrase searches in a body of text.
upload_time2024-05-30 07:20:28
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords fuzzy string match filter regex
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            fuzzquery 24.5.28
=================

**fuzzquery** is a lightweight package for fuzzy word/phrase searches in a body of text. Tokens are used to determine the number and type of approximations that can be made at a token’s position, within your query.

Installation
------------

To install ``fuzzquery`` use the following command-line: 

.. code-block:: console

  pip install fuzzquery

Documentation
-------------

The official documents can be viewed at `readthedocs <https://fuzzquery.readthedocs.io/>`_.
A version of documents can be viewed by calling python's built-in ``help`` function on any part of the **fuzzquery** package. 

Examples
--------

finditer
++++++++

.. code-block:: python

  import fuzzquery as fq

  data = """ 
  I would classify music as one of my favorite hobbies. 
  I love classical music played by classy musicians for a classic musical. 
  Beethoven can not be out-classed, music-wise - a man of class, musically gifted.
  """
  query = 'class{4} music{5}'
  
  print(f'\n{query.upper()} using skip')
  for span, match in fq.finditer(data, query, skip=('classify', ','), ci=True):
      print(f'  {match}')
      
  print(f'\n{query.upper()} no skip')
  for span, match in fq.finditer(data, query, ci=True):
      print(f'  {match}')

**output:**

.. code-block:: console

  CLASS{4} MUSIC{5}
    classify music
    classical music
    classy musicians
    classic musical
    classed, music-wise
    class, musically

  CLASS{4} MUSIC{5} with skip
    classical music
    classy musicians
    classic musical

iterall
+++++++

.. code-block:: python

  import fuzzquery as fq
  
  data = """ 
  I headed homeward to meet with the Wardens. 
  When I arrived, I was greeted by a homely man that told me the homestead was awarded 5 million dollars.
  We intend to use some of the homage to create a homeless ward. 
  The first piece of furniture will be my late-friend Homer's wardrobe.
  """
  
  queries = ('home{5}', 
             'home{4} ward{4}', 
             '{1}ward{=2}{2}', 
             'hom{6} {4w} wa{=1}{5}')
  
  for query, span, match in fq.iterall(data, queries, ci=True):
      if query: print(f'\n{query.upper()}')
      print(f'  {match}')

**output:**

.. code-block:: console

  HOME{5}
    homeward
    homely
    homestead
    homeless
    Homer's
  
  HOME{4} WARD{4}
    homeless ward
    Homer's wardrobe
  
  {1}WARD{=2}{2}
    Wardens
    awarded
    wardrobe
  
  HOM{6} {4W} WA{=1}{5}
    homeward to meet with the Wardens
    homestead was
    homage to create a homeless ward
    Homer's wardrobe

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "fuzzquery",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Oyster Shucker <onemadgypsy@gmail.com>",
    "keywords": "fuzzy, string, match, filter, regex",
    "author": null,
    "author_email": "Oyster Shucker <onemadgypsy@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2c/b6/f9158879f2047f9f7779c4cb577047f8ddd51bb20b9573570c4d7e0b104d/fuzzquery-24.5.28.tar.gz",
    "platform": null,
    "description": "fuzzquery 24.5.28\r\n=================\r\n\r\n**fuzzquery** is a lightweight package for fuzzy word/phrase searches in a body of text. Tokens are used to determine the number and type of approximations that can be made at a token\u2019s position, within your query.\r\n\r\nInstallation\r\n------------\r\n\r\nTo install ``fuzzquery`` use the following command-line: \r\n\r\n.. code-block:: console\r\n\r\n  pip install fuzzquery\r\n\r\nDocumentation\r\n-------------\r\n\r\nThe official documents can be viewed at `readthedocs <https://fuzzquery.readthedocs.io/>`_.\r\nA version of documents can be viewed by calling python's built-in ``help`` function on any part of the **fuzzquery** package. \r\n\r\nExamples\r\n--------\r\n\r\nfinditer\r\n++++++++\r\n\r\n.. code-block:: python\r\n\r\n  import fuzzquery as fq\r\n\r\n  data = \"\"\" \r\n  I would classify music as one of my favorite hobbies. \r\n  I love classical music played by classy musicians for a classic musical. \r\n  Beethoven can not be out-classed, music-wise - a man of class, musically gifted.\r\n  \"\"\"\r\n  query = 'class{4} music{5}'\r\n  \r\n  print(f'\\n{query.upper()} using skip')\r\n  for span, match in fq.finditer(data, query, skip=('classify', ','), ci=True):\r\n      print(f'  {match}')\r\n      \r\n  print(f'\\n{query.upper()} no skip')\r\n  for span, match in fq.finditer(data, query, ci=True):\r\n      print(f'  {match}')\r\n\r\n**output:**\r\n\r\n.. code-block:: console\r\n\r\n  CLASS{4} MUSIC{5}\r\n    classify music\r\n    classical music\r\n    classy musicians\r\n    classic musical\r\n    classed, music-wise\r\n    class, musically\r\n\r\n  CLASS{4} MUSIC{5} with skip\r\n    classical music\r\n    classy musicians\r\n    classic musical\r\n\r\niterall\r\n+++++++\r\n\r\n.. code-block:: python\r\n\r\n  import fuzzquery as fq\r\n  \r\n  data = \"\"\" \r\n  I headed homeward to meet with the Wardens. \r\n  When I arrived, I was greeted by a homely man that told me the homestead was awarded 5 million dollars.\r\n  We intend to use some of the homage to create a homeless ward. \r\n  The first piece of furniture will be my late-friend Homer's wardrobe.\r\n  \"\"\"\r\n  \r\n  queries = ('home{5}', \r\n             'home{4} ward{4}', \r\n             '{1}ward{=2}{2}', \r\n             'hom{6} {4w} wa{=1}{5}')\r\n  \r\n  for query, span, match in fq.iterall(data, queries, ci=True):\r\n      if query: print(f'\\n{query.upper()}')\r\n      print(f'  {match}')\r\n\r\n**output:**\r\n\r\n.. code-block:: console\r\n\r\n  HOME{5}\r\n    homeward\r\n    homely\r\n    homestead\r\n    homeless\r\n    Homer's\r\n  \r\n  HOME{4} WARD{4}\r\n    homeless ward\r\n    Homer's wardrobe\r\n  \r\n  {1}WARD{=2}{2}\r\n    Wardens\r\n    awarded\r\n    wardrobe\r\n  \r\n  HOM{6} {4W} WA{=1}{5}\r\n    homeward to meet with the Wardens\r\n    homestead was\r\n    homage to create a homeless ward\r\n    Homer's wardrobe\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A lightweight package for fuzzy word/phrase searches in a body of text.",
    "version": "24.5.28",
    "project_urls": {
        "Documentation": "https://fuzzquery.readthedocs.io",
        "Homepage": "https://github.com/OneMadGypsy/fuzzquery",
        "Issues": "https://github.com/OneMadGypsy/fuzzquery/issues"
    },
    "split_keywords": [
        "fuzzy",
        " string",
        " match",
        " filter",
        " regex"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4edc64075aedfab612d831414b0cd666d39faaf7f4135570da1e441145a8f645",
                "md5": "09f99584c33ebd2304cbdc1386aca7b6",
                "sha256": "a8075fa95d1c20586a8b4d3919b1fc6ea13aa9b0f26d29d37793be2dfaf7aac9"
            },
            "downloads": -1,
            "filename": "fuzzquery-24.5.28-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "09f99584c33ebd2304cbdc1386aca7b6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5103,
            "upload_time": "2024-05-30T07:20:26",
            "upload_time_iso_8601": "2024-05-30T07:20:26.064990Z",
            "url": "https://files.pythonhosted.org/packages/4e/dc/64075aedfab612d831414b0cd666d39faaf7f4135570da1e441145a8f645/fuzzquery-24.5.28-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2cb6f9158879f2047f9f7779c4cb577047f8ddd51bb20b9573570c4d7e0b104d",
                "md5": "6bd5a4938c8fb4d4c01ab0588ee67160",
                "sha256": "72dec5b2c621a5137b4ee4c81f7ec42822de878650d5e806c9c1fe17212b97e1"
            },
            "downloads": -1,
            "filename": "fuzzquery-24.5.28.tar.gz",
            "has_sig": false,
            "md5_digest": "6bd5a4938c8fb4d4c01ab0588ee67160",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4985,
            "upload_time": "2024-05-30T07:20:28",
            "upload_time_iso_8601": "2024-05-30T07:20:28.051781Z",
            "url": "https://files.pythonhosted.org/packages/2c/b6/f9158879f2047f9f7779c4cb577047f8ddd51bb20b9573570c4d7e0b104d/fuzzquery-24.5.28.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-30 07:20:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OneMadGypsy",
    "github_project": "fuzzquery",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "fuzzquery"
}
        
Elapsed time: 0.27277s