# psl
[![Version](https://img.shields.io/pypi/v/psl)](https://pypi.org/project/psl)
[![Downloads](https://pepy.tech/badge/psl)](https://pepy.tech/project/psl)
![CI](https://img.shields.io/github/workflow/status/sethmlarson/psl/CI/master)
Mozilla Public Suffix list as a Python package and updated daily.
Install via `python -m pip install psl`
See https://publicsuffix.org for more information regarding the list itself.
## API
The package provides the following members as an API:
### `domain_suffixes()`
```python
def domain_suffixes(dn: str, *, icann_only: bool=False) -> Suffixes: ...
```
Queries the Public Suffix list for the given domain and returns a named tuple containing
the public and private suffixes for the domain. Either value can be `None` if that
field isn't available. (eg `private=None` for the domain `com`)
### `domain_can_set_cookie()`
```python
def domain_can_set_cookie(*, http_domain: str, cookie_domain: str) -> bool: ...
```
Determines if a user-agent that receives an HTTP response from domain `<http_domain>`
with `Set-Cookie` headers with parameter `Domain=<cookie_domain>` should allow
that cookie to be set. This disallows cookies from being set on public suffixes
and on domains that the HTTP domain has no authority over.
This is the same mechanism that modern browsers use to determine whether it's safe
to set a cookie to prevent 'super-cookies'.
## License
MPL-2.0
Raw data
{
"_id": null,
"home_page": "https://github.com/sethmlarson/psl",
"name": "psl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Seth Michael Larson",
"author_email": "sethmichaellarson@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/42/bd/87af927155958b0d1251717aa45f018f2909a40716d8299979e1ff23ddd4/psl-2024.11.18.tar.gz",
"platform": null,
"description": "# psl\n\n[![Version](https://img.shields.io/pypi/v/psl)](https://pypi.org/project/psl)\n[![Downloads](https://pepy.tech/badge/psl)](https://pepy.tech/project/psl)\n![CI](https://img.shields.io/github/workflow/status/sethmlarson/psl/CI/master)\n\nMozilla Public Suffix list as a Python package and updated daily.\n\nInstall via `python -m pip install psl`\n\nSee https://publicsuffix.org for more information regarding the list itself.\n\n## API\n\nThe package provides the following members as an API:\n\n### `domain_suffixes()`\n\n```python\ndef domain_suffixes(dn: str, *, icann_only: bool=False) -> Suffixes: ...\n```\n\nQueries the Public Suffix list for the given domain and returns a named tuple containing\nthe public and private suffixes for the domain. Either value can be `None` if that\nfield isn't available. (eg `private=None` for the domain `com`)\n\n### `domain_can_set_cookie()`\n\n```python\ndef domain_can_set_cookie(*, http_domain: str, cookie_domain: str) -> bool: ...\n```\n\nDetermines if a user-agent that receives an HTTP response from domain `<http_domain>`\nwith `Set-Cookie` headers with parameter `Domain=<cookie_domain>` should allow\nthat cookie to be set. This disallows cookies from being set on public suffixes\nand on domains that the HTTP domain has no authority over.\n\nThis is the same mechanism that modern browsers use to determine whether it's safe\nto set a cookie to prevent 'super-cookies'.\n\n## License\n\nMPL-2.0\n",
"bugtrack_url": null,
"license": "MPL-2.0",
"summary": "Mozilla Public Suffix list as a Python package and updated daily",
"version": "2024.11.18",
"project_urls": {
"Homepage": "https://github.com/sethmlarson/psl"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "04d26b5a21a6b64ad064537b36743e4e9cbc3cf406db5ceb1130b63d7c3fb55a",
"md5": "3eaad95479f1a7091fbab992a931d874",
"sha256": "3645711e9b329095db619e919b04fc96ddd68a9bd15e36123a792e2ba2ca4f59"
},
"downloads": -1,
"filename": "psl-2024.11.18-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3eaad95479f1a7091fbab992a931d874",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 50456,
"upload_time": "2024-11-18T13:11:09",
"upload_time_iso_8601": "2024-11-18T13:11:09.578403Z",
"url": "https://files.pythonhosted.org/packages/04/d2/6b5a21a6b64ad064537b36743e4e9cbc3cf406db5ceb1130b63d7c3fb55a/psl-2024.11.18-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "42bd87af927155958b0d1251717aa45f018f2909a40716d8299979e1ff23ddd4",
"md5": "1ff2000ecc82d623b24496e15a1611b9",
"sha256": "2757cf5699a3cbc37537ae13e7d542b8c0a985c014a8611027baff21388a96e0"
},
"downloads": -1,
"filename": "psl-2024.11.18.tar.gz",
"has_sig": false,
"md5_digest": "1ff2000ecc82d623b24496e15a1611b9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 51633,
"upload_time": "2024-11-18T13:11:10",
"upload_time_iso_8601": "2024-11-18T13:11:10.781410Z",
"url": "https://files.pythonhosted.org/packages/42/bd/87af927155958b0d1251717aa45f018f2909a40716d8299979e1ff23ddd4/psl-2024.11.18.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 13:11:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sethmlarson",
"github_project": "psl",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "psl"
}