py-spring-core


Namepy-spring-core JSON
Version 0.0.23 PyPI version JSON
download
home_pageNone
SummaryPySpring is a Python web framework inspired by Spring Boot, combining FastAPI, and Pydantic for building scalable web applications with auto dependency injection, configuration management, and a web server.
upload_time2025-07-20 15:24:41
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # **PySpring** Framework

#### **PySpring** is a Python web framework inspired by Spring Boot. It combines FastAPI for the web layer, and Pydantic for data validation. PySpring provides a structured approach to building scalable web applications with `auto dependency injection`, `auto configuration management` and a `web server` for hosting your application.

## Key Features
- **Application Initialization**: `PySpringApplication` class serves as the main entry point for the **PySpring** application. It initializes the application from a configuration file, scans the application source directory for Python files, and groups them into class files and model files.

- **Application Context Management**: **PySpring** manages the application context and dependency injection. It registers application entities such as components, controllers, bean collections, and properties. It also initializes the application context and injects dependencies.

- **REST Controllers**: **PySpring** supports RESTful API development using the RestController class. It allows you to define routes, handle HTTP requests, and register middlewares easily.

- **Component-based Architecture**: **PySpring** encourages a component-based architecture, where components are reusable and modular building blocks of the application. Components can have their own lifecycle and can be registered and managed by the application context.

- **Properties Management**: Properties classes provide a convenient way to manage application-specific configurations. **PySpring** supports loading properties from a properties file and injecting them into components.

- **Framework Modules**: **PySpring** allows the integration of additional framework modules to extend the functionality of the application. Modules can provide additional routes, middlewares, or any other custom functionality required by the application.

- **Builtin FastAPI Integration**: **PySpring** integrates with `FastAPI`, a modern, fast (high-performance), web framework for building APIs with Python. It leverages FastAPI's features for routing, request handling, and server configuration.

## Project Structure
```
PySpring/
├── src/                    # Source code directory
├── tests/                  # Test files
├── logs/                   # Application logs
├── py_spring_core/         # Core framework package
├── app-config.json         # Application configuration
├── application-properties.json  # Application properties
├── main.py                 # Application entry point
├── pyproject.toml          # Project metadata and dependencies
└── README.md              # Project documentation
```

## Getting Started

### Prerequisites
- Python 3.10 or higher
- pip (Python package installer)

### Installation
1. Install the **PySpring** framework:
```bash
pip install py-spring-core
```

2. Create a new Python project and navigate to its directory

3. Set up your application:
   - Implement your application properties, components, and controllers using **PySpring** conventions inside the declared source code folder (which can be modified via the `app_src_target_dir` key in `app-config.json`)
   - Create an `app-config.json` file for your application configuration
   - Create an `application-properties.json` file for your application properties

4. Create your main application script:
```python
from py_spring_core import PySpringApplication

def main():
    app = PySpringApplication("./app-config.json")
    app.run()

if __name__ == "__main__":
    main()
```

5. Run your application:
```bash
python main.py
```

