{"id":20049430,"url":"https://github.com/weaming/objectify-json","last_synced_at":"2026-02-17T17:33:03.720Z","repository":{"id":57447618,"uuid":"153756222","full_name":"weaming/objectify-json","owner":"weaming","description":"Make accessing JSON data more convenient.","archived":false,"fork":false,"pushed_at":"2019-06-17T06:36:17.000Z","size":30,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T05:44:08.042Z","etag":null,"topics":["cli","dict","lambda"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weaming.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-19T09:07:52.000Z","updated_at":"2020-02-24T11:00:44.000Z","dependencies_parsed_at":"2022-09-15T22:12:21.020Z","dependency_job_id":null,"html_url":"https://github.com/weaming/objectify-json","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/weaming/objectify-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fobjectify-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fobjectify-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fobjectify-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fobjectify-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weaming","download_url":"https://codeload.github.com/weaming/objectify-json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fobjectify-json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29551257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","dict","lambda"],"created_at":"2024-11-13T11:50:00.167Z","updated_at":"2026-02-17T17:33:03.688Z","avatar_url":"https://github.com/weaming.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Objectify JSON\n\nMake accessing JSON like data more convenient.\n\n## Features\n\n* Access dict value via dot `.` (`data.a.b.c`).\n* Always return `ObjectifyJSON` type, which holds the data with type of dict, list or any other primitive types.\n* Use `x._data` to get the real data.\n* Always return `ObjectifyJSON(None)` if doesn't exist.\n* An CLI tool named `object` to process JSON data.\n\n## Install\n\n```\npip3 install objectify-json\n```\n\n## Example\n\nSee `test.py`\n\n## Functions to process data in batch\n\n* The return value is always `ObjectifyJOSN` too!\n* The return value of lambda funtions will always be unwrapped to primitive types.\n* Most of the `fn_*` functions accept optional `unwrap` parameter to enable passing the underlying value as primitive types to lambda. Default is False.\n* When used in CLI tool, if it failed getting the property by property name, e.g. `map`, it will retry to get function with prefix `fn_` added to the name. This will simplify writting the CLI command.\n\n### Common\n\nFollowing methods of `ObjectifyJOSN` accept optional `unwrap` to unwrap `ObjectifyJOSN` data to the underlying built-in data, the default value is `False`.\n\n* `fn_map(fn, unwrap=False)`: `map` on the iterator\n* `fn_reduce(fn, initializer=None, unwrap=False)`: `reduce` on the iterator, lambda as the first positional parameter, optional `initializer` parameter will be passed to built-in `reduce`.\n* `fn_lambda(fn, unwrap=False)`: value in-and-out\n* `fn_filter(fn, unwrap=False)`: `filter` on the iterator\n\n### Dict\n\n* `fn_keys()`: Return keys as list.\n* `fn_values()`: Return values as list.\n* `fn_items()`: Return items as list. Element has the type `tuple`, e.g. `(\"key\", \"value\")`.\n* `fn_include_keys(keys)`: Filter dict. Keep the `keys` you give.\n* `fn_exclude_keys(keys)`: Filter dict. Remove the `keys` you give.\n* `fn_filter_by_value(fn)`: Filter dict. Filter by the lambda you give, which accept the value of dict item.\n* `fn_filter_by_kv(fn)`: Filter dict. Filter by the lambda you give, which accept `key` and `value` two variables.\n* `fn_update(key, fn, unwrap=False)`: Update dict value. The lambda you give accept the origin value and return a new value.\n* `fn_items_update(fn, unwrap=False)`: Update dict value. The lambda you give accept `key` and `value` two variables and return a new value.\n* `fn_rename(mapping)`: Update dict key. The `mapping` is a list of two-elements list.\n\n### List\n\n* `fn_sort(fn)`: Sort the list in place. The lambda you give will be passed as `key` argument to the `sort` method of list.\n* `fn_dedup(fn=None, all=True)`: Dedup the elements in list. If `all` if `False`, the duplication will checked by comparing current value between last value, else will compare to all appeared before.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaming%2Fobjectify-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweaming%2Fobjectify-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaming%2Fobjectify-json/lists"}