{"id":1421,"library":"cligj","title":"cligj - Click parameters for GeoJSON CLIs","description":"cligj provides a collection of reusable Click parameter and option decorators specifically designed for building command-line interfaces that interact with GeoJSON data. It simplifies handling GeoJSON input/output, feature processing, and related geospatial concerns within Click applications. The current version is 0.7.2, and it maintains a stable release cadence typical for a mature utility library.","status":"active","version":"0.7.2","language":"python","source_language":"en","source_url":"https://github.com/mapbox/cligj","tags":["geojson","cli","click","geospatial","mapbox"],"install":[{"cmd":"pip install cligj","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core dependency for creating command-line interfaces.","package":"click","optional":false},{"reason":"Used for parsing and serializing GeoJSON data structures.","package":"geojson","optional":false}],"imports":[{"wrong":"from cligj import features_in_info","symbol":"features_in_arg","correct":"from cligj import features_in_arg"}],"quickstart":{"code":"import click\nimport json\nimport sys\nfrom cligj import features_in_info\n\n@click.command()\n@features_in_info\ndef cli(src_features):\n    \"\"\"\n    Reads GeoJSON features from stdin, adds a feature index to properties,\n    and writes the modified features to stdout as a GeoJSON sequence.\n\n    Usage example:\n    echo '{\"type\":\"Feature\",\"properties\":{},\"geometry\":null}' | python your_script.py\n    \"\"\"\n    for f, i in src_features:\n        f['properties']['f_idx'] = i['f_idx']\n        click.echo(json.dumps(f))\n\nif __name__ == '__main__':\n    cli()","lang":"python","description":"This quickstart demonstrates how to use `cligj.features_in_info` to create a Click command that reads GeoJSON features from standard input, adds a new property indicating the feature's index in the input stream, and writes the modified features as a GeoJSON sequence to standard output. It's a common pattern for processing streamable GeoJSON data."},"warnings":[{"fix":"Replace `cligj.old_precision_opt()` with `cligj.precision_opt()` in your Click commands to use the clearer and officially supported option.","message":"The `cligj.old_precision_opt` decorator is deprecated. While still functional, it's recommended to switch to `cligj.precision_opt` for explicit control over GeoJSON floating-point precision.","severity":"deprecated","affected_versions":"0.5.0 and later"},{"fix":"Use `features_in_info` when your command processes GeoJSON features one by one. Use `io_in_info` when your command expects a single GeoJSON object or needs direct control over the input/output streams for tasks like validation or transformation of the entire GeoJSON structure.","message":"Users often confuse `cligj.features_in_info` and `cligj.io_in_info`. `features_in_info` is for iterating individual GeoJSON features, typically from a FeatureCollection or a GeoJSON sequence. `io_in_info` provides file-like objects for the entire input/output stream, suitable for commands that read or write a single GeoJSON object or need byte-level control.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Develop new applications and maintain existing ones on Python 3 (preferably 3.8+). If you must interact with legacy Python 2 code, ensure thorough testing and be prepared for potential maintenance challenges.","message":"While `cligj` technically supports Python 2.7, Python 2 reached End-of-Life in 2020. New projects and ongoing development should exclusively target Python 3. Although the library's `requires_python` range supports 2.7, relying on it for new work is discouraged and may lead to compatibility issues with other modern dependencies.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'0.7.2':49 'applic':44 'build':21 'cadenc':56 'cli':64 'click':2,13,43,65 'cligj':1,7 'clis':6 'collect':10 'command':23 'command-lin':22 'concern':41 'current':46 'data':30 'decor':17 'design':19 'featur':36 'geojson':5,29,34,63 'geospati':40,66 'handl':33 'input/output':35 'interact':27 'interfac':25 'librari':62 'line':24 'maintain':52 'mapbox':67 'matur':60 'option':16 'paramet':3,14 'process':37 'provid':8 'relat':39 'releas':55 'reusabl':12 'simplifi':32 'specif':18 'stabl':54 'typic':57 'util':61 'version':47 'within':42","created_at":"2026-04-09T03:47:12.758751+00:00","updated_at":"2026-04-16T02:34:52.708468+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":0,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.7.2","cli_name":"cligj","cli_version":"sh: 1: cligj: not found","type":"library","homepage":null,"github":"https://github.com/mapbox/cligj","docs":null,"changelog":null,"pypi":"https://pypi.org/project/cligj/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-08-27","next_check":"2026-07-30","install_tag":"stale"}}