{"id":15745610,"url":"https://github.com/markolofsen/crosslinker","last_synced_at":"2025-09-05T16:37:57.178Z","repository":{"id":193140977,"uuid":"688204081","full_name":"markolofsen/crosslinker","owner":"markolofsen","description":"CrossLinker: A Python Library for SEO - Friendly HTML Text Processing and Keyword Linking","archived":false,"fork":false,"pushed_at":"2023-09-10T06:20:24.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T03:09:59.138Z","etag":null,"topics":["linker","pypi","python","seo"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/crosslinker/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markolofsen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-06T21:44:36.000Z","updated_at":"2023-09-09T05:10:11.000Z","dependencies_parsed_at":"2024-10-25T03:09:58.163Z","dependency_job_id":"6286dc35-7c4e-4bc3-9b8d-2918dba0e192","html_url":"https://github.com/markolofsen/crosslinker","commit_stats":null,"previous_names":["markolofsen/py-seo-html","markolofsen/crosslinker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markolofsen%2Fcrosslinker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markolofsen%2Fcrosslinker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markolofsen%2Fcrosslinker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markolofsen%2Fcrosslinker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markolofsen","download_url":"https://codeload.github.com/markolofsen/crosslinker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246423726,"owners_count":20774820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linker","pypi","python","seo"],"created_at":"2024-10-04T04:21:10.817Z","updated_at":"2025-03-31T06:13:28.206Z","avatar_url":"https://github.com/markolofsen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# CrossLinker Documentation\n\n## Description\n\nCrossLinker 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\n## Table of Contents\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\n\n## Installation\n\nTo install CrossLinker, you can use pip:\n\n```bash\npip install crosslinker\n```\n\n### Text Processing\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\n### Randomization (Optional)\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\n### Initialization\n\nTo get started, create an instance of the CrossLinker class by providing the following parameters:\n\n| Parameter      | Description                                                                                         | Default Value   |\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.                                 | 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. | False  |\n| `stemming`     | If set to True, keywords are stemmed before processing.                                            | 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.\" | \"english\"  |\n| `valid_tags`   | A list of HTML tags that are considered valid for keyword linking.                                   | [\"p\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"] |\n\n\n### Randomization (Optional)\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\n### Benefits for SEO\nCrossLinker 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\n## Usage\n### Here's an example of how to use the CrossLinker library:\n\n```python\nfrom crosslinker import CrossLinker\n\nhtml_text = \"\"\"\n\u003ch1\u003eEnhance Your SEO with CrossLinker\u003c/h1\u003e\n\u003cp\u003eCrossLinker 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.\u003c/p\u003e\n\u003cp\u003eHere are some examples of keywords you can link:\u003c/p\u003e\n\u003cul\u003e\n    \u003cli\u003eSearch Engine Optimization\u003c/li\u003e\n    \u003cli\u003eKeyword Research\u003c/li\u003e\n    \u003cli\u003eOn-Page SEO\u003c/li\u003e\n    \u003cli\u003eLink Building\u003c/li\u003e\n\u003c/ul\u003e\n\"\"\"\n\nkeywords = [\n    [[\"Search Engine\"], \"https://example.com/seo\"],\n    [[\"Research\"], \"https://example.com/keyword-research\"],\n    [[\"SEO\"], \"https://example.com/on-page-seo\"],\n    [[\"Building\"], \"https://example.com/link-building\"],\n    # Add more keyword-link pairs as needed\n]\n\n# Initialize CrossLinker\nseo_html = CrossLinker(\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\nprocessed_html = seo_html.make()\n\nprint(processed_html)\n```\n\n## Result\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\n```html\n\u003ch1\u003e\n Enhance Your SEO with CrossLinker\n\u003c/h1\u003e\n\u003cp\u003e\n CrossLinker 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\n \u003ca href=\"https://example.com/seo\"\u003e\n  search engine rankings and increase organic traffic\n \u003c/a\u003e\n .\n\u003c/p\u003e\n\u003cp\u003e\n \u003ca href=\"https://example.com/seo\"\u003e\n  Here are some examples\n \u003c/a\u003e\n of keywords you can link:\n\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e\n  Search Engine Optimization\n \u003c/li\u003e\n \u003cli\u003e\n  Keyword Research\n \u003c/li\u003e\n \u003cli\u003e\n  \u003ca href=\"https://example.com/on-page-seo\"\u003e\n   On-Page SEO\n  \u003c/a\u003e\n \u003c/li\u003e\n \u003cli\u003e\n  \u003ca href=\"https://example.com/link-building\"\u003e\n   Link Building\n  \u003c/a\u003e\n \u003c/li\u003e\n\u003c/ul\u003e\n```\n\n## Thank you!\nPlease feel free to reach out if you have any further questions or need additional assistance!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkolofsen%2Fcrosslinker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkolofsen%2Fcrosslinker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkolofsen%2Fcrosslinker/lists"}