{"id":13816933,"url":"https://github.com/Minyus/smalldict","last_synced_at":"2025-05-15T18:32:40.508Z","repository":{"id":57468565,"uuid":"352056050","full_name":"Minyus/smalldict","owner":"Minyus","description":"SmallDict: Python package to slim down a dict read from JSON or YAML to check the contents","archived":false,"fork":false,"pushed_at":"2021-03-28T03:56:31.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-20T07:07:20.177Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Minyus.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-03-27T11:30:50.000Z","updated_at":"2021-03-28T03:55:47.000Z","dependencies_parsed_at":"2022-09-19T09:51:26.760Z","dependency_job_id":null,"html_url":"https://github.com/Minyus/smalldict","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minyus%2Fsmalldict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minyus%2Fsmalldict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minyus%2Fsmalldict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Minyus%2Fsmalldict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Minyus","download_url":"https://codeload.github.com/Minyus/smalldict/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225024006,"owners_count":17408772,"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":[],"created_at":"2024-08-04T06:00:27.367Z","updated_at":"2024-11-19T14:31:22.558Z","avatar_url":"https://github.com/Minyus.png","language":"Python","funding_links":[],"categories":["Overview"],"sub_categories":[],"readme":"# SmallDict\n\nSmallDict: Python package to slim down a dict read from JSON or YAML to check the contents\n\n[![Python version](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blue.svg)](https://pypi.org/project/smalldict/)\n[![PyPI version](https://badge.fury.io/py/smalldict.svg)](https://badge.fury.io/py/smalldict)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/Minyus/smalldict/blob/master/LICENSEj)\n[![Documentation](https://readthedocs.org/projects/smalldict/badge/?version=latest)](https://smalldict.readthedocs.io/)\n\n\n## Overview\n\nWhen you open a big JSON or YAML file, the text viewer often freezes.\nYou can extract a small subset of a Python dict read from a JSON or YAML file to check the contents.\n\n\n## Install\n\n### [Option 1] Install from the PyPI\n\n```bash\npip install smalldict\n```\n\n### [Option 2] Development install \n\nThis is recommended only if you want to modify the source code of SmallDict.\n\n```bash\ngit clone https://github.com/Minyus/smalldict.git\ncd smalldict\npython setup.py develop\n```\n\n\n## How to use\n\nExample:\n\n```python\nfrom smalldict import SmallDict\n\nd = {\n    \"key_1\": [\"value_1\", \"value_2\", \"value_3\"],\n    \"key_2\": {\"key_1\": \"value\", \"key_2\": \"value\", \"key_3\": \"value\"},\n    \"key_3\": \"value\",\n}\n\n\ndef test_no_limit():\n    assert SmallDict(d).get() == d\n\n\ndef test_limit():\n    assert SmallDict(d).get(\n        dict_limit=2, list_limit=1, str_limit=3, json_out=None, yaml_out=None\n    ) == {\n        \"key_1\": [\"val\"],\n        \"key_2\": {\"key_1\": \"val\", \"key_2\": \"val\"},\n    }\n```\n\nJSON/YAML file input/output is supported.\n- Input: Specify the path, either JSON (`.json`) or YAML (`.yaml`, `.yml`), as `d` argument for `SmallDict`.\n- Output: Specify the path as `json_out` or `yaml_out` argument for `SmallDict.get` method.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMinyus%2Fsmalldict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMinyus%2Fsmalldict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMinyus%2Fsmalldict/lists"}