tls-client-updated


Nametls-client-updated JSON
Version 0.1.6 PyPI version JSON
download
home_page
SummaryAdvanced Python HTTP Client.
upload_time2022-12-08 15:49:40
maintainer
docs_urlNone
authorFlorian Zager
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python-TLS-Client
Python-TLS-Client is an advanced HTTP library based on requests and tls-client.

# Installation
```
pip install tls-client
```

# Examples
The syntax is inspired by [requests](https://github.com/psf/requests), so its very similar and there are only very few things that are different.

Example 1 - Preset:
```python
import tls_client

# You can also use the following as `client_identifier`:
# Chrome --> chrome_103, chrome_104, chrome_105, chrome_106, chrome_107
# Firefox --> firefox_102, firefox_104
# Opera --> opera_89, opera_90
# Safari --> safari_15_3, safari_15_6_1, safari_16_0
# iOS --> safari_ios_15_5, safari_ios_15_6, safari_ios_16_0
# iPadOS --> safari_ios_15_6

session = tls_client.Session(
    client_identifier="chrome_105"
)

res = session.get(
    "https://www.example.com/",
    headers={
        "key1": "value1",
    },
    proxy="http://user:password@host:port"
)
```

Example 2 - Custom:
```python
import tls_client

session = tls_client.Session(
    ja3_string="771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513,29-23-24,0",
    h2_settings={
        "HEADER_TABLE_SIZE": 65536,
        "MAX_CONCURRENT_STREAMS": 1000,
        "INITIAL_WINDOW_SIZE": 6291456,
        "MAX_HEADER_LIST_SIZE": 262144
    },
    h2_settings_order=[
        "HEADER_TABLE_SIZE",
        "MAX_CONCURRENT_STREAMS",
        "INITIAL_WINDOW_SIZE",
        "MAX_HEADER_LIST_SIZE"
    ],
    supported_signature_algorithms=[
        "ECDSAWithP256AndSHA256",
        "PSSWithSHA256",
        "PKCS1WithSHA256",
        "ECDSAWithP384AndSHA384",
        "PSSWithSHA384",
        "PKCS1WithSHA384",
        "PSSWithSHA512",
        "PKCS1WithSHA512",
    ],
    supported_versions=["GREASE", "1.3", "1.2"],
    key_share_curves=["GREASE", "X25519"],
    cert_compression_algo="brotli",
    pseudo_header_order=[
        ":method",
        ":authority",
        ":scheme",
        ":path"
    ],
    connection_flow=15663105,
    header_order=[
        "accept",
        "user-agent",
        "accept-encoding",
        "accept-language"
    ]
)

res = session.post(
    "https://www.example.com/",
    headers={
        "key1": "value1",
    },
    json={
        "key1": "key2"
    }
)
```

# Pyinstaller / Pyarmor
**If you want to pack the library with Pyinstaller or Pyarmor, make sure to add this to your command:**

Linux - Ubuntu / x86:
```
--add-binary '{path_to_library}/tls_client/dependencies/tls-client-x86.so:tls_client/dependencies'
```

Linux Alpine / AMD64:
```
--add-binary '{path_to_library}/tls_client/dependencies/tls-client-amd64.so:tls_client/dependencies'
```

MacOS M1 and older:
```
--add-binary '{path_to_library}/tls_client/dependencies/tls-client-x86.dylib:tls_client/dependencies'
```

MacOS M2:
```
--add-binary '{path_to_library}/tls_client/dependencies/tls-client-arm64.dylib:tls_client/dependencies'
```

Windows:
```
--add-binary '{path_to_library}/tls_client/dependencies/tls-client.dll;tls_client/dependencies'
```

# Acknowledgements
Big shout out to [Bogdanfinn](https://github.com/bogdanfinn) for open sourcing his [tls-client](https://github.com/bogdanfinn/tls-client) in Golang.
Also to [requests](https://github.com/psf/requests), as most of the cookie handling is copied from it. :'D
<br/>
I wanted to keep the syntax as similar as possible to requests, as most people use it and are familiar with it!



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tls-client-updated",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Florian Zager",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/8c/46/234c51aa088e5f4803a3d1ce93e161c85487e546e7807b38d023e02d9e58/tls_client_updated-0.1.6.tar.gz",
    "platform": null,
    "description": "# Python-TLS-Client\nPython-TLS-Client is an advanced HTTP library based on requests and tls-client.\n\n# Installation\n```\npip install tls-client\n```\n\n# Examples\nThe syntax is inspired by [requests](https://github.com/psf/requests), so its very similar and there are only very few things that are different.\n\nExample 1 - Preset:\n```python\nimport tls_client\n\n# You can also use the following as `client_identifier`:\n# Chrome --> chrome_103, chrome_104, chrome_105, chrome_106, chrome_107\n# Firefox --> firefox_102, firefox_104\n# Opera --> opera_89, opera_90\n# Safari --> safari_15_3, safari_15_6_1, safari_16_0\n# iOS --> safari_ios_15_5, safari_ios_15_6, safari_ios_16_0\n# iPadOS --> safari_ios_15_6\n\nsession = tls_client.Session(\n    client_identifier=\"chrome_105\"\n)\n\nres = session.get(\n    \"https://www.example.com/\",\n    headers={\n        \"key1\": \"value1\",\n    },\n    proxy=\"http://user:password@host:port\"\n)\n```\n\nExample 2 - Custom:\n```python\nimport tls_client\n\nsession = tls_client.Session(\n    ja3_string=\"771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513,29-23-24,0\",\n    h2_settings={\n        \"HEADER_TABLE_SIZE\": 65536,\n        \"MAX_CONCURRENT_STREAMS\": 1000,\n        \"INITIAL_WINDOW_SIZE\": 6291456,\n        \"MAX_HEADER_LIST_SIZE\": 262144\n    },\n    h2_settings_order=[\n        \"HEADER_TABLE_SIZE\",\n        \"MAX_CONCURRENT_STREAMS\",\n        \"INITIAL_WINDOW_SIZE\",\n        \"MAX_HEADER_LIST_SIZE\"\n    ],\n    supported_signature_algorithms=[\n        \"ECDSAWithP256AndSHA256\",\n        \"PSSWithSHA256\",\n        \"PKCS1WithSHA256\",\n        \"ECDSAWithP384AndSHA384\",\n        \"PSSWithSHA384\",\n        \"PKCS1WithSHA384\",\n        \"PSSWithSHA512\",\n        \"PKCS1WithSHA512\",\n    ],\n    supported_versions=[\"GREASE\", \"1.3\", \"1.2\"],\n    key_share_curves=[\"GREASE\", \"X25519\"],\n    cert_compression_algo=\"brotli\",\n    pseudo_header_order=[\n        \":method\",\n        \":authority\",\n        \":scheme\",\n        \":path\"\n    ],\n    connection_flow=15663105,\n    header_order=[\n        \"accept\",\n        \"user-agent\",\n        \"accept-encoding\",\n        \"accept-language\"\n    ]\n)\n\nres = session.post(\n    \"https://www.example.com/\",\n    headers={\n        \"key1\": \"value1\",\n    },\n    json={\n        \"key1\": \"key2\"\n    }\n)\n```\n\n# Pyinstaller / Pyarmor\n**If you want to pack the library with Pyinstaller or Pyarmor, make sure to add this to your command:**\n\nLinux - Ubuntu / x86:\n```\n--add-binary '{path_to_library}/tls_client/dependencies/tls-client-x86.so:tls_client/dependencies'\n```\n\nLinux Alpine / AMD64:\n```\n--add-binary '{path_to_library}/tls_client/dependencies/tls-client-amd64.so:tls_client/dependencies'\n```\n\nMacOS M1 and older:\n```\n--add-binary '{path_to_library}/tls_client/dependencies/tls-client-x86.dylib:tls_client/dependencies'\n```\n\nMacOS M2:\n```\n--add-binary '{path_to_library}/tls_client/dependencies/tls-client-arm64.dylib:tls_client/dependencies'\n```\n\nWindows:\n```\n--add-binary '{path_to_library}/tls_client/dependencies/tls-client.dll;tls_client/dependencies'\n```\n\n# Acknowledgements\nBig shout out to [Bogdanfinn](https://github.com/bogdanfinn) for open sourcing his [tls-client](https://github.com/bogdanfinn/tls-client) in Golang.\nAlso to [requests](https://github.com/psf/requests), as most of the cookie handling is copied from it. :'D\n<br/>\nI wanted to keep the syntax as similar as possible to requests, as most people use it and are familiar with it!\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Advanced Python HTTP Client.",
    "version": "0.1.6",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "084150753535ac42efb23f9e45216fe2",
                "sha256": "2f92b7ca001575ecafef78bcc14b0731180f554a0823bc558dcd7c7814780da5"
            },
            "downloads": -1,
            "filename": "tls_client_updated-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "084150753535ac42efb23f9e45216fe2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 29886863,
            "upload_time": "2022-12-08T15:48:35",
            "upload_time_iso_8601": "2022-12-08T15:48:35.178365Z",
            "url": "https://files.pythonhosted.org/packages/5f/fc/8f29c1d00bc09f9906fc292a5591807e40249cd8b13fc51f54659d05db46/tls_client_updated-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "c10d6fe07c5bd8fbff77fd5ae064fb32",
                "sha256": "2521c190bc5ba126f25a82ba0bb4ec8e7acd506a8f691fe74bd9125c50ff5ecc"
            },
            "downloads": -1,
            "filename": "tls_client_updated-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "c10d6fe07c5bd8fbff77fd5ae064fb32",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 29757305,
            "upload_time": "2022-12-08T15:49:40",
            "upload_time_iso_8601": "2022-12-08T15:49:40.208095Z",
            "url": "https://files.pythonhosted.org/packages/8c/46/234c51aa088e5f4803a3d1ce93e161c85487e546e7807b38d023e02d9e58/tls_client_updated-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-08 15:49:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "tls-client-updated"
}
        
Elapsed time: 0.03858s