localsitemap 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ MIT License (Modified)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to make derivative works based on the Software, provided that any substantial changes to the Software are clearly distinguished from the original work and are distributed under a different name.
4
+
5
+ The original copyright notice and disclaimer must be retained in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.2
2
+ Name: localsitemap
3
+ Version: 1.0.0
4
+ Summary: 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.
5
+ Home-page: https://github.com/infinitode/localsitemap
6
+ Author: Infinitode Pty Ltd
7
+ Author-email: infinitode.ltd@gmail.com
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3.6
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.6
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: matplotlib>=3.0.0
23
+ Requires-Dist: pandas>=1.0.0
24
+ Requires-Dist: numpy>=1.18.0
25
+ Dynamic: author
26
+ Dynamic: author-email
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: description-content-type
30
+ Dynamic: home-page
31
+ Dynamic: requires-dist
32
+ Dynamic: requires-python
33
+ Dynamic: summary
34
+
35
+ # LocalSiteMap
36
+ ![Python Version](https://img.shields.io/badge/python-3.13-blue.svg)
37
+ [![Code Size](https://img.shields.io/github/languages/code-size/infinitode/localsitemap)](https://github.com/infinitode/localsitemap)
38
+ ![Downloads](https://pepy.tech/badge/localsitemap)
39
+ ![License Compliance](https://img.shields.io/badge/license-compliance-brightgreen.svg)
40
+ ![PyPI Version](https://img.shields.io/pypi/v/localsitemap)
41
+
42
+ 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.
43
+
44
+ ### Changes in version 1.0.0:
45
+ - Added initial package code, with automatic directory crawling to generate the `sitemap.xml` file.
46
+
47
+ > [!IMPORTANT]
48
+ > `LocalSiteMap` crawls any directory found in the root folder, be sure to add exclusions for important directories, or hidden/resource/file directories.
49
+
50
+ ## Installation
51
+
52
+ You can install LocalSiteMap using pip:
53
+
54
+ ```bash
55
+ pip install localsitemap
56
+ ```
57
+
58
+ ## Supported Python Versions
59
+
60
+ LocalSiteMap supports the following Python versions:
61
+
62
+ - Python 3.6
63
+ - Python 3.7
64
+ - Python 3.8
65
+ - Python 3.9
66
+ - Python 3.10
67
+ - Python 3.11/Later (Preferred)
68
+
69
+ 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.
70
+
71
+ ## Features
72
+
73
+ - **Directory Crawling**: `LocalSiteMap` automatically crawls all subdirectories and files under the root directory, recursively adding them to your sitemap.
74
+ - **Automatic Last Modified Checks**: The package also automatically checks when the file has last been modified when adding it to the sitemap.
75
+ - - **Customizable**: You can customize the sitemap generation process by excluding specific directories or files.
76
+ - **Easy to Use**: With just a few lines of code, you can generate a complete sitemap for your local website.
77
+ - **Open Source**: LocalSiteMap is open source, allowing you to inspect, modify, and contribute to the code.
78
+
79
+ ## Usage
80
+
81
+ ### Generating a sitemap
82
+
83
+ ```python
84
+ from localsitemap import generate_sitemap
85
+
86
+ # Root site directory
87
+ root_directory = r"path/to/your/website/directory"
88
+
89
+ # Domain of your website (where it is hosted)
90
+ base_url_of_your_website = "https://example.com"
91
+
92
+ # List of file paths or directories to exclude from the sitemap
93
+ excluded = ["auth", "forms", "template.html", "media", ".git", ".vscode", "node_modules"] # Example exclusions
94
+
95
+ # Generate the sitemap
96
+ generate_sitemap(root_directory, base_url_of_your_website, "sitemap.xml", excluded)
97
+ print("Sitemap generated in sitemap.xml")
98
+ ```
99
+
100
+ ## Contributing
101
+
102
+ 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](https://github.com/infinitode/localsitemap).
103
+
104
+ ## License
105
+
106
+ LocalSiteMap is released under the terms of the **MIT License (Modified)**. Please see the [LICENSE](https://github.com/infinitode/localsitemap/blob/main/LICENSE) file for the full text.
107
+
108
+ **Modified License Clause**
109
+
110
+ 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.
@@ -0,0 +1,76 @@
1
+ # LocalSiteMap
2
+ ![Python Version](https://img.shields.io/badge/python-3.13-blue.svg)
3
+ [![Code Size](https://img.shields.io/github/languages/code-size/infinitode/localsitemap)](https://github.com/infinitode/localsitemap)
4
+ ![Downloads](https://pepy.tech/badge/localsitemap)
5
+ ![License Compliance](https://img.shields.io/badge/license-compliance-brightgreen.svg)
6
+ ![PyPI Version](https://img.shields.io/pypi/v/localsitemap)
7
+
8
+ 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.
9
+
10
+ ### Changes in version 1.0.0:
11
+ - Added initial package code, with automatic directory crawling to generate the `sitemap.xml` file.
12
+
13
+ > [!IMPORTANT]
14
+ > `LocalSiteMap` crawls any directory found in the root folder, be sure to add exclusions for important directories, or hidden/resource/file directories.
15
+
16
+ ## Installation
17
+
18
+ You can install LocalSiteMap using pip:
19
+
20
+ ```bash
21
+ pip install localsitemap
22
+ ```
23
+
24
+ ## Supported Python Versions
25
+
26
+ LocalSiteMap supports the following Python versions:
27
+
28
+ - Python 3.6
29
+ - Python 3.7
30
+ - Python 3.8
31
+ - Python 3.9
32
+ - Python 3.10
33
+ - Python 3.11/Later (Preferred)
34
+
35
+ 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.
36
+
37
+ ## Features
38
+
39
+ - **Directory Crawling**: `LocalSiteMap` automatically crawls all subdirectories and files under the root directory, recursively adding them to your sitemap.
40
+ - **Automatic Last Modified Checks**: The package also automatically checks when the file has last been modified when adding it to the sitemap.
41
+ - - **Customizable**: You can customize the sitemap generation process by excluding specific directories or files.
42
+ - **Easy to Use**: With just a few lines of code, you can generate a complete sitemap for your local website.
43
+ - **Open Source**: LocalSiteMap is open source, allowing you to inspect, modify, and contribute to the code.
44
+
45
+ ## Usage
46
+
47
+ ### Generating a sitemap
48
+
49
+ ```python
50
+ from localsitemap import generate_sitemap
51
+
52
+ # Root site directory
53
+ root_directory = r"path/to/your/website/directory"
54
+
55
+ # Domain of your website (where it is hosted)
56
+ base_url_of_your_website = "https://example.com"
57
+
58
+ # List of file paths or directories to exclude from the sitemap
59
+ excluded = ["auth", "forms", "template.html", "media", ".git", ".vscode", "node_modules"] # Example exclusions
60
+
61
+ # Generate the sitemap
62
+ generate_sitemap(root_directory, base_url_of_your_website, "sitemap.xml", excluded)
63
+ print("Sitemap generated in sitemap.xml")
64
+ ```
65
+
66
+ ## Contributing
67
+
68
+ 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](https://github.com/infinitode/localsitemap).
69
+
70
+ ## License
71
+
72
+ LocalSiteMap is released under the terms of the **MIT License (Modified)**. Please see the [LICENSE](https://github.com/infinitode/localsitemap/blob/main/LICENSE) file for the full text.
73
+
74
+ **Modified License Clause**
75
+
76
+ 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.
@@ -0,0 +1,72 @@
1
+ import os
2
+ import datetime
3
+ from xml.etree.ElementTree import Element, SubElement, tostring
4
+ from xml.dom import minidom
5
+
6
+ def generate_sitemap(root_path, base_url, output_file="sitemap.xml", excluded_paths=None):
7
+ """
8
+ Generates a sitemap XML file by crawling a directory structure.
9
+
10
+ Parameters:
11
+ root_path: The root directory of your website.
12
+ base_url: The base URL of your website (e.g., "https://example.com").
13
+ output_file: The name of the output XML file (default: "sitemap.xml").
14
+ excluded_paths: A list of file paths or directories to exclude from the sitemap.
15
+ """
16
+ if excluded_paths is None:
17
+ excluded_paths = []
18
+
19
+ urlset = Element("urlset")
20
+ urlset.set("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9")
21
+ urlset.set("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
22
+ urlset.set("xsi:schemaLocation", "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd")
23
+
24
+ for root, dirs, files in os.walk(root_path):
25
+ # Add directories to the sitemap
26
+ for dir_name in dirs:
27
+ full_dir_path = os.path.join(root, dir_name)
28
+ if any(excluded in full_dir_path for excluded in excluded_paths):
29
+ continue
30
+ relative_dir_path = os.path.relpath(full_dir_path, root_path)
31
+ url = os.path.join(base_url, relative_dir_path).replace("\\", "/") + "/"
32
+ lastmod = datetime.datetime.fromtimestamp(os.path.getmtime(full_dir_path)).isoformat()
33
+ lastmod = lastmod[:lastmod.find(".")+4] + "+00:00"
34
+
35
+ url_entry = SubElement(urlset, "url")
36
+ SubElement(url_entry, "loc").text = url
37
+ SubElement(url_entry, "lastmod").text = lastmod
38
+ SubElement(url_entry, "priority").text = "0.80"
39
+
40
+ for file in files:
41
+ if file.endswith((".html", ".htm")):
42
+ full_path = os.path.join(root, file)
43
+ relative_path = os.path.relpath(full_path, root_path)
44
+
45
+ # Check if the file should be excluded
46
+ if any(excluded in full_path for excluded in excluded_paths):
47
+ continue
48
+
49
+ url = os.path.join(base_url, relative_path).replace("\\", "/")
50
+ lastmod = datetime.datetime.fromtimestamp(os.path.getmtime(full_path)).isoformat()
51
+ lastmod = lastmod[:lastmod.find(".")+4] + "+00:00"
52
+
53
+ url_entry = SubElement(urlset, "url")
54
+ SubElement(url_entry, "loc").text = url
55
+ SubElement(url_entry, "lastmod").text = lastmod
56
+ SubElement(url_entry, "priority").text = "0.80"
57
+
58
+ # Add homepage to the sitemap
59
+ url_entry = SubElement(urlset, "url")
60
+ SubElement(url_entry, "loc").text = base_url
61
+ lastmod = datetime.datetime.fromtimestamp(os.path.getmtime(root_path)).isoformat()
62
+ lastmod = lastmod[:lastmod.find(".")+4] + "+00:00"
63
+ SubElement(url_entry, "lastmod").text = lastmod
64
+ SubElement(url_entry, "priority").text = "1.00"
65
+
66
+ # Write the XML to a file
67
+ xml_string = tostring(urlset, "utf-8")
68
+ reparsed = minidom.parseString(xml_string)
69
+ pretty_xml = reparsed.toprettyxml(indent=" ")
70
+
71
+ with open(output_file, "w", encoding="utf-8") as f:
72
+ f.write(pretty_xml)
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.2
2
+ Name: localsitemap
3
+ Version: 1.0.0
4
+ Summary: 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.
5
+ Home-page: https://github.com/infinitode/localsitemap
6
+ Author: Infinitode Pty Ltd
7
+ Author-email: infinitode.ltd@gmail.com
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3.6
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.6
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: matplotlib>=3.0.0
23
+ Requires-Dist: pandas>=1.0.0
24
+ Requires-Dist: numpy>=1.18.0
25
+ Dynamic: author
26
+ Dynamic: author-email
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: description-content-type
30
+ Dynamic: home-page
31
+ Dynamic: requires-dist
32
+ Dynamic: requires-python
33
+ Dynamic: summary
34
+
35
+ # LocalSiteMap
36
+ ![Python Version](https://img.shields.io/badge/python-3.13-blue.svg)
37
+ [![Code Size](https://img.shields.io/github/languages/code-size/infinitode/localsitemap)](https://github.com/infinitode/localsitemap)
38
+ ![Downloads](https://pepy.tech/badge/localsitemap)
39
+ ![License Compliance](https://img.shields.io/badge/license-compliance-brightgreen.svg)
40
+ ![PyPI Version](https://img.shields.io/pypi/v/localsitemap)
41
+
42
+ 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.
43
+
44
+ ### Changes in version 1.0.0:
45
+ - Added initial package code, with automatic directory crawling to generate the `sitemap.xml` file.
46
+
47
+ > [!IMPORTANT]
48
+ > `LocalSiteMap` crawls any directory found in the root folder, be sure to add exclusions for important directories, or hidden/resource/file directories.
49
+
50
+ ## Installation
51
+
52
+ You can install LocalSiteMap using pip:
53
+
54
+ ```bash
55
+ pip install localsitemap
56
+ ```
57
+
58
+ ## Supported Python Versions
59
+
60
+ LocalSiteMap supports the following Python versions:
61
+
62
+ - Python 3.6
63
+ - Python 3.7
64
+ - Python 3.8
65
+ - Python 3.9
66
+ - Python 3.10
67
+ - Python 3.11/Later (Preferred)
68
+
69
+ 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.
70
+
71
+ ## Features
72
+
73
+ - **Directory Crawling**: `LocalSiteMap` automatically crawls all subdirectories and files under the root directory, recursively adding them to your sitemap.
74
+ - **Automatic Last Modified Checks**: The package also automatically checks when the file has last been modified when adding it to the sitemap.
75
+ - - **Customizable**: You can customize the sitemap generation process by excluding specific directories or files.
76
+ - **Easy to Use**: With just a few lines of code, you can generate a complete sitemap for your local website.
77
+ - **Open Source**: LocalSiteMap is open source, allowing you to inspect, modify, and contribute to the code.
78
+
79
+ ## Usage
80
+
81
+ ### Generating a sitemap
82
+
83
+ ```python
84
+ from localsitemap import generate_sitemap
85
+
86
+ # Root site directory
87
+ root_directory = r"path/to/your/website/directory"
88
+
89
+ # Domain of your website (where it is hosted)
90
+ base_url_of_your_website = "https://example.com"
91
+
92
+ # List of file paths or directories to exclude from the sitemap
93
+ excluded = ["auth", "forms", "template.html", "media", ".git", ".vscode", "node_modules"] # Example exclusions
94
+
95
+ # Generate the sitemap
96
+ generate_sitemap(root_directory, base_url_of_your_website, "sitemap.xml", excluded)
97
+ print("Sitemap generated in sitemap.xml")
98
+ ```
99
+
100
+ ## Contributing
101
+
102
+ 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](https://github.com/infinitode/localsitemap).
103
+
104
+ ## License
105
+
106
+ LocalSiteMap is released under the terms of the **MIT License (Modified)**. Please see the [LICENSE](https://github.com/infinitode/localsitemap/blob/main/LICENSE) file for the full text.
107
+
108
+ **Modified License Clause**
109
+
110
+ 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.
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README.md
3
+ setup.py
4
+ localsitemap/__init__.py
5
+ localsitemap.egg-info/PKG-INFO
6
+ localsitemap.egg-info/SOURCES.txt
7
+ localsitemap.egg-info/dependency_links.txt
8
+ localsitemap.egg-info/requires.txt
9
+ localsitemap.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ matplotlib>=3.0.0
2
+ pandas>=1.0.0
3
+ numpy>=1.18.0
@@ -0,0 +1 @@
1
+ localsitemap
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,35 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ with open("README.md", "r", encoding="utf-8") as fh:
4
+ long_description = fh.read()
5
+
6
+ setup(
7
+ name='localsitemap',
8
+ version='1.0.0',
9
+ author='Infinitode Pty Ltd',
10
+ author_email='infinitode.ltd@gmail.com',
11
+ description="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.",
12
+ long_description=long_description,
13
+ long_description_content_type='text/markdown',
14
+ url='https://github.com/infinitode/localsitemap',
15
+ packages=find_packages(),
16
+ classifiers=[
17
+ 'Development Status :: 5 - Production/Stable',
18
+ 'Intended Audience :: Developers',
19
+ 'License :: OSI Approved :: MIT License',
20
+ 'Programming Language :: Python :: 3.6',
21
+ 'Programming Language :: Python :: 3.7',
22
+ 'Programming Language :: Python :: 3.8',
23
+ 'Programming Language :: Python :: 3.9',
24
+ 'Programming Language :: Python :: 3.10',
25
+ 'Programming Language :: Python :: 3.11',
26
+ 'Programming Language :: Python :: 3.12',
27
+ 'Programming Language :: Python :: 3.13',
28
+ ],
29
+ python_requires='>=3.6',
30
+ install_requires=[
31
+ 'matplotlib>=3.0.0',
32
+ 'pandas>=1.0.0',
33
+ 'numpy>=1.18.0'
34
+ ],
35
+ )