crx3


Namecrx3 JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/liying2008/python-crx3
SummaryChrome extension (crx) packaging & parsing library.
upload_time2024-12-11 11:53:38
maintainerNone
docs_urlNone
authorliying
requires_python>=3.7
licenseMIT
keywords crx chrome edge extension
VCS
bugtrack_url
requirements cryptography protobuf
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CRX3

[![PyPI](https://img.shields.io/pypi/v/crx3)](https://pypi.org/project/crx3/)
[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/crx3.svg)](https://pypi.python.org/pypi/crx3/)
[![Downloads](https://static.pepy.tech/badge/crx3)](https://pepy.tech/project/crx3)
[![GitHub Actions (Tests)](https://github.com/liying2008/python-crx3/actions/workflows/tests.yml/badge.svg)](https://github.com/liying2008/python-crx3/actions/workflows/tests.yml)

**crx3** is a python library for packaging and parsing crx files.

## Installation

`crx3` is available on PyPI:

```console
$ python -m pip install crx3
```

crx3 officially supports Python 3.7+.

## Functions

- Create a private key for signing the crx file.

```python
from crx3 import creator

creator.create_private_key_file('output/example-extension.pem')
```

- Packaging a zip file or extension code directory to a crx file.

```python
from crx3 import creator

creator.create_crx_file('example/example-extension', 'example/example-extension.pem', 'output/example-extension.crx')
```

- Verify if a file is a valid crx version 3 file.

```python
from crx3 import verifier

verifier_result, header_info = verifier.verify('example/example-extension.crx')

assert verifier_result == verifier.VerifierResult.OK_FULL
assert header_info.crx_id == 'jjomgndeajdmncfenopimafofpnflcfo'
assert header_info.public_key == 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMI...FkbU7H8sDQIDAQAB'
```

## Commands

- **Create a crx file.**

`crx3 create [-pk PRIVATE_KEY_FILE] [-o OUTPUT_FILE] [-v] source`

```
usage: crx3 create [-h] [-pk PRIVATE_KEY_FILE] [-o OUTPUT_FILE] [-v] source

positional arguments:
  source                zip file or directory to be packed

options:
  -h, --help            show this help message and exit
  -pk PRIVATE_KEY_FILE, --private-key PRIVATE_KEY_FILE
                        private key file to be used for signing. If not specified, the program automatically creates a new one and saves it to the same directory as the crx file
  -o OUTPUT_FILE, --output OUTPUT_FILE
                        path to the output crx file
  -v, --verbose         print more information
```

- **Verify that a crx file is valid.**

`crx3 verify [-v] crx_file`

```
usage: crx3 verify [-h] [-v] crx_file
positional arguments:
  crx_file       crx file

options:
  -h, --help     show this help message and exit
  -v, --verbose  print more information
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/liying2008/python-crx3",
    "name": "crx3",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "crx chrome edge extension",
    "author": "liying",
    "author_email": "liruoer2008@yeah.net",
    "download_url": "https://files.pythonhosted.org/packages/85/48/cf91e74ff96198f0566014113fe8b83108560b39198d539d98b2c7fde59b/crx3-0.0.4.tar.gz",
    "platform": "unix",
    "description": "# CRX3\r\n\r\n[![PyPI](https://img.shields.io/pypi/v/crx3)](https://pypi.org/project/crx3/)\r\n[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/crx3.svg)](https://pypi.python.org/pypi/crx3/)\r\n[![Downloads](https://static.pepy.tech/badge/crx3)](https://pepy.tech/project/crx3)\r\n[![GitHub Actions (Tests)](https://github.com/liying2008/python-crx3/actions/workflows/tests.yml/badge.svg)](https://github.com/liying2008/python-crx3/actions/workflows/tests.yml)\r\n\r\n**crx3** is a python library for packaging and parsing crx files.\r\n\r\n## Installation\r\n\r\n`crx3` is available on PyPI:\r\n\r\n```console\r\n$ python -m pip install crx3\r\n```\r\n\r\ncrx3 officially supports Python 3.7+.\r\n\r\n## Functions\r\n\r\n- Create a private key for signing the crx file.\r\n\r\n```python\r\nfrom crx3 import creator\r\n\r\ncreator.create_private_key_file('output/example-extension.pem')\r\n```\r\n\r\n- Packaging a zip file or extension code directory to a crx file.\r\n\r\n```python\r\nfrom crx3 import creator\r\n\r\ncreator.create_crx_file('example/example-extension', 'example/example-extension.pem', 'output/example-extension.crx')\r\n```\r\n\r\n- Verify if a file is a valid crx version 3 file.\r\n\r\n```python\r\nfrom crx3 import verifier\r\n\r\nverifier_result, header_info = verifier.verify('example/example-extension.crx')\r\n\r\nassert verifier_result == verifier.VerifierResult.OK_FULL\r\nassert header_info.crx_id == 'jjomgndeajdmncfenopimafofpnflcfo'\r\nassert header_info.public_key == 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMI...FkbU7H8sDQIDAQAB'\r\n```\r\n\r\n## Commands\r\n\r\n- **Create a crx file.**\r\n\r\n`crx3 create [-pk PRIVATE_KEY_FILE] [-o OUTPUT_FILE] [-v] source`\r\n\r\n```\r\nusage: crx3 create [-h] [-pk PRIVATE_KEY_FILE] [-o OUTPUT_FILE] [-v] source\r\n\r\npositional arguments:\r\n  source                zip file or directory to be packed\r\n\r\noptions:\r\n  -h, --help            show this help message and exit\r\n  -pk PRIVATE_KEY_FILE, --private-key PRIVATE_KEY_FILE\r\n                        private key file to be used for signing. If not specified, the program automatically creates a new one and saves it to the same directory as the crx file\r\n  -o OUTPUT_FILE, --output OUTPUT_FILE\r\n                        path to the output crx file\r\n  -v, --verbose         print more information\r\n```\r\n\r\n- **Verify that a crx file is valid.**\r\n\r\n`crx3 verify [-v] crx_file`\r\n\r\n```\r\nusage: crx3 verify [-h] [-v] crx_file\r\npositional arguments:\r\n  crx_file       crx file\r\n\r\noptions:\r\n  -h, --help     show this help message and exit\r\n  -v, --verbose  print more information\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Chrome extension (crx) packaging & parsing library.",
    "version": "0.0.4",
    "project_urls": {
        "Bug Reports": "https://github.com/liying2008/python-crx3/issues",
        "Homepage": "https://github.com/liying2008/python-crx3",
        "Source Code": "https://github.com/liying2008/python-crx3"
    },
    "split_keywords": [
        "crx",
        "chrome",
        "edge",
        "extension"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eb1c1105e3459ad20d561baca18fab29a92dd927e190924a37b930c99747c63a",
                "md5": "6c8dfce3b86b6161a4bee564c9c3ae25",
                "sha256": "ee6da373fefb658e215ea2348ed0fe817e214851c2d29fa3511d6d65a9682229"
            },
            "downloads": -1,
            "filename": "crx3-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6c8dfce3b86b6161a4bee564c9c3ae25",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 15345,
            "upload_time": "2024-12-11T11:53:36",
            "upload_time_iso_8601": "2024-12-11T11:53:36.361313Z",
            "url": "https://files.pythonhosted.org/packages/eb/1c/1105e3459ad20d561baca18fab29a92dd927e190924a37b930c99747c63a/crx3-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8548cf91e74ff96198f0566014113fe8b83108560b39198d539d98b2c7fde59b",
                "md5": "081876ab6be1ea364ca3bc63b2ec37e7",
                "sha256": "21a150fba265bcdc16d44bfdb456e6ea8804edf0f3cde50524f381502229f636"
            },
            "downloads": -1,
            "filename": "crx3-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "081876ab6be1ea364ca3bc63b2ec37e7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 14054,
            "upload_time": "2024-12-11T11:53:38",
            "upload_time_iso_8601": "2024-12-11T11:53:38.929809Z",
            "url": "https://files.pythonhosted.org/packages/85/48/cf91e74ff96198f0566014113fe8b83108560b39198d539d98b2c7fde59b/crx3-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-11 11:53:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "liying2008",
    "github_project": "python-crx3",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "cryptography",
            "specs": [
                [
                    ">=",
                    "40.0.2"
                ]
            ]
        },
        {
            "name": "protobuf",
            "specs": [
                [
                    ">=",
                    "3.19.6"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "crx3"
}
        
Elapsed time: 3.27227s