glizzy-tls


Nameglizzy-tls JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/glizzykingdreko/glizzy_tls
SummaryA fully open-source, cross-platform TLS implementation in Python, leveraging GoLang.
upload_time2024-01-01 18:54:51
maintainer
docs_urlNone
authorglizzykingdreko
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Glizzy TLS

![Banner](./image/logo.png)

Glizzy TLS is a Python module that brings the power and flexibility of Go's TLS implementation to Python. It's designed to offer TLS (Transport Layer Security) capabilities in Python while taking advantage of the performance benefits of Go.


## Table of Contents
- [Glizzy TLS](#glizzy-tls)
  - [Table of Contents](#table-of-contents)
  - [Disclaimer](#disclaimer)
  - [What is TLS?](#what-is-tls)
  - [Why Glizzy TLS?](#why-glizzy-tls)
  - [How is it done?](#how-is-it-done)
  - [Installation](#installation)
  - [Example Usage](#example-usage)
    - [Session Objects](#session-objects)
    - [Custom Client Hello](#custom-client-hello)
    - [Supported Parameters for `Session`](#supported-parameters-for-session)
    - [Supported Parameters for `request`](#supported-parameters-for-request)
  - [Contributing](#contributing)
  - [License](#license)
  - [Contact Me](#contact-me)
  

## Disclaimer
This is a first implementation of TLS in python for non supported platforms from other modules. I've quickly done it for a project I'm working on. I'll improve it by adding more features as soon as I can.

Check out the [source code on GitHub](https://github.com/glizzykingdreko/Glizzy-TLS)

## What is TLS?

Transport Layer Security (TLS) is a protocol that provides privacy and data integrity between two communicating applications. It's used for web browsers and other applications that require data to be securely exchanged over a network.

## Why Glizzy TLS?

While there are existing Python libraries for TLS, they can sometimes fall short in terms of performance and compatibility. Go has a robust and performant TLS library, and by compiling Go code to a shared object (`.so`) file and interfacing with it using CPython's `ctypes` library, Glizzy TLS brings this power to Python.

Moreover, the following key points make Glizzy TLS stand out:

- **Platform Independence**: Unlike other libraries that come with pre-compiled `.so` files, Glizzy TLS compiles the Go source code during installation. This means it can be used on any operating system without any modifications.
- **Open Source and Customizable**: The Go source code for the `.so` file is publicly available. This means you can make any edits or customizations that you need for your specific use case.
- **Shared Memory**: Glizzy TLS uses shared memory to communicate between Python and Go. This means that the data is not copied between the two languages, which can lead to significant performance improvements.
- **Shared cookies in Session Objects**: Session objects can be used to share cookies between requests. This is useful for applications that require authentication.

## How is it done?

The core of Glizzy TLS is the Go TLS implementation, which is compiled to a `.so` file during installation. This file is then loaded and interfaced with in Python using the `ctypes` library. This allows Python code to call the Go functions directly, offering a seamless integration between the two languages.

## Installation

You can install Glizzy TLS with pip:

```bash
pip install glizzy-tls
```

Please note that Glizzy TLS requires Go to be installed on your system. You can download it from [here](https://golang.org/dl/).

## Example Usage

Glizzy TLS is designed to be as simple as possible and follows the same structure as Python's `requests` library. Here's an example of a simple HTTPS request:

```python
import glizzy_tls

response = glizzy_tls.get("https://example.com")

print(response.status_code)
print(response.text)
```

### Session Objects
```python
from glizzy_tls import Session

# Create a TLS session
session = Session()
response = session.get("https://tls.peet.ws/api/all")
print(response.json()['tls']['ja3'])
```

### Custom Client Hello
```python
from glizzy_tls import Session

# Create a TLS session
session = Session(client_hello="chrome_112")
response = session.get("https://tls.peet.ws/api/all")

# Print the response
print(response.json()['tls']['ja3'])
```

See the [examples](examples) directory for more examples.

### Supported Parameters for `Session`
 - `client_hello`: The client hello to use. Defaults to `chrome_112`.

### Supported Parameters for `request`
 - `method`: The HTTP method to use. Defaults to `GET`.
 - `url`: The URL to request.
 - `headers`: A dictionary of headers to send with the request.
 - `body`: The body of the request.
 - `cookies`: A dictionary of cookies to send with the request.
 - `proxy`: The proxy to use. Defaults to `None`.
 - `follow_redirects`: Whether to follow redirects. Defaults to `True`.
 - `timeout_seconds`: The timeout in seconds. Defaults to `10`.
 - `details`: Whether to return detailed information about the request. Defaults to `False`. Will return a `RequestDetails` object instead of a `Response` object.


## Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.

## License

Glizzy TLS is licensed under the [MIT License](LICENSE).

## Contact Me

If you have any questions, issues or just want to connect, feel free to reach out or follow me on these platforms:

- [GitHub](https://github.com/Glizzykingdreko)
- [Twitter](https://twitter.com/Glizzykingdreko)
- [Medium](https://medium.com/@Glizzykingdreko)
- [Mail](mailto:glizzykingdreko@protonmail.com)  

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/glizzykingdreko/glizzy_tls",
    "name": "glizzy-tls",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "glizzykingdreko",
    "author_email": "glizzykingdreko@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/83/43/8544eb0291c99382f208ade179338b46fe21b830c64039a292ca51079d03/glizzy_tls-0.1.5.tar.gz",
    "platform": null,
    "description": "# Glizzy TLS\n\n![Banner](./image/logo.png)\n\nGlizzy TLS is a Python module that brings the power and flexibility of Go's TLS implementation to Python. It's designed to offer TLS (Transport Layer Security) capabilities in Python while taking advantage of the performance benefits of Go.\n\n\n## Table of Contents\n- [Glizzy TLS](#glizzy-tls)\n  - [Table of Contents](#table-of-contents)\n  - [Disclaimer](#disclaimer)\n  - [What is TLS?](#what-is-tls)\n  - [Why Glizzy TLS?](#why-glizzy-tls)\n  - [How is it done?](#how-is-it-done)\n  - [Installation](#installation)\n  - [Example Usage](#example-usage)\n    - [Session Objects](#session-objects)\n    - [Custom Client Hello](#custom-client-hello)\n    - [Supported Parameters for `Session`](#supported-parameters-for-session)\n    - [Supported Parameters for `request`](#supported-parameters-for-request)\n  - [Contributing](#contributing)\n  - [License](#license)\n  - [Contact Me](#contact-me)\n  \n\n## Disclaimer\nThis is a first implementation of TLS in python for non supported platforms from other modules. I've quickly done it for a project I'm working on. I'll improve it by adding more features as soon as I can.\n\nCheck out the [source code on GitHub](https://github.com/glizzykingdreko/Glizzy-TLS)\n\n## What is TLS?\n\nTransport Layer Security (TLS) is a protocol that provides privacy and data integrity between two communicating applications. It's used for web browsers and other applications that require data to be securely exchanged over a network.\n\n## Why Glizzy TLS?\n\nWhile there are existing Python libraries for TLS, they can sometimes fall short in terms of performance and compatibility. Go has a robust and performant TLS library, and by compiling Go code to a shared object (`.so`) file and interfacing with it using CPython's `ctypes` library, Glizzy TLS brings this power to Python.\n\nMoreover, the following key points make Glizzy TLS stand out:\n\n- **Platform Independence**: Unlike other libraries that come with pre-compiled `.so` files, Glizzy TLS compiles the Go source code during installation. This means it can be used on any operating system without any modifications.\n- **Open Source and Customizable**: The Go source code for the `.so` file is publicly available. This means you can make any edits or customizations that you need for your specific use case.\n- **Shared Memory**: Glizzy TLS uses shared memory to communicate between Python and Go. This means that the data is not copied between the two languages, which can lead to significant performance improvements.\n- **Shared cookies in Session Objects**: Session objects can be used to share cookies between requests. This is useful for applications that require authentication.\n\n## How is it done?\n\nThe core of Glizzy TLS is the Go TLS implementation, which is compiled to a `.so` file during installation. This file is then loaded and interfaced with in Python using the `ctypes` library. This allows Python code to call the Go functions directly, offering a seamless integration between the two languages.\n\n## Installation\n\nYou can install Glizzy TLS with pip:\n\n```bash\npip install glizzy-tls\n```\n\nPlease note that Glizzy TLS requires Go to be installed on your system. You can download it from [here](https://golang.org/dl/).\n\n## Example Usage\n\nGlizzy TLS is designed to be as simple as possible and follows the same structure as Python's `requests` library. Here's an example of a simple HTTPS request:\n\n```python\nimport glizzy_tls\n\nresponse = glizzy_tls.get(\"https://example.com\")\n\nprint(response.status_code)\nprint(response.text)\n```\n\n### Session Objects\n```python\nfrom glizzy_tls import Session\n\n# Create a TLS session\nsession = Session()\nresponse = session.get(\"https://tls.peet.ws/api/all\")\nprint(response.json()['tls']['ja3'])\n```\n\n### Custom Client Hello\n```python\nfrom glizzy_tls import Session\n\n# Create a TLS session\nsession = Session(client_hello=\"chrome_112\")\nresponse = session.get(\"https://tls.peet.ws/api/all\")\n\n# Print the response\nprint(response.json()['tls']['ja3'])\n```\n\nSee the [examples](examples) directory for more examples.\n\n### Supported Parameters for `Session`\n - `client_hello`: The client hello to use. Defaults to `chrome_112`.\n\n### Supported Parameters for `request`\n - `method`: The HTTP method to use. Defaults to `GET`.\n - `url`: The URL to request.\n - `headers`: A dictionary of headers to send with the request.\n - `body`: The body of the request.\n - `cookies`: A dictionary of cookies to send with the request.\n - `proxy`: The proxy to use. Defaults to `None`.\n - `follow_redirects`: Whether to follow redirects. Defaults to `True`.\n - `timeout_seconds`: The timeout in seconds. Defaults to `10`.\n - `details`: Whether to return detailed information about the request. Defaults to `False`. Will return a `RequestDetails` object instead of a `Response` object.\n\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.\n\n## License\n\nGlizzy TLS is licensed under the [MIT License](LICENSE).\n\n## Contact Me\n\nIf you have any questions, issues or just want to connect, feel free to reach out or follow me on these platforms:\n\n- [GitHub](https://github.com/Glizzykingdreko)\n- [Twitter](https://twitter.com/Glizzykingdreko)\n- [Medium](https://medium.com/@Glizzykingdreko)\n- [Mail](mailto:glizzykingdreko@protonmail.com)  \n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A fully open-source, cross-platform TLS implementation in Python, leveraging GoLang.",
    "version": "0.1.5",
    "project_urls": {
        "Homepage": "https://github.com/glizzykingdreko/glizzy_tls"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "19806b5a8e5118c977d18d717a6ca276259426c59ec478027ffef73d5364e08c",
                "md5": "f9a06372edd6a6a2aa9331a8911a9a49",
                "sha256": "0b9f8d63ed6a39cfb1bf990d14426c4e59f0becfe4f7cd59210a68db46d96f8b"
            },
            "downloads": -1,
            "filename": "glizzy_tls-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f9a06372edd6a6a2aa9331a8911a9a49",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 13111,
            "upload_time": "2024-01-01T18:54:49",
            "upload_time_iso_8601": "2024-01-01T18:54:49.471809Z",
            "url": "https://files.pythonhosted.org/packages/19/80/6b5a8e5118c977d18d717a6ca276259426c59ec478027ffef73d5364e08c/glizzy_tls-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "83438544eb0291c99382f208ade179338b46fe21b830c64039a292ca51079d03",
                "md5": "43763621944970dbbcf8a7f084ca49e4",
                "sha256": "ec37b9c321bf72ec4befa14294b9e989ce844d272982718ab37bdaeb334af784"
            },
            "downloads": -1,
            "filename": "glizzy_tls-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "43763621944970dbbcf8a7f084ca49e4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 13847,
            "upload_time": "2024-01-01T18:54:51",
            "upload_time_iso_8601": "2024-01-01T18:54:51.395163Z",
            "url": "https://files.pythonhosted.org/packages/83/43/8544eb0291c99382f208ade179338b46fe21b830c64039a292ca51079d03/glizzy_tls-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-01 18:54:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "glizzykingdreko",
    "github_project": "glizzy_tls",
    "github_not_found": true,
    "lcname": "glizzy-tls"
}
        
Elapsed time: 0.15382s