{"id":18683419,"url":"https://github.com/narasimha1997/pymigrate","last_synced_at":"2025-04-12T04:31:34.475Z","repository":{"id":57456143,"uuid":"175248810","full_name":"Narasimha1997/pyMigrate","owner":"Narasimha1997","description":"A tool for automatically migrating any python source code to a virtual environment with all dependencies automatically identified and installed. You can also use this tool to generate requirements.txt for your python code base, in general, this tool will help you to bring your old/hobby python codebase to production/distribution.","archived":false,"fork":false,"pushed_at":"2021-03-09T15:09:16.000Z","size":44,"stargazers_count":52,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T00:56:00.612Z","etag":null,"topics":["automation","python","python3","regex","virtualenv"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Narasimha1997.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}},"created_at":"2019-03-12T15:59:51.000Z","updated_at":"2024-02-06T14:20:58.000Z","dependencies_parsed_at":"2022-09-02T06:53:06.748Z","dependency_job_id":null,"html_url":"https://github.com/Narasimha1997/pyMigrate","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Narasimha1997%2FpyMigrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Narasimha1997%2FpyMigrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Narasimha1997%2FpyMigrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Narasimha1997%2FpyMigrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Narasimha1997","download_url":"https://codeload.github.com/Narasimha1997/pyMigrate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248517174,"owners_count":21117407,"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":["automation","python","python3","regex","virtualenv"],"created_at":"2024-11-07T10:14:36.760Z","updated_at":"2025-04-12T04:31:34.093Z","avatar_url":"https://github.com/Narasimha1997.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyMigrate\nA tool for automatically migrating any python source code to a virtual environment with all \ndependencies automatically identified and installed. You can also use this tool to generate requirements.txt for your python code base, in general, this tool will help you to bring your old/hobby \npython codebase to production/distribution.\n\n**Note**: As of now, the dependencies are identified based on module names, not the package name. Therefore, the dependencies will be properly listed in \nrequirements.txt only if package name == module name otherwise the module name will be listed directly and pip might fail to download such dependencies, this is because the python runtime operates at modules level, while pip works at package level, as of now, it is nearly impossible to reliably obtain the package name given the module name which came installed with it (this is because of the nature of python's package management). I am still looking for a better/possible approach to mitigate this issue. As of now, you many have to manually change the generated requirements.txt for some packages that are not properly identified.\n\n\n## Features:\n1. A simple CLI tool.\n2. Creates and installs a virtual environment automatically.\n3. Identifies the dependencies (external) automatically and populates the `requirements.txt`\n4. Installs dependencies in the virtual environment.\n5. Multiple configuration parameters.\n\n## Requirements:\n1. pip\n2. Python 3.x.x\n3. venv\n\n**Note:** : You many need to install `python3-venv` via `apt` on debian systems.\n\n## How to install:\nThe package is available on pip. Run:\n```\npip3 install py-migrate\n```\nOr you can clone the repository and install manually:\n```\ngit clone https://github.com/Narasimha1997/pyMigrate.git\ncd pyMigrate \u0026\u0026 python3 setup.py install\n```\n\n## How to run this tool:\nOnce installed, the tool will be available through command `pymigrate`. Say you have a codebase at `/path/to/source` and you want to generate the virtualenv with all the dependencies and source code installed at `/path/to/target`, then:\n\n```\npymigrate /path/to/source /path/to/target\n```\ncommand will generate the virtualenv for you. The target must be an absloute path.\n\n#### Generating requirements.txt alone, without setting up virtualenv:\nYou can set `--requirements` to generate `requirements.txt` alone, this will not set-up the virtualenv. Say you have to generate `requirements.txt` at `/path/to/output`, then:\n\n```\npymigrate /path/to/source /path/to/target --requirements\n```\n\n## Configuration options:\nYou can change the default behaviour of the generated virtual environment by setting some of the coniguration options provided. You can run the following command to learn more about these parameters:\n```\npymigrate --help\n```\nWhich outputs:\n```\nusage: pymigrate [-h] [--requirements] [--syspkgs] [--symlink] source target\n\nA tool for automatically migrating any python source code to a virtual\nenvironment with all dependencies automatically identified and installed. You\ncan also use this tool to generate requirements.txt for your python code base,\nin general, this tool will help you to bring your old/hobby python codebase to\nproduction/distribution.\n\npositional arguments:\n  source          Path to source directory where you have the codebase to\n                  transform\n  target          Path to the destination where you need to generate a\n                  virtual-environment or requirements.txt\n\noptional arguments:\n  -h, --help      show this help message and exit\n  --requirements  This flag tells the tool to generate requirements.txt\n  --syspkgs       Set this flag, if you want to use system site-packages In\n                  other words, you will re-use the packages available on the\n                  system instead of downloading them locally in the\n                  virtualenv.\n  --symlink       Symlinks the python interpreter available on the system\n                  rather than installing a new one.\n```\n## Contributing:\nFeel free to contribute by raising issues, making PRs or suggesting features.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarasimha1997%2Fpymigrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarasimha1997%2Fpymigrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarasimha1997%2Fpymigrate/lists"}