{"id":18295844,"url":"https://github.com/astropenguin/morecopy","last_synced_at":"2025-04-05T12:31:45.039Z","repository":{"id":45383263,"uuid":"420341045","full_name":"astropenguin/morecopy","owner":"astropenguin","description":"Copy even immutable objects as much as possible","archived":false,"fork":false,"pushed_at":"2023-10-19T12:12:05.000Z","size":65,"stargazers_count":1,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T04:01:53.089Z","etag":null,"topics":["copy","deepcopy","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/astropenguin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-23T07:10:07.000Z","updated_at":"2023-05-15T08:25:21.000Z","dependencies_parsed_at":"2024-11-05T14:45:11.879Z","dependency_job_id":"927623e5-5962-4f9f-943f-f29c32d6a3cb","html_url":"https://github.com/astropenguin/morecopy","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"c9c720c18f6ee38eff19bc367ac09135becc77aa"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astropenguin%2Fmorecopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astropenguin%2Fmorecopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astropenguin%2Fmorecopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astropenguin%2Fmorecopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astropenguin","download_url":"https://codeload.github.com/astropenguin/morecopy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247338954,"owners_count":20923001,"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":["copy","deepcopy","python"],"created_at":"2024-11-05T14:38:32.464Z","updated_at":"2025-04-05T12:31:40.027Z","avatar_url":"https://github.com/astropenguin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# morecopy\n\n[![Release](https://img.shields.io/pypi/v/morecopy?label=Release\u0026color=cornflowerblue\u0026style=flat-square)](https://pypi.org/project/morecopy/)\n[![Python](https://img.shields.io/pypi/pyversions/morecopy?label=Python\u0026color=cornflowerblue\u0026style=flat-square)](https://pypi.org/project/morecopy/)\n[![Downloads](https://img.shields.io/pypi/dm/morecopy?label=Downloads\u0026color=cornflowerblue\u0026style=flat-square)](https://pepy.tech/project/morecopy)\n[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.5594444-cornflowerblue?style=flat-square)](https://doi.org/10.5281/zenodo.5594444)\n[![Tests](https://img.shields.io/github/actions/workflow/status/astropenguin/morecopy/tests.yml?label=Tests\u0026style=flat-square)](https://github.com/astropenguin/morecopy/actions)\n\nCopy even immutable objects as much as possible\n\n## Overview\n\nmorecopy is a Python package that enables copy of immutable objects so that a copied object is equivalent but not identical to the original:\n\n```python\nfrom morecopy import copy\n\n\noriginal = 1234567890\ncopied = copy(original)\n\noriginal == copied # -\u003e True\noriginal is copied # -\u003e False\n```\n\n\u003e **Note**\n\u003e In general, there is no need to copy immutable objects, so this package may not be necessary in most cases.\n\u003e Also, some objects may not be copied even with this package:\n\u003e In CPython, for example, integers from -5 to 256 are always uncopied for optimization.\n\n## Installation\n\n```shell\n$ pip install morecopy\n```\n\n## Supported immutable types\n\nThe following types are supported.\nFor mutable types (e.g. `list`) or unsupported immutable types (e.g. `bool`, `NoneType`), `morecopy.copy` and `morecopy.deepcopy` are equivalent to `copy.copy` and `copy.deepcopy`, respectively.\n\nType | `morecopy.copy` | `morecopy.deepcopy`\n--- | --- | ---\n`int` | yes | n/a\n`float` | yes | n/a\n`complex` | yes | n/a\n`str` | yes | n/a\n`bytes` | yes | n/a\n`tuple` | yes | n/a\n`range` | yes | n/a\n`slice` | yes | n/a\n`frozenset` | yes | n/a\n`FunctionType` | yes | n/a\n`LambdaType` | yes | n/a\n\n## Custom immutable copier\n\nUsers can add a custom copy function (copier) for a type.\nFor example, the following code defines copy of integer by creating a copy function and registering it by the `copier_for` decorator.\n\n```python\nfrom morecopy import copier_for\n\n\n@copier_for(int)\ndef copy_int(integer: int) -\u003e int:\n    return eval(repr(integer))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastropenguin%2Fmorecopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastropenguin%2Fmorecopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastropenguin%2Fmorecopy/lists"}