A python backend framework
Project description
Blue Firmament
中文名:碧霄 日语名:青空 (AoSora)
A backend framework for Python applications that covers all you need, and aims at building east-to-read, maintainable application.
Installation
pip install blue-firmament
Usage
import blue_firmament
# 获取日志器
import blue_firmament.log
logger = blue_firmament.log.get_logger(__name__)
# 覆盖设置
from app.data.settings.base import get_setting as get_base_setting
from app.data.settings.dal import get_setting as get_dal_setting
import blue_firmament.main
from blue_firmament.transport.http import HTTPTransporter
from blue_firmament.session.common import CommonSession
app = blue_firmament.main.BlueFirmamentApp()
# 添加一个传输层
app.add_transporter(HTTPTransporter(
app.handle_request, CommonSession,
host=get_base_setting().http_host, port=get_base_setting().http_port,
))
logger.info("Initializing BlueFirmament's Routers and Middlewares...")
# 配置数据访问层
from blue_firmament.dal import set_anon_dao
from blue_firmament.dal.postgrest_dal import PostgrestDataAccessObject
# 配置一个全局的ANON角色的PostgrestDAO实例,会话在无法获取到权限的时候会fallback到此
set_anon_dao(PostgrestDataAccessObject(
token=get_dal_setting().postgrest_anonymous_token,
), PostgrestDataAccessObject)
# 声明数据模型
from blue_firmament.transport import TransportOperationType
from app.schemas.main import AccountProfile
# 基于数据模型添加CRUD服务
app.provide_crud_over_scheme('account', disabled_operations=(TransportOperationType.DELETE,))(AccountProfile)
# 启动服务
app.run()
Documentation
To build the documentation:
# Install documentation dependencies
pip install -e ".[docs]"
# Build the documentation
cd docs
make html
After building, the documentation will be available in docs/_build/html.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blue_firmament-0.1.1.tar.gz.
File metadata
- Download URL: blue_firmament-0.1.1.tar.gz
- Upload date:
- Size: 70.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61fbf1886900d2b6af4d90b673f1c8156228a7a2f6fe4d938ae9f8121c7c081a
|
|
| MD5 |
7459b42682fcda80efaa3c92c49ec479
|
|
| BLAKE2b-256 |
92278cbb8d86b3fd5ebdb9e94061961a2ada010987f389fd7e24fffef3a1febb
|
Provenance
The following attestation bundles were made for blue_firmament-0.1.1.tar.gz:
Publisher:
python-publish.yml on xiaoland/BlueFirmament
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blue_firmament-0.1.1.tar.gz -
Subject digest:
61fbf1886900d2b6af4d90b673f1c8156228a7a2f6fe4d938ae9f8121c7c081a - Sigstore transparency entry: 199889045
- Sigstore integration time:
-
Permalink:
xiaoland/BlueFirmament@d0b8e8b07c7eabe81239332e7b874b08548bb443 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/xiaoland
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d0b8e8b07c7eabe81239332e7b874b08548bb443 -
Trigger Event:
release
-
Statement type:
File details
Details for the file blue_firmament-0.1.1-py3-none-any.whl.
File metadata
- Download URL: blue_firmament-0.1.1-py3-none-any.whl
- Upload date:
- Size: 77.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e9cd86f6bdd1870ef0ba20bc1835dd60325e6a7f8e958f4249e7ce66d19a929
|
|
| MD5 |
aa4423ac68f1aca71bf00990dc3b870a
|
|
| BLAKE2b-256 |
7a86c1be8a6c7ebd039144e8d758b93845bc6fa0a0733c517fe377c6d5623e04
|
Provenance
The following attestation bundles were made for blue_firmament-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on xiaoland/BlueFirmament
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blue_firmament-0.1.1-py3-none-any.whl -
Subject digest:
2e9cd86f6bdd1870ef0ba20bc1835dd60325e6a7f8e958f4249e7ce66d19a929 - Sigstore transparency entry: 199889046
- Sigstore integration time:
-
Permalink:
xiaoland/BlueFirmament@d0b8e8b07c7eabe81239332e7b874b08548bb443 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/xiaoland
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d0b8e8b07c7eabe81239332e7b874b08548bb443 -
Trigger Event:
release
-
Statement type: