psl


Namepsl JSON
Version 2024.4.1 PyPI version JSON
download
home_pagehttps://github.com/sethmlarson/psl
SummaryMozilla Public Suffix list as a Python package and updated daily
upload_time2024-04-01 13:04:12
maintainerNone
docs_urlNone
authorSeth Michael Larson
requires_python>=3.6
licenseMPL-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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/46/e5/9e715514ddc1429cb2cc54c4660ef55df2c824d66212e54845fdffec9a24/psl-2024.4.1.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.4.1",
    "project_urls": {
        "Homepage": "https://github.com/sethmlarson/psl"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a4221343f1666028c3bddd8e018e3bdcac64147a3126c08fc526dd6839d492d2",
                "md5": "c62512c21a61207e38e59cf132c2a9e6",
                "sha256": "1b69c901c72a6a5fe5116a1fcf804ace027280ee98a8255802be62bfb32d437a"
            },
            "downloads": -1,
            "filename": "psl-2024.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c62512c21a61207e38e59cf132c2a9e6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 49943,
            "upload_time": "2024-04-01T13:04:09",
            "upload_time_iso_8601": "2024-04-01T13:04:09.372046Z",
            "url": "https://files.pythonhosted.org/packages/a4/22/1343f1666028c3bddd8e018e3bdcac64147a3126c08fc526dd6839d492d2/psl-2024.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "46e59e715514ddc1429cb2cc54c4660ef55df2c824d66212e54845fdffec9a24",
                "md5": "8018ba95ab196982ae9c53eaa110a379",
                "sha256": "e9d8a149ba16c9a4e70bd30d12d86b1a6cf3e2fcb2c58be6f672d0ebcd49d1d3"
            },
            "downloads": -1,
            "filename": "psl-2024.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8018ba95ab196982ae9c53eaa110a379",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 51151,
            "upload_time": "2024-04-01T13:04:12",
            "upload_time_iso_8601": "2024-04-01T13:04:12.883016Z",
            "url": "https://files.pythonhosted.org/packages/46/e5/9e715514ddc1429cb2cc54c4660ef55df2c824d66212e54845fdffec9a24/psl-2024.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-01 13:04:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sethmlarson",
    "github_project": "psl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "psl"
}
        
Elapsed time: 0.23006s