{"id":21453457,"url":"https://github.com/lapets/sizeof","last_synced_at":"2026-02-28T17:31:16.148Z","repository":{"id":47053310,"uuid":"293413483","full_name":"lapets/sizeof","owner":"lapets","description":"Simple function for determining the memory usage of common Python values and objects.","archived":false,"fork":false,"pushed_at":"2025-04-24T04:04:20.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-24T21:55:57.432Z","etag":null,"topics":["python-data-structures","python-library","python-memory","python-sizeof"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/sizeof","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/lapets.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2020-09-07T03:32:32.000Z","updated_at":"2025-04-24T04:04:24.000Z","dependencies_parsed_at":"2025-01-23T12:43:38.104Z","dependency_job_id":"866f725f-ca7b-49d8-baee-5f2d2c32098c","html_url":"https://github.com/lapets/sizeof","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lapets/sizeof","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapets%2Fsizeof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapets%2Fsizeof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapets%2Fsizeof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapets%2Fsizeof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lapets","download_url":"https://codeload.github.com/lapets/sizeof/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapets%2Fsizeof/sbom","scorecard":{"id":578868,"data":{"date":"2025-08-11","repo":{"name":"github.com/lapets/sizeof","commit":"7babb766765ff8e3eadf9dc61eb9b5f737c5be16"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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-publish-sign-release.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/lapets/sizeof/build-publish-sign-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-publish-sign-release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/lapets/sizeof/build-publish-sign-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-publish-sign-release.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/lapets/sizeof/build-publish-sign-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-publish-sign-release.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/lapets/sizeof/build-publish-sign-release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-publish-sign-release.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/lapets/sizeof/build-publish-sign-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-publish-sign-release.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/lapets/sizeof/build-publish-sign-release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-publish-sign-release.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/lapets/sizeof/build-publish-sign-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-test-cover-docs.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/lapets/sizeof/lint-test-cover-docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-test-cover-docs.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/lapets/sizeof/lint-test-cover-docs.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build-publish-sign-release.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/lint-test-cover-docs.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/lint-test-cover-docs.yml:34","Warn: pipCommand not pinned by hash: .github/workflows/lint-test-cover-docs.yml:42","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   4 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":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/build-publish-sign-release.yml:57","Warn: no topLevel permission defined: .github/workflows/build-publish-sign-release.yml:1","Warn: no topLevel permission defined: .github/workflows/lint-test-cover-docs.yml:1"],"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"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":"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":-1,"reason":"no releases found","details":null,"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"}}]},"last_synced_at":"2025-08-20T18:36:54.095Z","repository_id":47053310,"created_at":"2025-08-20T18:36:54.095Z","updated_at":"2025-08-20T18:36:54.095Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29944765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"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":["python-data-structures","python-library","python-memory","python-sizeof"],"created_at":"2024-11-23T04:39:41.972Z","updated_at":"2026-02-28T17:31:16.118Z","avatar_url":"https://github.com/lapets.png","language":"Python","readme":"======\nsizeof\n======\n\nSimple function for determining the memory usage of common Python values and objects.\n\n|pypi| |readthedocs| |actions| |coveralls|\n\n.. |pypi| image:: https://badge.fury.io/py/sizeof.svg#\n   :target: https://badge.fury.io/py/sizeof\n   :alt: PyPI version and link.\n\n.. |readthedocs| image:: https://readthedocs.org/projects/sizeof/badge/?version=latest\n   :target: https://sizeof.readthedocs.io/en/latest/?badge=latest\n   :alt: Read the Docs documentation status.\n\n.. |actions| image:: https://github.com/lapets/sizeof/workflows/lint-test-cover-docs/badge.svg#\n   :target: https://github.com/lapets/sizeof/actions/workflows/lint-test-cover-docs.yml\n   :alt: GitHub Actions status.\n\n.. |coveralls| image:: https://coveralls.io/repos/github/lapets/sizeof/badge.svg?branch=main\n   :target: https://coveralls.io/github/lapets/sizeof?branch=main\n   :alt: Coveralls test coverage summary.\n\nInstallation and Usage\n----------------------\nThis library is available as a `package on PyPI \u003chttps://pypi.org/project/sizeof\u003e`__:\n\n.. code-block:: bash\n\n    python -m pip install sizeof\n\nThe library can be imported in the usual ways:\n\n.. code-block:: bash\n\n    import sizeof\n    from sizeof import sizeof\n\nExamples\n^^^^^^^^\n\n.. |sizeof| replace:: ``sizeof``\n.. _sizeof: https://sizeof.readthedocs.io/en/1.0.0/_source/sizeof.html#sizeof.sizeof.sizeof\n\nThe |sizeof|_ function can be applied to any value or object. By default, the function returns the memory consumed by that value or object (and **not** by any of the objects to which it may contain references):\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from sizeof import sizeof\n    \u003e\u003e\u003e sizeof(123.0123)\n    16\n\n.. |arch| replace:: ``arch``\n.. _arch: https://sizeof.readthedocs.io/en/1.0.0/_source/sizeof.html#sizeof.sizeof.arch\n\nThe amount of memory consumed for any given value or object is in part determined by the host architecture and the version of Python being used. The |arch|_ function can be used to determine whether the architecture is 32-bit or 64-bit:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from sizeof import arch\n    \u003e\u003e\u003e arch()\n    32\n\nThe optional ``deep`` argument of the |sizeof|_ function makes it possible to calculate the memory consumed by an object and all of it descendants by reference:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e sizeof([]) # Size of an empty list.\n    28\n    \u003e\u003e\u003e sizeof([1]), sizeof([1, 2]) # Size of reference is 4.\n    (32, 36)\n    \u003e\u003e\u003e sizeof(3) # Size of an integer.\n    14\n    \u003e\u003e\u003e sizeof([1, 2, 3]) == 28 + (3 * 4)\n    True\n    \u003e\u003e\u003e sizeof([1, 2, 3], deep=True) == 28 + (3 * (4 + 14))\n    True\n\nNote that all of the examples above may return different results on your system and in your environment.\n\nDevelopment\n-----------\nAll installation and development dependencies are fully specified in ``pyproject.toml``. The ``project.optional-dependencies`` object is used to `specify optional requirements \u003chttps://peps.python.org/pep-0621\u003e`__ for various development tasks. This makes it possible to specify additional options (such as ``docs``, ``lint``, and so on) when performing installation using `pip \u003chttps://pypi.org/project/pip\u003e`__:\n\n.. code-block:: bash\n\n    python -m pip install \".[docs,lint]\"\n\nDocumentation\n^^^^^^^^^^^^^\nThe documentation can be generated automatically from the source files using `Sphinx \u003chttps://www.sphinx-doc.org\u003e`__:\n\n.. code-block:: bash\n\n    python -m pip install \".[docs]\"\n    cd docs\n    sphinx-apidoc -f -E --templatedir=_templates -o _source .. \u0026\u0026 make html\n\nTesting and Conventions\n^^^^^^^^^^^^^^^^^^^^^^^\nAll unit tests are executed and their coverage is measured when using `pytest \u003chttps://docs.pytest.org\u003e`__ (see the ``pyproject.toml`` file for configuration details):\n\n.. code-block:: bash\n\n    python -m pip install \".[test]\"\n    python -m pytest\n\nAlternatively, all unit tests are included in the module itself and can be executed using `doctest \u003chttps://docs.python.org/3/library/doctest.html\u003e`__:\n\n.. code-block:: bash\n\n    python src/sizeof/sizeof.py -v\n\nStyle conventions are enforced using `Pylint \u003chttps://pylint.readthedocs.io\u003e`__:\n\n.. code-block:: bash\n\n    python -m pip install \".[lint]\"\n    python -m pylint src/sizeof\n\nContributions\n^^^^^^^^^^^^^\nIn order to contribute to the source code, open an issue or submit a pull request on the `GitHub page \u003chttps://github.com/lapets/sizeof\u003e`__ for this library.\n\nVersioning\n^^^^^^^^^^\nThe version number format for this library and the changes to the library associated with version number increments conform with `Semantic Versioning 2.0.0 \u003chttps://semver.org/#semantic-versioning-200\u003e`__.\n\nPublishing\n^^^^^^^^^^\nThis library can be published as a `package on PyPI \u003chttps://pypi.org/project/sizeof\u003e`__ via the GitHub Actions workflow found in ``.github/workflows/build-publish-sign-release.yml`` that follows the `recommendations found in the Python Packaging User Guide \u003chttps://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/\u003e`__.\n\nEnsure that the correct version number appears in ``pyproject.toml``, and that any links in this README document to the Read the Docs documentation of this package (or its dependencies) have appropriate version numbers. Also ensure that the Read the Docs project for this library has an `automation rule \u003chttps://docs.readthedocs.io/en/stable/automation-rules.html\u003e`__ that activates and sets as the default all tagged versions.\n\nTo publish the package, create and push a tag for the version being published (replacing ``?.?.?`` with the version number):\n\n.. code-block:: bash\n\n    git tag ?.?.?\n    git push origin ?.?.?\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flapets%2Fsizeof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flapets%2Fsizeof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flapets%2Fsizeof/lists"}