Skip to main content

Chrome extension (crx) packaging & parsing library.

Project description

CRX3

PyPI PyPI Supported Python Versions Downloads GitHub Actions (Tests)

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

Installation

crx3 is available on PyPI:

$ python -m pip install crx3

crx3 officially supports Python 3.7+.

Functions

  • Create a private key for signing the crx file.
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.
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.
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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crx3-0.0.4.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

crx3-0.0.4-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file crx3-0.0.4.tar.gz.

File metadata

  • Download URL: crx3-0.0.4.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for crx3-0.0.4.tar.gz
Algorithm Hash digest
SHA256 21a150fba265bcdc16d44bfdb456e6ea8804edf0f3cde50524f381502229f636
MD5 081876ab6be1ea364ca3bc63b2ec37e7
BLAKE2b-256 8548cf91e74ff96198f0566014113fe8b83108560b39198d539d98b2c7fde59b

See more details on using hashes here.

File details

Details for the file crx3-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: crx3-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for crx3-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ee6da373fefb658e215ea2348ed0fe817e214851c2d29fa3511d6d65a9682229
MD5 6c8dfce3b86b6161a4bee564c9c3ae25
BLAKE2b-256 eb1c1105e3459ad20d561baca18fab29a92dd927e190924a37b930c99747c63a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page