# static-wordpress
Python Package for Converting WordPress Installation to a Static Website.
[![build_Tests](https://github.com/serpwings/static-wordpress/actions/workflows/tests.yml/badge.svg)](https://github.com/serpwings/static-wordpress/actions/workflows/tests.yml)
[![license](https://img.shields.io/pypi/l/staticwordpress.svg?style=flat-square "Project License: GPLv3+")](https://github.com/serpwings/staticwordpress/blob/master/LICENSE)
[![status](https://img.shields.io/pypi/status/staticwordpress.svg?style=flat-square "Project Development Status")](https://github.com/serpwings/staticwordpress/milestone/1)
[![pypi_version](https://img.shields.io/pypi/v/staticwordpress.svg?style=flat-square "Available on PyPi - the Python Package Index")](https://pypi.python.org/pypi/staticwordpress)
[![supported_python_versions](https://img.shields.io/pypi/pyversions/staticwordpress.svg?style=flat-square "Supported Python Version")](https://pypi.python.org/pypi/staticwordpress)
## Desktop Version
![staticwordpress-gui](docs/img/staticwordpress-gui.png)
## How to Install static-wordpress?
### Windows Installer
We provide an ``exe`` file of ``staticwordpress`` for the convenice of users. Please download the latest version from [release section](https://github.com/serpwings/static-wordpress/releases).
### Source Code
- Clone or download this repository to your computer.
- Create a virtual environment using ``python -m .venv venv``
- Navigate to the downloaded directory and then install all required dependencies using ``pip install -e .``
- Once all dependencies are met, then start **staticwordpress** by typing ``staticwordpress`` on commandline.
## Development
This package is available at ``pypi`` and you can install it with ``pip install staticwordpress`` command. It will also install required additional libraries/Python Packages automatically.
Once installed, you can implement customized workflows. Here is an example of post processing simply-static-zip file.
```python
import logging
from staticwordpress.core.workflow import Workflow
from staticwordpress.core.constants import SOURCE, HOST
# enable logging for all functions.
logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(message)s",
level=logging.DEBUG,
stream=sys.stdout,
)
swp = Workflow()
swp.create_project(
project_name_="simply-static-zip-deploy",
wp_user_=env_wp_user, # your wordpress username
wp_api_token_=env_wp_api_token, # wordpress xml api token
src_url_=env_src_url, # source url where WordPress is hosted
dst_url_=env_dst_url, # destination url where you want to host Static version
output_folder_=env_output, # Output folder location, where processed files will be saved
src_type_=SOURCE.ZIP, # Data Source e.g. ZIP file from Simply Static WordPress Plugin
host_type_=HOST.NETLIFY, # Host, where you want to deplyo your website.
)
swp.download_zip_file()
swp.setup_zip_folders()
swp.add_404_page()
swp.add_robots_txt()
swp.add_redirects()
swp.add_search()
```
## Documentation
Detailed documentation of all features is available at [staticwordpress documentation](https://static-wordpress-docs.netlify.app/).
## Contribute
Pull Requests, Feature Suggestions, and collaborations are welcome.
## ICONS
Icons used in this project are obtained from Google [Fonts Material Symbols](https://fonts.google.com/icons?selected=Material+Symbols+Outlined:search:FILL@0;wght@400;GRAD@0;opsz@24)
## About Us
This work is a collaborative effort of [seowings](https://www.seowings.org/), and [serpwings](https://serpwings.com/).
Raw data
{
"_id": null,
"home_page": "https://github.com/serpwings/static-wordpress",
"name": "staticwordpress",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "wordpress, static-site-generators, search-engines, seo",
"author": "Faisal Shahzad",
"author_email": "info@serpwings.com",
"download_url": "https://files.pythonhosted.org/packages/40/25/5929dc95ff3cc3169ec35706d7c30c344908394355a101f4b771b5c4fe61/staticwordpress-0.0.7.tar.gz",
"platform": null,
"description": "# static-wordpress\n\nPython Package for Converting WordPress Installation to a Static Website.\n\n[![build_Tests](https://github.com/serpwings/static-wordpress/actions/workflows/tests.yml/badge.svg)](https://github.com/serpwings/static-wordpress/actions/workflows/tests.yml)\n[![license](https://img.shields.io/pypi/l/staticwordpress.svg?style=flat-square \"Project License: GPLv3+\")](https://github.com/serpwings/staticwordpress/blob/master/LICENSE)\n[![status](https://img.shields.io/pypi/status/staticwordpress.svg?style=flat-square \"Project Development Status\")](https://github.com/serpwings/staticwordpress/milestone/1)\n[![pypi_version](https://img.shields.io/pypi/v/staticwordpress.svg?style=flat-square \"Available on PyPi - the Python Package Index\")](https://pypi.python.org/pypi/staticwordpress)\n[![supported_python_versions](https://img.shields.io/pypi/pyversions/staticwordpress.svg?style=flat-square \"Supported Python Version\")](https://pypi.python.org/pypi/staticwordpress)\n\n\n## Desktop Version\n\n![staticwordpress-gui](docs/img/staticwordpress-gui.png)\n\n## How to Install static-wordpress?\n\n### Windows Installer\n\nWe provide an ``exe`` file of ``staticwordpress`` for the convenice of users. Please download the latest version from [release section](https://github.com/serpwings/static-wordpress/releases).\n\n\n### Source Code\n\n- Clone or download this repository to your computer.\n- Create a virtual environment using ``python -m .venv venv``\n- Navigate to the downloaded directory and then install all required dependencies using ``pip install -e .``\n- Once all dependencies are met, then start **staticwordpress** by typing ``staticwordpress`` on commandline.\n\n## Development\n\nThis package is available at ``pypi`` and you can install it with ``pip install staticwordpress`` command. It will also install required additional libraries/Python Packages automatically.\n\nOnce installed, you can implement customized workflows. Here is an example of post processing simply-static-zip file. \n\n```python\nimport logging\n\nfrom staticwordpress.core.workflow import Workflow\nfrom staticwordpress.core.constants import SOURCE, HOST\n\n# enable logging for all functions.\nlogging.basicConfig(\n format=\"%(asctime)s - %(levelname)s - %(message)s\",\n level=logging.DEBUG,\n stream=sys.stdout,\n)\n\nswp = Workflow()\nswp.create_project(\n project_name_=\"simply-static-zip-deploy\",\n wp_user_=env_wp_user, # your wordpress username\n wp_api_token_=env_wp_api_token, # wordpress xml api token\n src_url_=env_src_url, # source url where WordPress is hosted\n dst_url_=env_dst_url, # destination url where you want to host Static version\n output_folder_=env_output, # Output folder location, where processed files will be saved\n src_type_=SOURCE.ZIP, # Data Source e.g. ZIP file from Simply Static WordPress Plugin\n host_type_=HOST.NETLIFY, # Host, where you want to deplyo your website.\n )\n\nswp.download_zip_file()\nswp.setup_zip_folders()\nswp.add_404_page()\nswp.add_robots_txt()\nswp.add_redirects()\nswp.add_search()\n```\n\n## Documentation\n\nDetailed documentation of all features is available at [staticwordpress documentation](https://static-wordpress-docs.netlify.app/).\n\n## Contribute\n\nPull Requests, Feature Suggestions, and collaborations are welcome.\n\n## ICONS\n\nIcons used in this project are obtained from Google [Fonts Material Symbols](https://fonts.google.com/icons?selected=Material+Symbols+Outlined:search:FILL@0;wght@400;GRAD@0;opsz@24) \n\n## About Us\n\nThis work is a collaborative effort of [seowings](https://www.seowings.org/), and [serpwings](https://serpwings.com/).\n",
"bugtrack_url": null,
"license": "GPLv3+",
"summary": "Python Package for Converting WordPress Installation to a Static Website",
"version": "0.0.7",
"project_urls": {
"Download": "https://github.com/serpwings/static-wordpress/releases/v0.0.7.tar.gz",
"Homepage": "https://github.com/serpwings/static-wordpress"
},
"split_keywords": [
"wordpress",
" static-site-generators",
" search-engines",
" seo"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "450c0d963fccd1938c5cf84569efb82e67da1765ee72648a9e6f50fc84c53770",
"md5": "46a5819847ba22ebec44c846bf5457c0",
"sha256": "8238b0c64050687655d460b25a44755187de32f7d5ca9134d1ac8b22be55d74d"
},
"downloads": -1,
"filename": "staticwordpress-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "46a5819847ba22ebec44c846bf5457c0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 117911,
"upload_time": "2024-12-21T00:39:17",
"upload_time_iso_8601": "2024-12-21T00:39:17.980689Z",
"url": "https://files.pythonhosted.org/packages/45/0c/0d963fccd1938c5cf84569efb82e67da1765ee72648a9e6f50fc84c53770/staticwordpress-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "40255929dc95ff3cc3169ec35706d7c30c344908394355a101f4b771b5c4fe61",
"md5": "b734dad0b75d087aed7841926e691324",
"sha256": "9299881a10eaa473601e0cf173f19aabbf72791258596b2ed8b579e9808fd56e"
},
"downloads": -1,
"filename": "staticwordpress-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "b734dad0b75d087aed7841926e691324",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 76642,
"upload_time": "2024-12-21T00:39:20",
"upload_time_iso_8601": "2024-12-21T00:39:20.398832Z",
"url": "https://files.pythonhosted.org/packages/40/25/5929dc95ff3cc3169ec35706d7c30c344908394355a101f4b771b5c4fe61/staticwordpress-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-21 00:39:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "serpwings",
"github_project": "static-wordpress",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "beautifulsoup4",
"specs": [
[
"==",
"4.11.1"
]
]
},
{
"name": "lxml",
"specs": [
[
">=",
"4.9.1"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.31.0"
]
]
},
{
"name": "GitPython",
"specs": [
[
"==",
"3.1.41"
]
]
},
{
"name": "PyGithub",
"specs": [
[
"==",
"1.59.1"
]
]
},
{
"name": "PyYAML",
"specs": [
[
"==",
"6.0.1"
]
]
}
],
"lcname": "staticwordpress"
}