py-seo-html


Namepy-seo-html JSON
Version 1.2.1 PyPI version JSON
download
home_pagehttps://github.com/markolofsen/py-seo-html
SummaryPython library for SEO-friendly HTML text processing and keyword linking
upload_time2023-09-08 19:41:41
maintainer
docs_urlNone
authorMark
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. _pyseohtml-documentation:

PySeoHtml Documentation
=======================

Description
-----------

PySeoHtml is a Python library designed to intelligently link specific keywords within HTML text content. It enhances SEO (Search Engine Optimization) strategies by optimizing content with linked keywords, maintaining readability, and preventing over-optimization.

Table of Contents
-----------------

1. `Installation <#installation>`_
2. `How It Works <#how-it-works>`_
    - `Initialization <#initialization>`_
    - `Text Processing <#text-processing>`_
    - `Randomization (Optional) <#randomization-optional>`_
    - `Benefits for SEO <#benefits-for-seo>`_
3. `Usage <#usage>`_
    - `Example <#example>`_
    - `Parameters <#parameters>`_
    - `Result <#result>`_

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

To install PySeoHtml, you can use pip:

.. code-block:: bash

    pip install py-seo-html

Text Processing
---------------

The library processes the HTML text and replaces keywords with links. This process includes tokenization, keyword matching, link insertion, HTML escaping, punctuation handling, and link limitation.

Randomization (Optional)
------------------------

You can choose to place links randomly (if ``random_links`` is set to True), which can help avoid over-optimization penalties from search engines.

Initialization
--------------

To get started, create an instance of the PySeoHtml class by providing the following parameters:

- ``html_text``: The HTML text content you want to process. (Required)
- ``keywords``: A list of keyword-link pairs where each item is a list with the keyword and its associated link. (Required)
- ``density``: The maximum allowed length (in characters) for linked text snippets. (Default: 500)
- ``random_links``: If set to True, the library will randomly choose keywords to link each time. If False, it will consistently link the same keywords. (Default: False)
- ``stemming``: If set to True, keywords are stemmed before processing. (Default: True)
- ``language``: The language to use for stemming. Supported languages include "arabic," "danish," "dutch," "english," "finnish," "french," "german," "hungarian," "italian," "norwegian," "porter," "portuguese," "romanian," "russian," "spanish," and "swedish." (Default: "english")
- ``valid_tags``: A list of HTML tags that are considered valid for keyword linking. (Default: ["p", "h1", "h2", "h3", "h4", "h5", "h6"])

Benefits for SEO
----------------

PySeoHtml offers several benefits for SEO:

- **Keyword Linking:** It automatically identifies and links keywords to relevant URLs within your HTML content, improving search engine understanding and rankings.
- **Content Optimization:** By strategically linking keywords, you can enhance the SEO value of your content and increase its visibility in search results.
- **Prevents Over-Optimization:** The library limits the number of linked keywords to maintain a natural keyword density, helping you avoid SEO penalties.
- **Maintains Readability:** Linked keywords are embedded within readable text snippets, improving the user experience and preventing content from appearing spammy.

Usage
-----

Here's an example of how to use the PySeoHtml library:

Example
-------

.. code-block:: python

    from PySeoHtml import PySeoHtml

    html_text = """
    <h1>Enhance Your SEO with PySeoHtml</h1>
    <p>PySeoHtml is a powerful Python library that can help boost your website's SEO performance. By intelligently linking specific keywords within your content, you can improve search engine rankings and increase organic traffic.</p>
    <p>Here are some examples of keywords you can link:</p>
    <ul>
        <li>Search Engine Optimization</li>
        <li>Keyword Research</li>
        <li>On-Page SEO</li>
        <li>Link Building</li>
    </ul>
    """

    keywords = [
        [["Search Engine Optimization"], "https://example.com/seo"],
        [["Keyword Research"], "https://example.com/keyword-research"],
        [["On-Page SEO"], "https://example.com/on-page-seo"],
        [["Link Building"], "https://example.com/link-building"],
        # Add more keyword-link pairs as needed
    ]

    # Initialize PySeoHtml
    seo_html = PySeoHtml(
        html_text=html_text,
        keywords=keywords,
        density=100,
        random_links=False,
        stemming=True,
        language="english",
        valid_tags=["li", "p", "h1", "h2", "h3", "h4", "h5", "h6"],
    )

    # Generate the processed HTML content
    processed_html = seo_html.make()

    print(processed_html)

