| Name | abstract-backend JSON |
| Version |
0.0.1
JSON |
| download |
| home_page | None |
| Summary | 🧑🏫 A library as an abstract layer to rule BackEnd side components and support it as Python plugin features. |
| upload_time | 2025-11-02 11:51:12 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | <4.0,>=3.12 |
| license | MIT License Copyright (c) 2025 Bryant Liu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| keywords |
abstract-layer
abstraction
backend
message-queue
queue
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
|
# Abstract Backend
Abstract Backend provides a **pluggable backend layer** for Python services. Applications code against shared protocols while concrete providers—Redis, Kafka, AWS SQS, or your own implementation—are discovered at runtime. Install a provider with `pip`, remove it with `pip uninstall`, and keep your business logic unchanged.
## Status & Quality
### CI/CD & Testing
[](https://github.com/Chisanan232/abstract-backend/actions/workflows/ci.yaml)
[](https://github.com/Chisanan232/abstract-backend/actions/workflows/documentation.yaml)
[](https://github.com/Chisanan232/abstract-backend/actions/workflows/docs-build-check.yaml)
### Code Coverage & Quality
[](https://codecov.io/gh/Chisanan232/abstract-backend)
[](https://sonarcloud.io/summary/new_code?id=Chisanan232_abstract-backend)
[](https://sonarcloud.io/summary/new_code?id=Chisanan232_abstract-backend)
[](https://sonarcloud.io/summary/new_code?id=Chisanan232_abstract-backend)
[](https://sonarcloud.io/summary/new_code?id=Chisanan232_abstract-backend)
### Code Style & Standards
[](https://github.com/psf/black)
[](https://github.com/pylint-dev/pylint)
[](https://pycqa.github.io/isort/)
[](http://mypy-lang.org/)
### Package Info
[](https://badge.fury.io/py/abstract-backend)
[](https://pypi.org/project/abstract-backend)
[](https://opensource.org/licenses/MIT)
### Downloads
[](https://pepy.tech/project/abstract-backend)
[](https://pepy.tech/project/abstract-backend)
[](https://pepy.tech/project/abstract-backend)
---
## Why it exists
- **🚫 Stop copying backend code** – Extracted from real MCP server projects so multiple services can share the same queue abstraction.
- **📐 Protocol-first design** – Contracts live in `abe/types.py`, keeping providers honest with structural typing and contract tests.
- **🔍 Runtime discovery** – `load_backend()` selects implementations via Python entry points, driven by environment variables.
- **📊 Operational clarity** – Logging helpers, contract suites, and documentation make backends observable and portable.
## Features
- **📮 Queue provider protocols** covering publish, consume, and lifecycle operations.
- **⚙️ AsyncLoopConsumer** helper to execute handlers against any compliant backend.
- **🪵 Logging utilities** for consistent configuration across providers and apps.
- **🧪 Contract tests** to validate third-party implementations.
- **📚 Documentation & examples** detailing architecture, provider lifecycle, and runtime flow.
## Installation
Install the core library:
```bash
pip install abstract-backend
```
Then install one or more providers, for example the Redis backend:
```bash
pip install abe-redis
```
Set `QUEUE_BACKEND=redis` (the entry-point exposed by `abe-redis`) and `load_backend()` will resolve the correct provider at runtime.
## Quick start ⚡️
```python
from abe.backends.message_queue.loader import load_backend
from abe.backends.message_queue.consumer import AsyncLoopConsumer
async def process(payload: dict[str, object]) -> None:
...
async def main() -> None:
backend = load_backend()
consumer = AsyncLoopConsumer(backend, group="billing")
await consumer.run(process)
```
See `docs/contents/development/architecture/` for diagrams explaining the flow and provider relationships.
## Building providers 🧩
1. Implement the protocols from `abe/types.py` (especially `MessageQueueBackendProtocol`).
2. Expose a `from_env()` constructor for runtime configuration.
3. Register an entry point under `abe.backends.message_queue` in `pyproject.toml`.
4. Run the contract tests in `test/contract_test/backends/message_queue/` against your provider.
5. Publish your package to PyPI; users activate it with `pip install` and `QUEUE_BACKEND`.
The showcase at `/docs/src/pages/showcase.tsx` highlights template and reference implementations such as `abe-redis`.
## Development 🛠️
- Install dev dependencies with `uv pip install -r pyproject.toml` or your preferred tool.
- Run tests: `uv run pytest`.
- Type checking: `uv run mypy`.
- Linting: `uv run pylint abe tests`.
The project follows `black` formatting and `pylint` linting (see `.pre-commit-config.yaml`).
## Documentation & showcase 📖
- Developer docs live under `docs/contents/development/` and include architecture, provider lifecycle, and layer integration guides.
- A Showcase page (`/docs/src/pages/showcase.tsx`) lists template and implementation repositories with release badges.
- Run `cd docs && pnpm start` for local previews.
## CI/CD & workflows 🤖
- GitHub Actions definitions reside in `.github/workflows/`.
- Reusable workflows leverage the logging, testing, and packaging helpers of this project.
- `docusaurus.config.ts` and `docs/contents/development/sidebars.ts` manage documentation navigation.
## License
This project is licensed under the [MIT License](./LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "abstract-backend",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": "abstract-layer, abstraction, backend, message-queue, queue",
"author": null,
"author_email": "Chisanan232 <chi10211201@cycu.org.tw>",
"download_url": "https://files.pythonhosted.org/packages/99/3c/2fde5cac67d4ba3b1544638acfb0ea0119c27d5d37f1e1a4dc0e2529fdee/abstract_backend-0.0.1.tar.gz",
"platform": null,
"description": "# Abstract Backend\n\nAbstract Backend provides a **pluggable backend layer** for Python services. Applications code against shared protocols while concrete providers\u2014Redis, Kafka, AWS SQS, or your own implementation\u2014are discovered at runtime. Install a provider with `pip`, remove it with `pip uninstall`, and keep your business logic unchanged.\n\n## Status & Quality\n\n### CI/CD & Testing\n[](https://github.com/Chisanan232/abstract-backend/actions/workflows/ci.yaml)\n[](https://github.com/Chisanan232/abstract-backend/actions/workflows/documentation.yaml)\n[](https://github.com/Chisanan232/abstract-backend/actions/workflows/docs-build-check.yaml)\n\n### Code Coverage & Quality\n[](https://codecov.io/gh/Chisanan232/abstract-backend)\n[](https://sonarcloud.io/summary/new_code?id=Chisanan232_abstract-backend)\n[](https://sonarcloud.io/summary/new_code?id=Chisanan232_abstract-backend)\n[](https://sonarcloud.io/summary/new_code?id=Chisanan232_abstract-backend)\n[](https://sonarcloud.io/summary/new_code?id=Chisanan232_abstract-backend)\n\n### Code Style & Standards\n[](https://github.com/psf/black)\n[](https://github.com/pylint-dev/pylint)\n[](https://pycqa.github.io/isort/)\n[](http://mypy-lang.org/)\n\n### Package Info\n[](https://badge.fury.io/py/abstract-backend)\n[](https://pypi.org/project/abstract-backend)\n[](https://opensource.org/licenses/MIT)\n\n### Downloads\n[](https://pepy.tech/project/abstract-backend)\n[](https://pepy.tech/project/abstract-backend)\n[](https://pepy.tech/project/abstract-backend)\n\n---\n\n## Why it exists\n\n- **\ud83d\udeab Stop copying backend code** \u2013 Extracted from real MCP server projects so multiple services can share the same queue abstraction.\n- **\ud83d\udcd0 Protocol-first design** \u2013 Contracts live in `abe/types.py`, keeping providers honest with structural typing and contract tests.\n- **\ud83d\udd0d Runtime discovery** \u2013 `load_backend()` selects implementations via Python entry points, driven by environment variables.\n- **\ud83d\udcca Operational clarity** \u2013 Logging helpers, contract suites, and documentation make backends observable and portable.\n\n## Features\n\n- **\ud83d\udcee Queue provider protocols** covering publish, consume, and lifecycle operations.\n- **\u2699\ufe0f AsyncLoopConsumer** helper to execute handlers against any compliant backend.\n- **\ud83e\udeb5 Logging utilities** for consistent configuration across providers and apps.\n- **\ud83e\uddea Contract tests** to validate third-party implementations.\n- **\ud83d\udcda Documentation & examples** detailing architecture, provider lifecycle, and runtime flow.\n\n## Installation\n\nInstall the core library:\n\n```bash\npip install abstract-backend\n```\n\nThen install one or more providers, for example the Redis backend:\n\n```bash\npip install abe-redis\n```\n\nSet `QUEUE_BACKEND=redis` (the entry-point exposed by `abe-redis`) and `load_backend()` will resolve the correct provider at runtime.\n\n## Quick start \u26a1\ufe0f\n\n```python\nfrom abe.backends.message_queue.loader import load_backend\nfrom abe.backends.message_queue.consumer import AsyncLoopConsumer\n\n\nasync def process(payload: dict[str, object]) -> None:\n ...\n\n\nasync def main() -> None:\n backend = load_backend()\n consumer = AsyncLoopConsumer(backend, group=\"billing\")\n await consumer.run(process)\n```\n\nSee `docs/contents/development/architecture/` for diagrams explaining the flow and provider relationships.\n\n## Building providers \ud83e\udde9\n\n1. Implement the protocols from `abe/types.py` (especially `MessageQueueBackendProtocol`).\n2. Expose a `from_env()` constructor for runtime configuration.\n3. Register an entry point under `abe.backends.message_queue` in `pyproject.toml`.\n4. Run the contract tests in `test/contract_test/backends/message_queue/` against your provider.\n5. Publish your package to PyPI; users activate it with `pip install` and `QUEUE_BACKEND`.\n\nThe showcase at `/docs/src/pages/showcase.tsx` highlights template and reference implementations such as `abe-redis`.\n\n## Development \ud83d\udee0\ufe0f\n\n- Install dev dependencies with `uv pip install -r pyproject.toml` or your preferred tool.\n- Run tests: `uv run pytest`.\n- Type checking: `uv run mypy`.\n- Linting: `uv run pylint abe tests`.\n\nThe project follows `black` formatting and `pylint` linting (see `.pre-commit-config.yaml`).\n\n## Documentation & showcase \ud83d\udcd6\n\n- Developer docs live under `docs/contents/development/` and include architecture, provider lifecycle, and layer integration guides.\n- A Showcase page (`/docs/src/pages/showcase.tsx`) lists template and implementation repositories with release badges.\n- Run `cd docs && pnpm start` for local previews.\n\n## CI/CD & workflows \ud83e\udd16\n\n- GitHub Actions definitions reside in `.github/workflows/`.\n- Reusable workflows leverage the logging, testing, and packaging helpers of this project.\n- `docusaurus.config.ts` and `docs/contents/development/sidebars.ts` manage documentation navigation.\n\n## License\n\nThis project is licensed under the [MIT License](./LICENSE).\n",
"bugtrack_url": null,
"license": " MIT License Copyright (c) 2025 Bryant Liu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "\ud83e\uddd1\u200d\ud83c\udfeb A library as an abstract layer to rule BackEnd side components and support it as Python plugin features.",
"version": "0.0.1",
"project_urls": {
"Changelog": "https://chisanan232.github.io/abstract-backend/docs/next/changelog",
"Documentation": "https://chisanan232.github.io/abstract-backend/",
"Homepage": "https://github.com/Chisanan232/abstract-backend",
"Project Management": "https://app.clickup.com/9018752317/v/f/90189305252/90184991515",
"Repository": "https://github.com/Chisanan232/abstract-backend"
},
"split_keywords": [
"abstract-layer",
" abstraction",
" backend",
" message-queue",
" queue"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c2119b98d704f6b908a5ea60652de0bd497e58aae1e342031333076880536f95",
"md5": "6f79ed05bdbe70aa2b50f4f24ded49c5",
"sha256": "5f59200b098633d9150e41953a8fec8610047e14afdb5ef9e4986dcc6b99d485"
},
"downloads": -1,
"filename": "abstract_backend-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6f79ed05bdbe70aa2b50f4f24ded49c5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 23525,
"upload_time": "2025-11-02T11:51:11",
"upload_time_iso_8601": "2025-11-02T11:51:11.449976Z",
"url": "https://files.pythonhosted.org/packages/c2/11/9b98d704f6b908a5ea60652de0bd497e58aae1e342031333076880536f95/abstract_backend-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "993c2fde5cac67d4ba3b1544638acfb0ea0119c27d5d37f1e1a4dc0e2529fdee",
"md5": "8459cc76f281597d8b399cdc48b11e23",
"sha256": "b716fc23f937cf96b4693e7663dbec143b59e6f12e7a4eccc566b99cdd73c2ed"
},
"downloads": -1,
"filename": "abstract_backend-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "8459cc76f281597d8b399cdc48b11e23",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 16748,
"upload_time": "2025-11-02T11:51:12",
"upload_time_iso_8601": "2025-11-02T11:51:12.817473Z",
"url": "https://files.pythonhosted.org/packages/99/3c/2fde5cac67d4ba3b1544638acfb0ea0119c27d5d37f1e1a4dc0e2529fdee/abstract_backend-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-11-02 11:51:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Chisanan232",
"github_project": "abstract-backend",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "abstract-backend"
}