Skip to main content

LocalSiteMap is an open-source Python library designed to make dataset analysis much easier by generating helpful detailed plots using matplotlib based on your dataset.

Project description

LocalSiteMap

Python Version Code Size Downloads License Compliance PyPI Version

LocalSiteMap is an open-source Python package designed for generating sitemaps from local files. It tracks HTML and HTM files, and generates complete sitemaps for the root website, including directories.

Changes in version 1.0.1:

  • Added show_progress boolean to print out mapping progress, pages mapped, and files found.

Changes in version 1.0.0:

  • Added initial package code, with automatic directory crawling to generate the sitemap.xml file.

[!IMPORTANT] LocalSiteMap crawls any directory found in the root folder, be sure to add exclusions for important directories, or hidden/resource/file directories.

Installation

You can install LocalSiteMap using pip:

pip install localsitemap

Supported Python Versions

LocalSiteMap supports the following Python versions:

  • Python 3.6
  • Python 3.7
  • Python 3.8
  • Python 3.9
  • Python 3.10
  • Python 3.11/Later (Preferred)

Please ensure that you have one of these Python versions installed before using LocalSiteMap. LocalSiteMap may not work as expected on lower versions of Python than the supported.

Features

  • Directory Crawling: LocalSiteMap automatically crawls all subdirectories and files under the root directory, recursively adding them to your sitemap.
  • Automatic Last Modified Checks: The package also automatically checks when the file has last been modified when adding it to the sitemap.
    • Customizable: You can customize the sitemap generation process by excluding specific directories or files.
  • Easy to Use: With just a few lines of code, you can generate a complete sitemap for your local website.
  • Open Source: LocalSiteMap is open source, allowing you to inspect, modify, and contribute to the code.

Usage

Generating a sitemap

from localsitemap import generate_sitemap

# Root site directory
root_directory = r"path/to/your/website/directory"

# Domain of your website (where it is hosted)
base_url_of_your_website = "https://example.com"

# List of file paths or directories to exclude from the sitemap
excluded = ["auth", "forms", "template.html", "media", ".git", ".vscode", "node_modules"]  # Example exclusions

# Generate the sitemap
generate_sitemap(root_directory, base_url_of_your_website, "sitemap.xml", excluded, show_progress=True)
print("Sitemap generated in sitemap.xml")

Contributing

Contributions are welcome! If you encounter any issues, have suggestions, or want to contribute to LocalSiteMap, please open an issue or submit a pull request on GitHub.

License

LocalSiteMap is released under the terms of the MIT License (Modified). Please see the LICENSE file for the full text.

Modified License Clause

The modified license clause grants users the permission to make derivative works based on the LocalSiteMap software. However, it requires any substantial changes to the software to be clearly distinguished from the original work and distributed under a different name.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localsitemap-1.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

localsitemap-1.0.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file localsitemap-1.0.1.tar.gz.

File metadata

  • Download URL: localsitemap-1.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for localsitemap-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3b2b2ff0594d21c864e5397e8e90412f964194d1a086e6a9c3cb7b2cc9e04c35
MD5 8b3ec568f629b3d97a0561e97e68668e
BLAKE2b-256 05d8e4be73062fd8659062700c9499dfdb0e1ad350263aa2c74896f9ea25924a

See more details on using hashes here.

File details

Details for the file localsitemap-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: localsitemap-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for localsitemap-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bdfb838344c682d995a8ccb7c0a3f153b6025c6e56c57827c042cba7866796c1
MD5 e44fd7e56128aa6365193e6af378435f
BLAKE2b-256 e9fc4e71a98e0419d60834da37498948e1ddb85dec2e635dcecac915df38dcf2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page