{"id":25939255,"url":"https://github.com/davidteren/pyautoload","last_synced_at":"2026-06-09T05:31:10.548Z","repository":{"id":279797301,"uuid":"939998092","full_name":"davidteren/PyAutoload","owner":"davidteren","description":"Efficient code loader for Python","archived":false,"fork":false,"pushed_at":"2025-02-27T13:47:37.000Z","size":81,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-02-27T19:02:05.746Z","etag":null,"topics":["autoload","python","python3"],"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/davidteren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2025-02-27T13:00:19.000Z","updated_at":"2025-02-27T18:14:57.000Z","dependencies_parsed_at":"2025-02-27T19:02:22.315Z","dependency_job_id":"022c9abb-b1fb-4564-9970-0ca80a3d3fb1","html_url":"https://github.com/davidteren/PyAutoload","commit_stats":null,"previous_names":["davidteren/pyautoload"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidteren%2FPyAutoload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidteren%2FPyAutoload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidteren%2FPyAutoload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidteren%2FPyAutoload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidteren","download_url":"https://codeload.github.com/davidteren/PyAutoload/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241780495,"owners_count":20019061,"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":["autoload","python","python3"],"created_at":"2025-03-04T04:16:06.542Z","updated_at":"2025-12-02T08:02:11.336Z","avatar_url":"https://github.com/davidteren.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyAutoload\n\nA Python autoloading library inspired by Ruby's [Zeitwerk](https://github.com/fxn/zeitwerk), designed to simplify module importing through convention over configuration.\n\n## Introduction\n\nPyAutoload aims to eliminate the cognitive overhead of managing imports in Python projects. By following simple naming conventions and directory structures, PyAutoload automatically discovers and loads your modules, allowing you to focus on writing code instead of managing imports.\n\n## Features\n\n- **Automatic module discovery**: Scans your project directories and maps file paths to module names\n- **Convention-based naming**: Uses a simple inflector to convert snake_case filenames to CamelCase class names\n- **Eager loading**: Loads all modules upfront for production environments\n- **Lazy loading**: Only loads modules when they're first accessed, perfect for development\n- **File watching**: Automatically reloads modules when files change during development\n- **Seamless integration**: Works with Python's import system using `importlib`\n- **PEP 420 support**: Handles namespace packages (directories without `__init__.py` files)\n\n## Installation\n\n```bash\npip install pyautoload\n```\n\n## Quick Start\n\n```python\nfrom pyautoload import AutoLoader\n\n# Initialize the loader\nloader = AutoLoader(base_path=\"myapp\", top_level=\"myapp\")\n\n# Discover modules (lazy loading mode)\nloader.discover()\n\n# Now you can import modules without worrying about file locations\nimport myapp.models.user\nimport myapp.controllers.users_controller\n\n# Or use eager loading to load everything at once\n# loader.eager_load()\n\n# For development, enable file watching to reload modules when files change\n# loader.enable_reloading()\n```\n\n## Directory Structure Conventions\n\nPyAutoload expects a conventional directory structure where file paths match module names:\n\n```\nmyapp/\n├── __init__.py\n├── models/\n│   ├── __init__.py\n│   └── user.py            # Contains the User class\n├── controllers/\n│   ├── __init__.py\n│   └── users_controller.py # Contains the UsersController class\n├── lib/                   # Namespace package (no __init__.py)\n│   └── helpers.py         # Contains utility functions\n└── services/\n    ├── __init__.py\n    ├── user_service.py     # Contains the UserService class\n    └── auth/\n        ├── __init__.py\n        └── authentication_service.py # Contains the AuthenticationService class\n```\n\n### Namespace Packages\n\nPyAutoload supports PEP 420 namespace packages, which are directories without `__init__.py` files. This allows for a more flexible module structure and compatibility with modern Python projects:\n\n```python\n# This works even though 'lib' has no __init__.py file\nfrom myapp.lib.helpers import format_date\n```\n\n## Customizing Inflection\n\nThe default inflector converts snake_case to CamelCase, but you can customize it for special cases:\n\n```python\nfrom pyautoload import AutoLoader, Inflector\n\n# Create a custom inflector\ninflector = Inflector()\ninflector.inflect({\n    \"html_parser\": \"HTMLParser\",\n    \"csv_controller\": \"CSVController\"\n})\n\n# Use the custom inflector with the loader\nloader = AutoLoader(base_path=\"myapp\", top_level=\"myapp\", inflector=inflector)\n```\n\n## Development Status\n\nPyAutoload is currently in alpha development. We're following a test-driven development approach to ensure reliability and correctness.\n\n### Alpha Release v0.1.0-alpha.1\n\nThis alpha release includes:\n\n- Basic autoloading functionality\n- Module registry for tracking loaded modules\n- Dependency tracking between modules\n- Automatic reloading of modules and their dependencies\n- File watching during development\n\nWe encourage Python developers to try PyAutoload and provide feedback through:\n- GitHub issues for bugs and feature requests\n- GitHub discussions for general feedback and questions\n\n### Feedback Wanted\n\nWe're especially interested in feedback on:\n\n1. Usability of the API\n2. Integration with different project structures\n3. Performance on larger codebases\n4. Compatibility with different Python versions\n5. Interactions with other libraries and frameworks\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\nSee our [contribution guidelines](CONTRIBUTING.md) for more details.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- Inspired by [Zeitwerk](https://github.com/fxn/zeitwerk) for Ruby\n- Built with love for the Python community\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidteren%2Fpyautoload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidteren%2Fpyautoload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidteren%2Fpyautoload/lists"}