https://github.com/gordonzhang2024/xss-shield
A Python library to prevent your website from being attacked
https://github.com/gordonzhang2024/xss-shield
python python-3 python-package python3 security web xss xss-attacks xss-scanner
Last synced: about 1 year ago
JSON representation
A Python library to prevent your website from being attacked
- Host: GitHub
- URL: https://github.com/gordonzhang2024/xss-shield
- Owner: GordonZhang2024
- License: mit
- Created: 2024-04-30T12:02:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-22T10:10:58.000Z (about 1 year ago)
- Last Synced: 2025-04-03T08:37:18.663Z (about 1 year ago)
- Topics: python, python-3, python-package, python3, security, web, xss, xss-attacks, xss-scanner
- Language: Python
- Homepage: https://pypi.org/project/xss-shield/
- Size: 156 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 
A simple Python library to prevent your website from being attacked.
[PyPI](https://pypi.org/project/xss-shield/)
[GitHub](https://github.com/GordonZhang2024/xss-shield/tree/main)
[Docs](https://xss-shield.readthedocs.io/en/latest/)




[](https://xss-shield.readthedocs.io/en/latest/?badge=latest)
## Installing
Type command:
```bash
$ pip install xss-shield
```
## Usage
Function `excape(s: str, strict=True)`
> ## Arguments
> - s: the string to parse
>
> - strict:
>> if not strict ->
>> keep everything except `` tag
example:
```python
import xss_shield
unsafe_str = '<script>alert("Bad.");'
safe_str = xss_shield.escape(unsafe_str)
```
*The full example is in the `examples/` directory.*
## Docs
**The docs are availible [here](https://xss-shield.readthedocs.io/en/latest/)**