{"id":32175698,"url":"https://github.com/lyang/pynamodb-encoder","last_synced_at":"2026-02-20T16:01:40.603Z","repository":{"id":37982373,"uuid":"432366739","full_name":"lyang/pynamodb-encoder","owner":"lyang","description":"PynamoDB Model object encoder/decoder to/from dict.","archived":false,"fork":false,"pushed_at":"2026-01-29T05:21:47.000Z","size":544,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-29T07:33:45.760Z","etag":null,"topics":["dynamodb","encoder-decoder","json","polymorphic","pynamodb","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/lyang.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-11-27T04:22:45.000Z","updated_at":"2026-01-29T05:21:49.000Z","dependencies_parsed_at":"2022-07-18T08:13:40.268Z","dependency_job_id":"42c3ded4-5a24-40bb-b7bd-4625577e4521","html_url":"https://github.com/lyang/pynamodb-encoder","commit_stats":{"total_commits":209,"total_committers":4,"mean_commits":52.25,"dds":0.3971291866028708,"last_synced_commit":"6566c85830a7691ce99ad82b436150d11367fe57"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lyang/pynamodb-encoder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyang%2Fpynamodb-encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyang%2Fpynamodb-encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyang%2Fpynamodb-encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyang%2Fpynamodb-encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lyang","download_url":"https://codeload.github.com/lyang/pynamodb-encoder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyang%2Fpynamodb-encoder/sbom","scorecard":{"id":606948,"data":{"date":"2025-08-11","repo":{"name":"github.com/lyang/pynamodb-encoder","commit":"72f8b689af33e635888addb36df1a2011e606f0c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/1 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/lyang/pynamodb-encoder/release.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:21","Info:   0 out of  11 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:16","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:17","Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/lyang/pynamodb-encoder/releases/154490287","Warn: release artifact v0.1.2 not signed: https://api.github.com/repos/lyang/pynamodb-encoder/releases/96678413","Warn: release artifact v0.1.1 not signed: https://api.github.com/repos/lyang/pynamodb-encoder/releases/55338756","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/lyang/pynamodb-encoder/releases/154490287","Warn: release artifact v0.1.2 does not have provenance: https://api.github.com/repos/lyang/pynamodb-encoder/releases/96678413","Warn: release artifact v0.1.1 does not have provenance: https://api.github.com/repos/lyang/pynamodb-encoder/releases/55338756"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: GHSA-48p4-8xcf-vxj5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (30) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T01:49:29.419Z","repository_id":37982373,"created_at":"2025-08-21T01:49:29.420Z","updated_at":"2025-08-21T01:49:29.420Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29656589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["dynamodb","encoder-decoder","json","polymorphic","pynamodb","python"],"created_at":"2025-10-21T19:45:42.228Z","updated_at":"2026-02-20T16:01:40.597Z","avatar_url":"https://github.com/lyang.png","language":"Python","readme":"# pynamodb-encoder\n![Build](https://github.com/lyang/pynamodb-encoder/actions/workflows/build.yml/badge.svg) ![CodeQL](https://github.com/lyang/pynamodb-encoder/actions/workflows/codeql-analysis.yml/badge.svg) [![codecov](https://codecov.io/gh/lyang/pynamodb-encoder/branch/main/graph/badge.svg?token=P51YVL86N8)](https://codecov.io/gh/lyang/pynamodb-encoder) [![Maintainability](https://api.codeclimate.com/v1/badges/1e5c3b615dedb2bffb0c/maintainability)](https://codeclimate.com/github/lyang/pynamodb-encoder/maintainability) [![PyPI version](https://badge.fury.io/py/pynamodb-encoder.svg)](https://badge.fury.io/py/pynamodb-encoder)\n[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/pynamodb-encoder.svg)](https://pypi.python.org/pypi/pynamodb-encoder/)\n\n## Introduction\n`pynamodb-encoder` provides helper classes that can convert [PynamoDB](https://github.com/pynamodb/PynamoDB) `Model` objects into `JSON` serializable `dict`. It can also decode such `dict` back into those `Model` objects. [Polymorphic](https://pynamodb.readthedocs.io/en/latest/polymorphism.html) models and attributes are also supported.\n\n## Examples\n```python\ndef test_encode_complex_model(encoder: Encoder):\n    class Pet(DynamicMapAttribute):\n        cls = DiscriminatorAttribute()\n        name = UnicodeAttribute()\n\n    class Cat(Pet, discriminator=\"Cat\"):\n        pass\n\n    class Dog(Pet, discriminator=\"Dog\"):\n        pass\n\n    class Human(Model):\n        name = UnicodeAttribute()\n        pets = ListAttribute(of=Pet)\n\n    jon = Human(name=\"Jon\", pets=[Cat(name=\"Garfield\", age=43), Dog(name=\"Odie\")])\n    assert encoder.encode(jon) == {\n        \"name\": \"Jon\",\n        \"pets\": [{\"cls\": \"Cat\", \"name\": \"Garfield\", \"age\": 43}, {\"cls\": \"Dog\", \"name\": \"Odie\"}],\n    }\n\ndef test_decode_complex_model(decoder: Decoder):\n    class Pet(DynamicMapAttribute):\n        cls = DiscriminatorAttribute()\n\n    class Cat(Pet, discriminator=\"Cat\"):\n        name = UnicodeAttribute()\n\n    class Dog(Pet, discriminator=\"Dog\"):\n        breed = UnicodeAttribute()\n\n    class Human(Model):\n        name = UnicodeAttribute()\n        age = NumberAttribute()\n        pets = ListAttribute(of=Pet)\n\n    jon = decoder.decode(\n        Human,\n        {\n            \"name\": \"Jon\",\n            \"age\": 70,\n            \"pets\": [{\"cls\": \"Cat\", \"name\": \"Garfield\"}, {\"cls\": \"Dog\", \"breed\": \"Terrier\"}],\n        },\n    )\n\n    assert jon.name == \"Jon\"\n    assert jon.age == 70\n    assert isinstance(jon.pets, list)\n    assert len(jon.pets) == 2\n    assert isinstance(jon.pets[0], Cat)\n    assert jon.pets[0].name == \"Garfield\"\n    assert isinstance(jon.pets[1], Dog)\n    assert jon.pets[1].breed == \"Terrier\"\n```\n\nMore examples can be found in [encoder_test.py](tests/encoder_test.py) and [decoder_test.py](tests/decoder_test.py)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyang%2Fpynamodb-encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flyang%2Fpynamodb-encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyang%2Fpynamodb-encoder/lists"}