{"id":21409971,"url":"https://github.com/milisp/rsort","last_synced_at":"2025-03-16T17:46:22.837Z","repository":{"id":260435685,"uuid":"880304012","full_name":"milisp/rsort","owner":"milisp","description":"rust isort","archived":false,"fork":false,"pushed_at":"2024-10-31T09:28:47.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T04:41:19.195Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/milisp.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":"2024-10-29T13:41:05.000Z","updated_at":"2024-10-31T09:28:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"caa9763b-8805-459f-80c5-954dff611407","html_url":"https://github.com/milisp/rsort","commit_stats":null,"previous_names":["milisp/rsort"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milisp%2Frsort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milisp%2Frsort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milisp%2Frsort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milisp%2Frsort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milisp","download_url":"https://codeload.github.com/milisp/rsort/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910715,"owners_count":20367538,"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-11-22T17:36:06.444Z","updated_at":"2025-03-16T17:46:22.809Z","avatar_url":"https://github.com/milisp.png","language":"Rust","readme":"# rsort\n\n## Python Import Organizer\n\nA high-performance command-line tool written in Rust that automatically organizes and sorts Python import statements.\n\n## Features\n\n- Organizes imports into logical groups:\n  - Future imports (`__future__`)\n  - Standard library imports\n  - Third-party library imports\n  - Local library imports\n- Maintains proper spacing between import blocks\n- Processes single files or entire directories recursively\n- Parallel processing support for better performance\n- Automatic backup creation before modifications\n- Preserves existing code formatting outside of import blocks\n\n## Installation\n\n### Build from source\n```bash\ncargo build --release\n```\n\n### The binary will be available in target/release/\n\n## Usage\n\n```bash\nrsort path/to/python/file/or/directory\n```\n\n### Specify number of threads for parallel processing\n```bash\nrsort path/to/python/file/or/directory -t 4\n```\n\n## Import Grouping Rules\n\nImports are organized into the following groups, with blank lines between each group:\n\n1. `__future__` imports\n2. Standard library imports\n3. Third-party library imports\n4. Local library imports (starting with `.` or `..`)\n\nWithin each group:\n- `import` statements come before `from ... import` statements\n- Imports are sorted alphabetically (case-insensitive)\n\n## Safety Features\n\n- Creates automatic backups in the system's temp directory before modifying files\n- Only modifies files when changes are necessary\n- Preserves all non-import code exactly as is\n\n## Command Line Options\n\n```bash\nrsort path/to/python/file/or/directory -t 4\n```\n\n```bash\nOptions:\n  -t, --threads \u003cTHREADS\u003e    Number of threads for parallel processing [default: 4]\n  -h, --help                Display help information\n  -V, --version             Display version information\n```\n\n## Example\n\nInput:\n```python\nimport random\nfrom datetime import datetime\nimport os\nfrom . import local_module\nimport django\nfrom __future__ import annotations\n```\n\nOutput:\n```python\nfrom __future__ import annotations\n\nimport os\nimport random\nfrom datetime import datetime\n\nimport django\n\nfrom . import local_module\n```\n\n## License\n\n[MIT](LICENSE)\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilisp%2Frsort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilisp%2Frsort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilisp%2Frsort/lists"}