For a complete example project, please refer to the [PySpring Example Project](https://github.com/NFUChen/PySpring-Example-Project).

## Development Setup
1. Clone the repository:
```bash
git clone https://github.com/NFUChen/PySpring.git
cd PySpring
```

2. Install development dependencies:
```bash
pip install -e ".[dev]"
```

3. Run tests:
```bash
pytest
```

## Dependencies
PySpring relies on several key dependencies:
- FastAPI (0.112.0)
- Pydantic (2.8.2)
- Uvicorn (0.30.5)
- Loguru (0.7.2)
- And other supporting packages

For a complete list of dependencies, see `pyproject.toml`.

## Contributing

Contributions to **PySpring** are welcome! If you find any issues or have suggestions for improvements, please:
1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "py-spring-core",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "William Chen <OW6201231@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/7c/ff/5ba14843330b0bde01333083c5c7f8559eec2362db4bd9292f6f4b1c9940/py_spring_core-0.0.23.tar.gz",
    "platform": null,
    "description": "# **PySpring** Framework\n\n#### **PySpring** is a Python web framework inspired by Spring Boot. It combines FastAPI for the web layer, and Pydantic for data validation. PySpring provides a structured approach to building scalable web applications with `auto dependency injection`, `auto configuration management` and a `web server` for hosting your application.\n\n## Key Features\n- **Application Initialization**: `PySpringApplication` class serves as the main entry point for the **PySpring** application. It initializes the application from a configuration file, scans the application source directory for Python files, and groups them into class files and model files.\n\n- **Application Context Management**: **PySpring** manages the application context and dependency injection. It registers application entities such as components, controllers, bean collections, and properties. It also initializes the application context and injects dependencies.\n\n- **REST Controllers**: **PySpring** supports RESTful API development using the RestController class. It allows you to define routes, handle HTTP requests, and register middlewares easily.\n\n- **Component-based Architecture**: **PySpring** encourages a component-based architecture, where components are reusable and modular building blocks of the application. Components can have their own lifecycle and can be registered and managed by the application context.\n\n- **Properties Management**: Properties classes provide a convenient way to manage application-specific configurations. **PySpring** supports loading properties from a properties file and injecting them into components.\n\n- **Framework Modules**: **PySpring** allows the integration of additional framework modules to extend the functionality of the application. Modules can provide additional routes, middlewares, or any other custom functionality required by the application.\n\n- **Builtin FastAPI Integration**: **PySpring** integrates with `FastAPI`, a modern, fast (high-performance), web framework for building APIs with Python. It leverages FastAPI's features for routing, request handling, and server configuration.\n\n## Project Structure\n```\nPySpring/\n\u251c\u2500\u2500 src/                    # Source code directory\n\u251c\u2500\u2500 tests/                  # Test files\n\u251c\u2500\u2500 logs/                   # Application logs\n\u251c\u2500\u2500 py_spring_core/         # Core framework package\n\u251c\u2500\u2500 app-config.json         # Application configuration\n\u251c\u2500\u2500 application-properties.json  # Application properties\n\u251c\u2500\u2500 main.py                 # Application entry point\n\u251c\u2500\u2500 pyproject.toml          # Project metadata and dependencies\n\u2514\u2500\u2500 README.md              # Project documentation\n```\n\n## Getting Started\n\n### Prerequisites\n- Python 3.10 or higher\n- pip (Python package installer)\n\n### Installation\n1. Install the **PySpring** framework:\n```bash\npip install py-spring-core\n```\n\n2. Create a new Python project and navigate to its directory\n\n3. Set up your application:\n   - Implement your application properties, components, and controllers using **PySpring** conventions inside the declared source code folder (which can be modified via the `app_src_target_dir` key in `app-config.json`)\n   - Create an `app-config.json` file for your application configuration\n   - Create an `application-properties.json` file for your application properties\n\n4. Create your main application script:\n```python\nfrom py_spring_core import PySpringApplication\n\ndef main():\n    app = PySpringApplication(\"./app-config.json\")\n    app.run()\n\nif __name__ == \"__main__\":\n    main()\n```\n\n5. Run your application:\n```bash\npython main.py\n```\n\nFor a complete example project, please refer to the [PySpring Example Project](https://github.com/NFUChen/PySpring-Example-Project).\n\n## Development Setup\n1. Clone the repository:\n```bash\ngit clone https://github.com/NFUChen/PySpring.git\ncd PySpring\n```\n\n2. Install development dependencies:\n```bash\npip install -e \".[dev]\"\n```\n\n3. Run tests:\n```bash\npytest\n```\n\n## Dependencies\nPySpring relies on several key dependencies:\n- FastAPI (0.112.0)\n- Pydantic (2.8.2)\n- Uvicorn (0.30.5)\n- Loguru (0.7.2)\n- And other supporting packages\n\nFor a complete list of dependencies, see `pyproject.toml`.\n\n## Contributing\n\nContributions to **PySpring** are welcome! If you find any issues or have suggestions for improvements, please:\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "PySpring is a Python web framework inspired by Spring Boot, combining FastAPI, and Pydantic for building scalable web applications with auto dependency injection, configuration management, and a web server.",
    "version": "0.0.23",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d42bfa927b09f506a014516be2fcd5a4fc1860246fcae7b472c4ee49939fa993",
                "md5": "15ea5b35db831fcdfed793e13e4e326b",
                "sha256": "47f0201d9d1212d091ebb6ac8a639a4fb9a63c344e2a42a2995a10a4ea837cdc"
            },
            "downloads": -1,
            "filename": "py_spring_core-0.0.23-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "15ea5b35db831fcdfed793e13e4e326b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.10",
            "size": 38605,
            "upload_time": "2025-07-20T15:24:40",
            "upload_time_iso_8601": "2025-07-20T15:24:40.478374Z",
            "url": "https://files.pythonhosted.org/packages/d4/2b/fa927b09f506a014516be2fcd5a4fc1860246fcae7b472c4ee49939fa993/py_spring_core-0.0.23-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7cff5ba14843330b0bde01333083c5c7f8559eec2362db4bd9292f6f4b1c9940",
                "md5": "385cde9587175c7a1927c785489546f2",
                "sha256": "baba19ebd0947cb6c3fd94bdef9701437640012fe0e4f39acd553f9fb3979403"
            },
            "downloads": -1,
            "filename": "py_spring_core-0.0.23.tar.gz",
            "has_sig": false,
            "md5_digest": "385cde9587175c7a1927c785489546f2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.10",
            "size": 40232,
            "upload_time": "2025-07-20T15:24:41",
            "upload_time_iso_8601": "2025-07-20T15:24:41.383517Z",
            "url": "https://files.pythonhosted.org/packages/7c/ff/5ba14843330b0bde01333083c5c7f8559eec2362db4bd9292f6f4b1c9940/py_spring_core-0.0.23.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-20 15:24:41",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "py-spring-core"
}
        
Elapsed time: 0.67347s