fusion-framework (Python)
نسخهی پایتونِ کلاسمحور برای fusion-core (هستهی Rust).
در این طراحی، منطقهای اصلی مثل routing، parsing، serialization و binding پارامترهای handler در Rust انجام میشود. سمت پایتون فقط interface و DX باقی میماند.
نصب
pip install fusion-framework
شروع سریع
from fusion_framework.api import FusionBaseApi
from fusion_framework.route import router
from fusion_framework.app import run
@router("/api/[module]/{id}")
class MyModule(FusionBaseApi):
def get(self, id: int):
# `id` طبق annotation به int تبدیل میشود (در Rust)
return self.response({"ok": True, "id": id}, status=200)
if __name__ == "__main__":
run()
قرارداد Handlerها
متدهای HTTP مثل get/post/put/delete/patch را به صورت معمول پیاده کن.
- ورودیها از طریق امضای متد (
def get(self, id: int, ...)) گرفته میشوند. - منبع مقدار بر اساس نام پارامتر:
- اگر نام با
path paramsیکی باشد → از path - اگر متد
POST/PUT/PATCHباشد و نام در body JSON باشد → از body - در غیر این صورت اگر نام در
queryباشد → از query
- اگر پارامتری annotation/optional داشته باشد و وجود نداشته باشد →
Noneارسال میشود.
خطاها
from fusion_framework.http import HTTPException
raise HTTPException(404, {"detail": "not found"})
فایلهای مهم
fusion_framework.api.FusionBaseApi- view درخواست:
method/path/body/headers/params/query - helper envelope:
response(...)
- view درخواست:
fusion_framework.route.router- ثبت کلاسها با template مثل
/api/[module]/{id}
- ثبت کلاسها با template مثل
fusion_framework.app.run- settings را لود میکند و برنامه را mount/listen میکند
- پشت صحنه:
crates/fusion-py/src/lib.rs: PyO3 bridgecrates/fusion-core/src/*: routing/serialize/binding مشترک
Release files for fusion-framework 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fusion_framework-1.1.0.tar.gz | 45.1 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| fusion_framework-1.1.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| fusion_framework-1.1.0-cp39-abi3-manylinux_2_28_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| fusion_framework-1.1.0-cp39-abi3-manylinux_2_28_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ ARM64 | Details |
| fusion_framework-1.1.0-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 3.7 MB
Release files / fusion_framework-1.1.0.tar.gz
| Download URL | fusion_framework-1.1.0.tar.gz |
|---|---|
| Size | 45.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43fb33129d102b7092051eb75b70c94a33c4695251e175162f891aa0df9d999d
|
|
BLAKE2b-256 checksum How to use checksums |
f152295e84cb4f9a4c0dfbc02fcb3cd9c3e596c49d8eed6d05a57bc29584edfd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.
Transparency logRelease files / fusion_framework-1.1.0-cp39-abi3-win_amd64.whl
| Download URL | fusion_framework-1.1.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 773.8 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5f4d588372300969b8ec47de8401f1b72413fdd6542328d0c7930865a7ad8455
|
|
BLAKE2b-256 checksum How to use checksums |
242ee3f20fc2eb2b8c6a1cabeb00ed671aac509cc0364684d9d12c74325b6801
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.
Transparency logRelease files / fusion_framework-1.1.0-cp39-abi3-manylinux_2_28_x86_64.whl
| Download URL | fusion_framework-1.1.0-cp39-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 997.9 kB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
391c54ce6771716ef6d6933fa4fd203238b1c4c19a2fd492bfa8f6150b2857bb
|
|
BLAKE2b-256 checksum How to use checksums |
10f3a532deb5686fa1cb4e54c04e822eb75c25fa50ff0e5f6fdab44b6e4f44c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.
Transparency logRelease files / fusion_framework-1.1.0-cp39-abi3-manylinux_2_28_aarch64.whl
| Download URL | fusion_framework-1.1.0-cp39-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 986.3 kB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
e8e759e6578b78d576371d85f929d45c8eeb728c29324dd607ce1449ded022ee
|
|
BLAKE2b-256 checksum How to use checksums |
d69dd8e9fda37ae0ff6579a8995d8f7e69048db009f1c83d9aa3eebe43eb1e51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.
Transparency logRelease files / fusion_framework-1.1.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | fusion_framework-1.1.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 877.7 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e984ba5f8ed1c3dd4695bdf30d8b80ea4a68c8bca20ba8f32b93ad95f0b6c155
|
|
BLAKE2b-256 checksum How to use checksums |
54405c78880b8ec1c2119eba49369bff44eff47d74cfeba1d00e8108cb7db5bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.
Transparency log