Result
------

The ``processed_html`` variable will contain the HTML content with keywords replaced by links. This processed content can be used to enhance SEO strategies.

Thank you!
-----------

Please feel free to reach out if you have any further questions or need additional assistance!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/markolofsen/py-seo-html",
    "name": "py-seo-html",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Mark",
    "author_email": "markolofsen@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d2/46/dcec5f9cb462146292cc2151c6b93b408f31fa65bcd330c632bfb8613582/py-seo-html-1.2.1.tar.gz",
    "platform": null,
    "description": ".. _pyseohtml-documentation:\n\nPySeoHtml Documentation\n=======================\n\nDescription\n-----------\n\nPySeoHtml is a Python library designed to intelligently link specific keywords within HTML text content. It enhances SEO (Search Engine Optimization) strategies by optimizing content with linked keywords, maintaining readability, and preventing over-optimization.\n\nTable of Contents\n-----------------\n\n1. `Installation <#installation>`_\n2. `How It Works <#how-it-works>`_\n    - `Initialization <#initialization>`_\n    - `Text Processing <#text-processing>`_\n    - `Randomization (Optional) <#randomization-optional>`_\n    - `Benefits for SEO <#benefits-for-seo>`_\n3. `Usage <#usage>`_\n    - `Example <#example>`_\n    - `Parameters <#parameters>`_\n    - `Result <#result>`_\n\nInstallation\n------------\n\nTo install PySeoHtml, you can use pip:\n\n.. code-block:: bash\n\n    pip install py-seo-html\n\nText Processing\n---------------\n\nThe library processes the HTML text and replaces keywords with links. This process includes tokenization, keyword matching, link insertion, HTML escaping, punctuation handling, and link limitation.\n\nRandomization (Optional)\n------------------------\n\nYou can choose to place links randomly (if ``random_links`` is set to True), which can help avoid over-optimization penalties from search engines.\n\nInitialization\n--------------\n\nTo get started, create an instance of the PySeoHtml class by providing the following parameters:\n\n- ``html_text``: The HTML text content you want to process. (Required)\n- ``keywords``: A list of keyword-link pairs where each item is a list with the keyword and its associated link. (Required)\n- ``density``: The maximum allowed length (in characters) for linked text snippets. (Default: 500)\n- ``random_links``: If set to True, the library will randomly choose keywords to link each time. If False, it will consistently link the same keywords. (Default: False)\n- ``stemming``: If set to True, keywords are stemmed before processing. (Default: True)\n- ``language``: The language to use for stemming. Supported languages include \"arabic,\" \"danish,\" \"dutch,\" \"english,\" \"finnish,\" \"french,\" \"german,\" \"hungarian,\" \"italian,\" \"norwegian,\" \"porter,\" \"portuguese,\" \"romanian,\" \"russian,\" \"spanish,\" and \"swedish.\" (Default: \"english\")\n- ``valid_tags``: A list of HTML tags that are considered valid for keyword linking. (Default: [\"p\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"])\n\nBenefits for SEO\n----------------\n\nPySeoHtml offers several benefits for SEO:\n\n- **Keyword Linking:** It automatically identifies and links keywords to relevant URLs within your HTML content, improving search engine understanding and rankings.\n- **Content Optimization:** By strategically linking keywords, you can enhance the SEO value of your content and increase its visibility in search results.\n- **Prevents Over-Optimization:** The library limits the number of linked keywords to maintain a natural keyword density, helping you avoid SEO penalties.\n- **Maintains Readability:** Linked keywords are embedded within readable text snippets, improving the user experience and preventing content from appearing spammy.\n\nUsage\n-----\n\nHere's an example of how to use the PySeoHtml library:\n\nExample\n-------\n\n.. code-block:: python\n\n    from PySeoHtml import PySeoHtml\n\n    html_text = \"\"\"\n    <h1>Enhance Your SEO with PySeoHtml</h1>\n    <p>PySeoHtml is a powerful Python library that can help boost your website's SEO performance. By intelligently linking specific keywords within your content, you can improve search engine rankings and increase organic traffic.</p>\n    <p>Here are some examples of keywords you can link:</p>\n    <ul>\n        <li>Search Engine Optimization</li>\n        <li>Keyword Research</li>\n        <li>On-Page SEO</li>\n        <li>Link Building</li>\n    </ul>\n    \"\"\"\n\n    keywords = [\n        [[\"Search Engine Optimization\"], \"https://example.com/seo\"],\n        [[\"Keyword Research\"], \"https://example.com/keyword-research\"],\n        [[\"On-Page SEO\"], \"https://example.com/on-page-seo\"],\n        [[\"Link Building\"], \"https://example.com/link-building\"],\n        # Add more keyword-link pairs as needed\n    ]\n\n    # Initialize PySeoHtml\n    seo_html = PySeoHtml(\n        html_text=html_text,\n        keywords=keywords,\n        density=100,\n        random_links=False,\n        stemming=True,\n        language=\"english\",\n        valid_tags=[\"li\", \"p\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"],\n    )\n\n    # Generate the processed HTML content\n    processed_html = seo_html.make()\n\n    print(processed_html)\n\nResult\n------\n\nThe ``processed_html`` variable will contain the HTML content with keywords replaced by links. This processed content can be used to enhance SEO strategies.\n\nThank you!\n-----------\n\nPlease feel free to reach out if you have any further questions or need additional assistance!\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python library for SEO-friendly HTML text processing and keyword linking",
    "version": "1.2.1",
    "project_urls": {
        "Homepage": "https://github.com/markolofsen/py-seo-html"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "131f6c8c835cce54752faae2312a19b43a0a6d3a75c8e3e2ea4472fa3ef71463",
                "md5": "c4d548a861237d3960d5cc86acf7a28e",
                "sha256": "33cb67f9ccbefe4b4b781b609960c5b0ac96ba072f8cf410371773dbdd9aa614"
            },
            "downloads": -1,
            "filename": "py_seo_html-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c4d548a861237d3960d5cc86acf7a28e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 11257,
            "upload_time": "2023-09-08T19:41:39",
            "upload_time_iso_8601": "2023-09-08T19:41:39.642572Z",
            "url": "https://files.pythonhosted.org/packages/13/1f/6c8c835cce54752faae2312a19b43a0a6d3a75c8e3e2ea4472fa3ef71463/py_seo_html-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d246dcec5f9cb462146292cc2151c6b93b408f31fa65bcd330c632bfb8613582",
                "md5": "ac6450bfcda6ea4847e7c4dfeab52383",
                "sha256": "6813ebe3be8ec213dd3662551abd1bbc73c18b48722a87cd313a860e00b3ee7d"
            },
            "downloads": -1,
            "filename": "py-seo-html-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ac6450bfcda6ea4847e7c4dfeab52383",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 11781,
            "upload_time": "2023-09-08T19:41:41",
            "upload_time_iso_8601": "2023-09-08T19:41:41.907520Z",
            "url": "https://files.pythonhosted.org/packages/d2/46/dcec5f9cb462146292cc2151c6b93b408f31fa65bcd330c632bfb8613582/py-seo-html-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-08 19:41:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "markolofsen",
    "github_project": "py-seo-html",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "py-seo-html"
}
        
Elapsed time: 0.12581s