{"id":15688251,"url":"https://github.com/capjamesg/seotools","last_synced_at":"2025-05-07T20:46:45.843Z","repository":{"id":185932946,"uuid":"674371658","full_name":"capjamesg/SEOtools","owner":"capjamesg","description":"A set of utilities for SEOs and web developers with which to complete common tasks.","archived":false,"fork":false,"pushed_at":"2023-08-07T10:24:40.000Z","size":1549,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T20:46:40.117Z","etag":null,"topics":["link-graph","seo","seo-optimization"],"latest_commit_sha":null,"homepage":"https://capjamesg.github.io/SEOtools/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capjamesg.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-08-03T19:32:55.000Z","updated_at":"2024-09-08T13:23:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"032989b1-88fb-48a1-bd55-2897497d04d2","html_url":"https://github.com/capjamesg/SEOtools","commit_stats":null,"previous_names":["capjamesg/seotools"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2FSEOtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2FSEOtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2FSEOtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2FSEOtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capjamesg","download_url":"https://codeload.github.com/capjamesg/SEOtools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252954144,"owners_count":21830895,"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":["link-graph","seo","seo-optimization"],"created_at":"2024-10-03T17:56:41.991Z","updated_at":"2025-05-07T20:46:45.820Z","avatar_url":"https://github.com/capjamesg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![version](https://badge.fury.io/py/seotools.svg?)](https://badge.fury.io/py/seotools)\n[![downloads](https://img.shields.io/pypi/dm/seotools)](https://pypistats.org/packages/seotools)\n[![license](https://img.shields.io/pypi/l/seotools?)](https://github.com/capjamesg/seotools/blob/main/LICENSE)\n[![python-version](https://img.shields.io/pypi/pyversions/seotools)](https://badge.fury.io/py/mf2py)\n\n# SEOtools 🛠️\n\nA set of utilities for SEOs and web developers with which to complete common tasks.\n\nWith SEOtools, you can:\n\n1. Programatically add links to related posts in content.\n2. Calculate PageRank on internal links from your sitemap.\n3. Identify broken links on a web page.\n4. Recommend a post to use as canonical for a given keyword.\n5. Find the distance of pages from your home page.\n\nAnd more!\n\n## Installation 💻\n\nYou can install SEOtools using pip:\n\n```bash\npip install seotools\n```\n\n## Quickstart 🚀\n\n### Create a link graph\n\n```python\nfrom seotools.app import Analyzer\n\n# load from disk will load the link graph from disk if it has already been created\n# otherwise, a new link graph will be created\nanalyzer = Analyzer(\"https://jamesg.blog/sitemap.xml\", load_from_disk=True)\n```\n\n### Get pagerank of a URL\n\n```python\nprint(analyzer.pagerank[\"https://jamesg.blog\"])\n```\n\n### Add relevant internal links to a web page\n\n```python\nimport markdown\n\narticle = markdown.markdown(BeautifulSoup(article.text, \"html.parser\").get_text())\n\nkeyword_replace_count = 0\n\nfor keyword, url in keyword_map.items():\n    if keyword_replace_count \u003e= MAX_KEYWORD_REPLACE:\n        break\n\n    article = article.replace(keyword, f\"\u003ca href='{url}'\u003e{keyword}\u003c/a\u003e\", 1)\n    keyword_replace_count += 1\n\nprint(article)\n```\n\n### Recommend related content for a \"See Also\" section\n\n```python\narticle = requests.get(\"https://jamesg.blog/...\")\n\narticle = markdown.markdown(BeautifulSoup(article.text, \"html.parser\").get_text())\n\nurls = analyzer.recommend_related_content(article.text)\n```\n\n### Check if a page contains a particular JSON-LD object\n\n```python\nfrom seotools import page_contains_jsonld\nimport requests\n\ncontent = requests.get(\"https://jamesg.blog\")\n\nprint(page_contains_jsonld(content, \"FAQPage\"))\n```\n\n### Get subfolders in a sitemap\n\n```python\nanalyzer.get_subpaths()\n```\n\n### Get distance of URL from home page\n\n```python\nanalyzer.get_distance_from_home_page(\"https://jamesg.blog/2023/01/01/\")\n```\n\n### Retrieve keywords that appear more than N times on a web page\n\n```python\nfrom seotools import get_keywords\nimport requests\nfrom bs4 import BeautifulSoup\n\narticle = requests.get(\"https://jamesg.blog/...\").text\nparsed_article = BeautifulSoup(article, \"html.parser\").get_text()\n\n# get keywords that appear more than 10 times\nkeywords = get_keywords(parsed_article, 10)\n```\n\n## See Also 📚\n\n- [getsitemap](https://github.com/capjamesg/getsitemap): Retrieve URLs in a sitemap. ([Web interface](https://getsitemapurls.com))\n\n## License 📝\n\nThis project is licensed under an [MIT license](https://github.com/capjamesg/SEOtools/blob/main/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapjamesg%2Fseotools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapjamesg%2Fseotools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapjamesg%2Fseotools/lists"}