chompjs
Parsing JavaScript objects into Python dictionaries
Decision gist · record as of 2026-08-14
Yes. Chompjs solves a real web-scraping problem—parsing non-standard JavaScript objects that json.loads cannot handle—with active maintenance, no security vulnerabilities, permissive licensing, and broad platform support. Install friction is moderate but manageable; prebuilt wheels cover modern Python versions and common architectures.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; compiled wheels available for common platforms but source build may require a C compiler.
- Medium install friction due to compiled C extension wheels, but well-supported across modern Python versions on major platforms (macOS ARM64, Linux x86_64, Windows).
- Active maintenance with recent release.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive); no restrictions on use, modification, or redistribution in commercial or private projects.
last release 2026-05-17 (89 days) · last repo commit 2026-05-17 · 222 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 98,116 downloads/mo, #13,106 on PyPI
Alternatives
Verify before relying
pip install chompjs
import chompjs
# Parse single JavaScript object
result = chompjs.parse_js_object("{a: 100}")
print(result) # {'a': 100}
# Parse multiple objects from text
for obj in chompjs.parse_js_objects("{'x': 1}\n{'y': 2}"):
print(obj)- Performance comparison to other JavaScript parsers under typical scraping workloads.
- Whether the C parser handles all edge cases of JavaScript object syntax or has known limitations.
- Specific Python version support beyond the stated 3.9 minimum requirement.
What it is and what it does
Chompjs is a JavaScript-to-Python object parser designed for web scraping. It transforms JavaScript objects embedded in HTML pages into valid Python dictionaries, handling syntax that the standard library's json.loads rejects—such as unquoted keys, single-quoted strings, trailing commas, and leading-decimal floats. The library uses a C-based parser to normalize the input, then passes the result to json.loads for final conversion, balancing speed with correctness.
The package supports JSON5 syntax and offers two main functions: parse_js_object for extracting a single object (raises ValueError on failure) and parse_js_objects as a generator for multiple objects or JSON Lines. It integrates easily into web scrapers and allows custom JSON loaders and loader options to be passed through.
Use it for
- Extract __NEXT_DATA__ or __PRELOADED_STATE__ from server-rendered web pages during scraping.
- Parse JavaScript configuration objects embedded in HTML script tags into Python dicts.
- Read JSON Lines files that may contain JavaScript-style syntax variations.
- Handle web pages where JSON is embedded with unquoted keys or single quotes instead of double quotes.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Chompjs solves a real web-scraping problem—parsing non-standard JavaScript objects that json.loads cannot handle—with active maintenance, no security vulnerabilities, permissive licensing, and broad platform support. Install friction is moderate but manageable; prebuilt wheels cover modern Python versions and common architectures.
Install
chompjs on PyPI
Before you install
Medium install friction due to compiled C extension wheels, but well-supported across modern Python versions on major platforms (macOS ARM64, Linux x86_64, Windows). Active maintenance with recent release.
Requires Python 3.9 or later; compiled wheels available for common platforms but source build may require a C compiler.
License in practice
MIT license (permissive); no restrictions on use, modification, or redistribution in commercial or private projects.
Quickstart
pip install chompjs
import chompjs
# Parse single JavaScript object
result = chompjs.parse_js_object("{a: 100}")
print(result) # {'a': 100}
# Parse multiple objects from text
for obj in chompjs.parse_js_objects("{'x': 1}\n{'y': 2}"):
print(obj)
Verify before relying
- Performance comparison to other JavaScript parsers under typical scraping workloads.
- Whether the C parser handles all edge cases of JavaScript object syntax or has known limitations.
- Specific Python version support beyond the stated 3.9 minimum requirement.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 89 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 98,116 / month, #13,106 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: JavaScriptProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: GeneralTopic :: Text Processing :: Linguistic |
Evidence: chompjs-1.4.1-cp310-cp310-macosx_11_0_arm64.whl; chompjs-1.4.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; chompjs-1.4.1-cp310-cp310-musllinux_1_2_x86_64.whl; chompjs-1.4.1-cp310-cp310-win32.whl; chompjs-1.4.1-cp310-cp310-win_amd64.whl; chompjs-1.4.1-cp311-cp311-macosx_11_0_arm64.whl; chompjs-1.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; chompjs-1.4.1-cp311-cp311-musllinux_1_2_x86_64.whl; chompjs-1.4.1-cp311-cp311-win32.whl; chompjs-1.4.1-cp311-cp311-win_amd64.whl; chompjs-1.4.1-cp312-cp312-macosx_11_0_arm64.whl; chompjs-1.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; chompjs-1.4.1-cp312-cp312-musllinux_1_2_x86_64.whl; chompjs-1.4.1-cp312-cp312-win32.whl; chompjs-1.4.1-cp312-cp312-win_amd64.whl; chompjs-1.4.1-cp313-cp313-macosx_11_0_arm64.whl; chompjs-1.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; chompjs-1.4.1-cp313-cp313-musllinux_1_2_x86_64.whl; chompjs-1.4.1-cp313-cp313-win32.whl; chompjs-1.4.1-cp313-cp313-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “javascript object parser”
- chompjsParses JavaScript objects embedded in HTML or text into Python…
- dirtyjsonParses JSON-like data from files containing syntax violations—single…
- pyleriPyleri is a left-right parser generator that lets you define a…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also json5 · json5kit · fix-busted-json · pybacklogpy · demjson3 · partialjson · pyjson5 · dirtyjson · json-five · itemloaders