{"id":15493809,"url":"https://github.com/peter554/codemodimportfrom","last_synced_at":"2025-07-15T18:35:23.022Z","repository":{"id":200553276,"uuid":"705266540","full_name":"Peter554/codemodimportfrom","owner":"Peter554","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-18T05:37:31.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-13T03:45:17.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Peter554.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-10-15T14:35:59.000Z","updated_at":"2023-10-16T16:51:49.000Z","dependencies_parsed_at":"2024-11-13T04:40:26.981Z","dependency_job_id":"b9d092a3-a993-4f6f-9006-99620774359f","html_url":"https://github.com/Peter554/codemodimportfrom","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"3a7dad173fa51b82b9c4cf46d6def28674a8122b"},"previous_names":["peter554/codemodimportfrom"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Peter554/codemodimportfrom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peter554%2Fcodemodimportfrom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peter554%2Fcodemodimportfrom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peter554%2Fcodemodimportfrom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peter554%2Fcodemodimportfrom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Peter554","download_url":"https://codeload.github.com/Peter554/codemodimportfrom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peter554%2Fcodemodimportfrom/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265101464,"owners_count":23711569,"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-10-02T08:09:27.763Z","updated_at":"2025-07-15T18:35:23.002Z","avatar_url":"https://github.com/Peter554.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codemodimportfrom\n\n[![CI](https://github.com/Peter554/codemodimportfrom/actions/workflows/ci.yml/badge.svg)](https://github.com/Peter554/codemodimportfrom/actions/workflows/ci.yml)\n\nAutomatically update ImportFrom statements to \"import modules, not objects\".\n\n## Install\n\nFrom within your project's virtual environment, install `codemodimportfrom` (as a dev dependency). e.g.\n\n```sh\npip install codemodimportfrom\n```\n\n## Usage\n\n```sh\n# Transform all ImportFrom statements in the file path/to/file.py\ncodemodimportfrom path/to/file.py\n\n# Overwrite the file\ncodemodimportfrom path/to/file.py --write\n\n# Transform ImportFrom statements for modules foo and bar only\ncodemodimportfrom path/to/file.py --module foo --module bar\n\n# Allow object imports for typing.Optional and typing.Union\ncodemodimportfrom path/to/file.py --allow typing.Optional --allow typing.Union\n\n# Allow all object imports from typing\ncodemodimportfrom path/to/file.py --allow \"typing.*\"\n\n# Parse allow list from a .txt file (one line per allowed object import)\ncodemodimportfrom path/to/file.py --allow allow.txt\n\n# Also transform module imports \n# e.g. `from pydantic import dataclasses` becomes `import pydantic.dataclasses`\ncodemodimportfrom path/to/file.py --transform-module-imports\n```\n\n## Caveats\n\n* Not tested with much real world code, yet.\n* Relative imports (`from . import foo`) not implemented yet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter554%2Fcodemodimportfrom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeter554%2Fcodemodimportfrom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter554%2Fcodemodimportfrom/lists"}