{"id":16265013,"url":"https://github.com/florianregaz/python-tls-client","last_synced_at":"2025-05-14T23:07:05.993Z","repository":{"id":59917407,"uuid":"537889219","full_name":"FlorianREGAZ/Python-Tls-Client","owner":"FlorianREGAZ","description":"Advanced HTTP Library","archived":false,"fork":false,"pushed_at":"2024-07-30T07:11:28.000Z","size":285807,"stargazers_count":766,"open_issues_count":70,"forks_count":154,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-14T23:06:49.462Z","etag":null,"topics":["client","http","http2","python","tls","tls-client"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FlorianREGAZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-17T17:56:37.000Z","updated_at":"2025-05-13T08:11:59.000Z","dependencies_parsed_at":"2024-01-14T04:40:05.067Z","dependency_job_id":"1ba755ea-5a5a-4de6-bc2a-b4d56f0b56a3","html_url":"https://github.com/FlorianREGAZ/Python-Tls-Client","commit_stats":{"total_commits":102,"total_committers":10,"mean_commits":10.2,"dds":"0.37254901960784315","last_synced_commit":"ab6c7362564ba703f3c623a79304db3a686e5f91"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianREGAZ%2FPython-Tls-Client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianREGAZ%2FPython-Tls-Client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianREGAZ%2FPython-Tls-Client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianREGAZ%2FPython-Tls-Client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FlorianREGAZ","download_url":"https://codeload.github.com/FlorianREGAZ/Python-Tls-Client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243362,"owners_count":22038046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","http","http2","python","tls","tls-client"],"created_at":"2024-10-10T17:05:22.759Z","updated_at":"2025-05-14T23:07:00.983Z","avatar_url":"https://github.com/FlorianREGAZ.png","language":"Python","readme":"# 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 --\u003e chrome_103, chrome_104, chrome_105, chrome_106, chrome_107, chrome_108, chrome109, Chrome110,\n#            chrome111, chrome112, chrome_116_PSK, chrome_116_PSK_PQ, chrome_117, chrome_120\n# Firefox --\u003e firefox_102, firefox_104, firefox108, Firefox110, firefox_117, firefox_120\n# Opera --\u003e opera_89, opera_90\n# Safari --\u003e safari_15_3, safari_15_6_1, safari_16_0\n# iOS --\u003e safari_ios_15_5, safari_ios_15_6, safari_ios_16_0\n# iPadOS --\u003e safari_ios_15_6\n# Android --\u003e okhttp4_android_7, okhttp4_android_8, okhttp4_android_9, okhttp4_android_10, okhttp4_android_11,\n#             okhttp4_android_12, okhttp4_android_13\n#\n# more client identifiers can be found in settings.py\n\nsession = tls_client.Session(\n    client_identifier=\"chrome112\",\n    random_tls_extension_order=True\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-64.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 I wanted to keep the syntax as similar as possible to [requests](https://github.com/psf/requests), as most people use it and are familiar with it!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorianregaz%2Fpython-tls-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflorianregaz%2Fpython-tls-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorianregaz%2Fpython-tls-client/lists"}