{"id":16199300,"url":"https://github.com/j6k4m8/jque","last_synced_at":"2025-08-13T18:42:09.338Z","repository":{"id":62572723,"uuid":"103178109","full_name":"j6k4m8/jque","owner":"j6k4m8","description":"Query JSON in memory as though it were a Mongo database.","archived":false,"fork":false,"pushed_at":"2021-07-31T15:58:56.000Z","size":61,"stargazers_count":7,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T04:05:42.863Z","etag":null,"topics":["json","mango","mongo","mongo-database","mongodb","ohp","pandas","python","query-json","search"],"latest_commit_sha":null,"homepage":"https://j6k4m8.github.io/jque","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/j6k4m8.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-11T19:22:12.000Z","updated_at":"2024-01-22T21:55:14.000Z","dependencies_parsed_at":"2022-11-03T18:27:03.650Z","dependency_job_id":null,"html_url":"https://github.com/j6k4m8/jque","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j6k4m8%2Fjque","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j6k4m8%2Fjque/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j6k4m8%2Fjque/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j6k4m8%2Fjque/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j6k4m8","download_url":"https://codeload.github.com/j6k4m8/jque/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244364663,"owners_count":20441458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["json","mango","mongo","mongo-database","mongodb","ohp","pandas","python","query-json","search"],"created_at":"2024-10-10T09:24:58.996Z","updated_at":"2025-03-19T05:30:47.956Z","avatar_url":"https://github.com/j6k4m8.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=center\u003ej q u e\u003c/h2\u003e\n\u003cp align=center\u003eQuery JSON in memory as though it were a Mongo database\u003c/p\u003e\n\u003cp align=center\u003e\u003ca href=\"https://pypi.org/project/jque/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/jque.svg?style=for-the-badge\" /\u003e\u003c/a\u003e \u003ca href=\"https://circleci.com/gh/j6k4m8/jque\"\u003e\u003cimg src=\"https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser.svg?style=for-the-badge\" /\u003e\u003c/a\u003e \u003cimg src=\"https://img.shields.io/badge/pretty_dope-%F0%9F%A4%99-blue.svg?style=for-the-badge\" /\u003e \u003cimg src=\"https://img.shields.io/github/license/j6k4m8/jque.svg?style=for-the-badge\" /\u003e\u003ca href=\"https://codecov.io/gh/j6k4m8/jque\"\u003e\n  \u003cbr /\u003e\n  \u003cimg src=\"https://codecov.io/gh/j6k4m8/jque/branch/master/graph/badge.svg?style=for-the-badge\" /\u003e\n\u003c/a\u003e\u003c/p\u003e\n\n## Installation\n\n```shell\npip3 install jque\n```\n\n## Usage\n\n```python\nimport jque\n```\n\n`jque` accepts a variety of inputs to the constructor.\n\nPass a list of dicts:\n```python\ndata = jque.jque([\n    { \"name\": \"john\" }, \n    { \"name\": \"paul\" }, \n    { \"name\": \"george\" }, \n    { \"name\": \"ringo\" }\n])\n```\n\nPass a JSON filename:\n```python\nDATAFILE = \"~/my/big/data.json\"\ndata = jque.jque(DATAFILE)\n```\n\nNow you can query this dataset using Mongo-like syntax:\n\n```python\n\u003e\u003e\u003e data.query({ \"name\": {\"$neq\": \"paul\"} })\n[\n    { \"name\": \"john\" },\n    { \"name\": \"george\" }, \n    { \"name\": \"ringo\" }\n]\n```\n\n### Arguments to `query`:\n\n| Arg | Description |\n|-----|-------------|\n| `wrap` (`boolean` : `True`) | Whether to wrap the resultant dataset in a new `jque` object. This allows chaining, like `jque.query(...).query(...)`, if you're the sort of person to do that. Pass `False` to get back a `list` instead. |\n\n\n### Another example!\n\n```python\ndata = jque.jque([{\n    \"_id\": \"ABC\",\n    \"name\": \"Arthur Dent\",\n    \"age\": 42,\n    \"current_planet\": \"earth\"\n}, {\n    \"_id\": \"DE2\",\n    \"name\": \"Penny Lane\",\n    \"age\": 19,\n    \"current_planet\": \"earth\"\n}, {\n    \"_id\": \"123\",\n    \"name\": \"Ford Prefect\",\n    \"age\": 240,\n    \"current_planet\": \"Brontitall\"\n}])\n```\n\n```python\nteenage_earthlings = data.query({\n    \"current_planet\": {\"$eq\": \"earth\"},\n    \"age\": { \"$lte\": 20, \"$gte\": 10 }\n})\n```\n\nWhich returns:\n\n```python\n[{\n    \"_id\": \"DE2\",\n    \"name\": \"Penny Lane\",\n    \"age\": 19,\n    \"current_planet\": \"earth\"\n}]\n```\n\n\nUse Python lambdas as a filter:\n\n```python\n\u003e\u003e\u003e libraries = jque.jque([\n...     {\"name\": \"jque\", \"language\": \"Python\"}, \n...     {\"name\": \"react\", \"language\": \"node\"}\n... ])\n\u003e\u003e\u003e list(libraries.query({\n...     'language': lambda x: x[:2] == \"Py\"\n... }))\n[{\"name\": \"jque\", \"language\": \"Python\"}]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj6k4m8%2Fjque","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj6k4m8%2Fjque","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj6k4m8%2Fjque/lists"}