Registry / devops / clldutils

clldutils

JSON →
library4.0.0pypypi✓ verified 85d ago

A Python library providing utility functions for programmatic data curation, including JSON/LD manipulation, textual data handling, and CLI tools. Current version is 4.0.0, released under a regular cadence.

pip install clldutils
INSTALL
IMPORT
SIG · CLLDUTILS
C
clldutils
devopspythonv4.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jsonlib
from clldutils import jsonlib
from clldutils.jsonlib import something
jsonlib is a module, not a direct attribute. Use from clldutils import jsonlib then jsonlib.load()
text
from clldutils import text
import clldutils.text
text is a submodule, but the correct import is from clldutils import text

Basic usage: load JSON from file or URL.

from clldutils import jsonlib from clldutils import url import os data = jsonlib.load('data.json') print(data) # Example with auth api_key = os.environ.get('API_KEY', '') response = jsonlib.load(url='https://api.example.com/data', headers={'Authorization': f'Bearer {api_key}'}) print(response)
Debug
Known issues
breakingThe 'jsonlib' module's `load()` function no longer accepts `lazy=True` parameter for loading JSON lines.
fix
Use `jsonlib.load()` without `lazy` for regular JSON. For line-delimited JSON, use `jsonlib.iterload()`.
affects: >=4.0.0
deprecatedThe `clldutils.url.open_url()` function is deprecated. Use `requests.get()` directly.
fix
Replace with `requests.get(url, headers=...)` and handle responses manually.
affects: >=4.0.0
gotchaImporting submodules directly (e.g., `import clldutils.jsonlib`) may not work if not installed correctly. Always use `from clldutils import jsonlib`.
fix
Use `from clldutils import jsonlib` for correct module resolution.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'jsonlib' from 'clldutils'
Incorrect import path or missing module.
fix
Ensure clldutils is installed: `pip install clldutils`. Then use `from clldutils import jsonlib`.
TypeError: load() got an unexpected keyword argument 'lazy'
Using `lazy=True` parameter in clldutils.jsonlib.load() which was removed in version 4.0.0.
fix
Remove the `lazy` argument. For line-delimited JSON, use `jsonlib.iterload()` with a file-like object.
ModuleNotFoundError: No module named 'clldutils.text'
Attempting to import the `text` submodule as a top-level import.
fix
Import as `from clldutils import text`, then use `text.normalize()` etc.
Upgrade
Version history
4.0.0latest on PyPI · released May 5, 2026
Audit
Dependencies
clickrequiredCLI interface framework
requestsrequiredHTTP requests
Agent activity
4 hits · last 30 days
node
4
Resources
clldutils — pip install clldutils · libregistry