# 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": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "wordpress,static-site-generators,search-engines,seo",
"author": "Faisal Shahzad",
"author_email": "info@serpwings.com",
"download_url": "https://files.pythonhosted.org/packages/90/75/26346e17552ffedf25ae6ed1a522ea063f0fa8e95f50cd0d222a2a53c11e/staticwordpress-0.0.6.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.6",
"project_urls": {
"Download": "https://github.com/serpwings/static-wordpress/releases/v0.0.6.tar.gz",
"Homepage": "https://github.com/serpwings/static-wordpress"
},
"split_keywords": [
"wordpress",
"static-site-generators",
"search-engines",
"seo"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8776366523cdce1ca3fff513ed23cc1481da8ef8d7b5980b23e6221ccc13e419",
"md5": "f5630149d8bdb0ba2955f3a2ff3b78dc",
"sha256": "4f385e587095985d02e058642979b37f7171e2d51eb99d99f64f1cca09c6bb17"
},
"downloads": -1,
"filename": "staticwordpress-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f5630149d8bdb0ba2955f3a2ff3b78dc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 117877,
"upload_time": "2024-01-07T01:32:06",
"upload_time_iso_8601": "2024-01-07T01:32:06.326300Z",
"url": "https://files.pythonhosted.org/packages/87/76/366523cdce1ca3fff513ed23cc1481da8ef8d7b5980b23e6221ccc13e419/staticwordpress-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "907526346e17552ffedf25ae6ed1a522ea063f0fa8e95f50cd0d222a2a53c11e",
"md5": "ac90be1eb33727c5572d91f54c331529",
"sha256": "0a7fe577b39de9ce87db42d25acf2c75251cc2c77917f8779238f9c9e9d16d82"
},
"downloads": -1,
"filename": "staticwordpress-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "ac90be1eb33727c5572d91f54c331529",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 76633,
"upload_time": "2024-01-07T01:32:08",
"upload_time_iso_8601": "2024-01-07T01:32:08.221603Z",
"url": "https://files.pythonhosted.org/packages/90/75/26346e17552ffedf25ae6ed1a522ea063f0fa8e95f50cd0d222a2a53c11e/staticwordpress-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-07 01:32:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "serpwings",
"github_project": "static-wordpress",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "staticwordpress"
}