{"id":32637327,"url":"https://github.com/ewfian/pickleparser","last_synced_at":"2025-10-31T01:56:12.227Z","repository":{"id":152881259,"uuid":"625289722","full_name":"ewfian/pickleparser","owner":"ewfian","description":"A pure Javascript implemented parser for Python pickle format","archived":false,"fork":false,"pushed_at":"2025-06-30T14:46:52.000Z","size":966,"stargazers_count":19,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-01T09:53:06.254Z","etag":null,"topics":["browser","json","nodejs","parser","pickle","pure-javascript","python","typescript","unpickling","without-dependencies"],"latest_commit_sha":null,"homepage":"https://ewfian.github.io/pickleparser/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ewfian.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":"SUPPORTED_OPCODES.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-08T16:46:42.000Z","updated_at":"2025-09-23T13:54:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"21b181c8-83fc-4584-bf98-0beddd1e626f","html_url":"https://github.com/ewfian/pickleparser","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ewfian/pickleparser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewfian%2Fpickleparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewfian%2Fpickleparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewfian%2Fpickleparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewfian%2Fpickleparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ewfian","download_url":"https://codeload.github.com/ewfian/pickleparser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewfian%2Fpickleparser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281914557,"owners_count":26583083,"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","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["browser","json","nodejs","parser","pickle","pure-javascript","python","typescript","unpickling","without-dependencies"],"created_at":"2025-10-31T01:56:11.334Z","updated_at":"2025-10-31T01:56:12.215Z","avatar_url":"https://github.com/ewfian.png","language":"TypeScript","readme":"# Pickle Parser\n[![NPM Version](https://img.shields.io/npm/v/pickleparser?logo=npm)](https://www.npmjs.com/package/pickleparser)\n[![Unit Test](https://github.com/ewfian/pickleparser/actions/workflows/unit_test.yml/badge.svg)](https://github.com/ewfian/pickleparser/actions/workflows/unit_test.yml)\n[![Demo](https://img.shields.io/badge/online-demo-blue.svg)](https://ewfian.github.io/pickleparser/)\n[![License](https://img.shields.io/github/license/ewfian/pickleparser)](https://github.com/ewfian/pickleparser)\n\nA pure Javascript implemented parser for [Python pickle format](https://docs.python.org/3.11/library/pickle.html)\n\n\n## Features\n\n* Fully supports Pickle protocol version 0~5 opcodes.\n* Pure Typescript implemented.\n* Provides `ParserOptions` to customize Unpickling.\n* Supports Browser.\n* Supports Node.js.\n* Provides tool to convert pickle file to JSON.\n\n## Supported Protocol Version\n\n* Pickle protocol version 0\n* Pickle protocol version 1\n* [Pickle protocol version 2 (Python 2.3)](https://peps.python.org/pep-0307/)\n* Pickle protocol version 3 (Python 3.0)\n* [Pickle protocol version 4 (Python 3.4)](https://peps.python.org/pep-3154/)\n* [Pickle protocol version 5 (Python 3.8)](https://peps.python.org/pep-0574/)\n\nFor more details, see: [Supported Opcodes](./SUPPORTED_OPCODES.md)\n\n## Demo\n[Online Pickle to JSON Convertor](https://ewfian.github.io/pickleparser/)\n\n## Installation\n\n```sh\n$ npm install pickleparser\n```\n\n## Usage\n\n### Node.js\n```typescript\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport { Parser } from 'pickleparser';\n\nasync function unpickle(fname: string) {\n    const pkl = await fs.readFile(path.join(fname), 'binary');\n    const buffer = Buffer.from(pkl, 'binary');\n    const parser = new Parser();\n    return parser.parse(buffer);\n}\n\nconst obj = await unpickle('pickled.pkl');\nconsole.log(obj);\n```\n\n\n### Browser\n\n```javascript\nconst fileSelector = document.getElementById('file_selector');\nconst jsonResultPreviewer = document.getElementById('json_result_previewer');\n\nfileSelector.addEventListener('change', function (e) {\n    const file = fileSelector.files[0];\n    const reader = new FileReader();\n\n    reader.onload = function (event) {\n        const buffer = new Uint8Array(event.target.result);\n        const parser = new pickleparser.Parser();\n        const obj = parser.parse(buffer);\n        const json = JSON.stringify(obj, null, 4);\n        jsonResultPreviewer.innerText = json;\n    }\n\n    reader.readAsArrayBuffer(file);\n});\n```\n\n### Terminal\n\n```bash\nnpx pickleparser file.pkl file.json\n# or\nnpm i pickleparser -g\npickletojson file.pkl file.json\n```\n\n\n## License\n\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewfian%2Fpickleparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fewfian%2Fpickleparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewfian%2Fpickleparser/lists"}