The Python framework for Data Applications
Plateforme enables you to build and deploy modern data-driven applications and services in seconds with the power of SQLAlchemy, Pydantic, and FastAPI.
Plateforme enables you to build and deploy modern data-driven applications and services in seconds with the power of SQLAlchemy, Pydantic, and FastAPI.
Write simple Python classes to define your backend database and API!
from plateforme import BaseResource, route
class Astronaut(BaseResource):
name: str
@route.get()
def hello(self) -> str:
return f'Hello {self.name}!'
from plateforme import BaseResource, route
class Astronaut(BaseResource):
name: str
@route.get()
def hello(self) -> str:
return f'Hello {self.name}!'
> pip install plateforme
> pip install plateforme
> plateforme init
> plateforme init
Everything you need to build great backend.
Focus on building features that drive value while we handle the technical details.
Our framework's data modeling approach lets you focus on your domain logic using familiar Python patterns. Define resources as classes, establish relationships with type hints, and let the framework handle the technical implementation.
It's designed for teams that value clean architecture and maintainable code, making it natural to express complex data relationships while maintaining simplicity.
Type-safe resources: Define your domain objects using standard Python classes and type hints. The framework automatically handles validation, serialization, and database mapping.
Learn more→Relationships made easy: Establish relationships between resources using Python's type system. Let the framework manage indexes, foreign keys, and cascading operations.
Learn more→1from plateforme import BaseResource, ConfigDict, Field
2
3class Material(BaseResource):
4 code: str = Field(unique=True)
5 name: str
6 rocket_parts: list['RocketPart'] = Field(default_factory=list)
7
8class Rocket(BaseResource):
9 code: str = Field(unique=True)
10 name: str
11 parts: list['RocketPart'] = Field(default_factory=list)
12
13class RocketPart(BaseResource):
14 __config__ = ConfigDict(
15 indexes=[{'rocket', 'material'}]
16 )
17 rocket: Rocket
18 material: Material
19 quantity: int
1from plateforme import BaseResource, ConfigDict, Field
2
3class Material(BaseResource):
4 code: str = Field(unique=True)
5 name: str
6 rocket_parts: list['RocketPart'] = Field(default_factory=list)
7
8class Rocket(BaseResource):
9 code: str = Field(unique=True)
10 name: str
11 parts: list['RocketPart'] = Field(default_factory=list)
12
13class RocketPart(BaseResource):
14 __config__ = ConfigDict(
15 indexes=[{'rocket', 'material'}]
16 )
17 rocket: Rocket
18 material: Material
19 quantity: int
Transform your resource methods into fully configurable API endpoints. Use decorators to define routes, customize responses, and leverage all FastAPI capabilities while maintaining clean, focused business logic.
The framework seamlessly handles request parsing, validation, and response serialization, letting you concentrate on what your endpoints should do rather than how to implement them.
Configurable endpoints: Design your endpoints with complete control over validation, responses, and dependencies. All FastAPI's powerful features are available through simple decorators.
Learn more→Enhanced navigation: Build hierarchical endpoints that naturally follow your data structure and relationships. Access nested resources through type-safe, automatically generated URLs.
Learn more→1from plateforme import BaseResource
2from plateforme.api import AsyncSessionDep, route
3from plateforme.database import func, select
4
5class Material(BaseResource):
6 ...
7
8 @route.post()
9 async def update_name(self, name: str) -> str:
10 self.name = name
11 return f'Material name updated to {name!r}.'
12
13 @route.get()
14 @classmethod
15 async def count(cls, session: AsyncSessionDep) -> int:
16 query = select(func.count()).select_from(cls)
17 result = await session.execute(query)
18 return result.scalar()
1from plateforme import BaseResource
2from plateforme.api import AsyncSessionDep, route
3from plateforme.database import func, select
4
5class Material(BaseResource):
6 ...
7
8 @route.post()
9 async def update_name(self, name: str) -> str:
10 self.name = name
11 return f'Material name updated to {name!r}.'
12
13 @route.get()
14 @classmethod
15 async def count(cls, session: AsyncSessionDep) -> int:
16 query = select(func.count()).select_from(cls)
17 result = await session.execute(query)
18 return result.scalar()
1from plateforme import ConfigDict, CRUDResource
2
3class Rocket(CRUDResource):
4 __config__ = ConfigDict(
5 api_max_depth=1,
6 api_max_selection=10,
7 )
8 ...
1from plateforme import ConfigDict, CRUDResource
2
3class Rocket(CRUDResource):
4 __config__ = ConfigDict(
5 api_max_depth=1,
6 api_max_selection=10,
7 )
8 ...
Turn your resources into fully-featured REST APIs with a single class inheritance. CRUD resource and service automatically provides a complete set of endpoints with powerful querying capabilities and configurable behavior.
Control your API's behavior through simple configuration options while maintaining security and performance boundaries. The framework handles pagination, field selection, data validation, and much more automatically.
Generated from CRUD
{
"include": {
"__all__": { "code": true, "name": true }
}
}
{
"include": {
"__all__": { "code": true, "name": true }
}
}
{
"code": "FAL-9",
"name": "Falcon 9"
}
{
"code": "FAL-9",
"name": "Falcon 9"
}
{
"payload": {
"code": "F9"
},
"include": {
"__all__": { "code": true, "name": true }
}
}
{
"payload": {
"code": "F9"
},
"include": {
"__all__": { "code": true, "name": true }
}
}
{
"code": "F9",
"name": "Falcon 9"
}
{
"code": "F9",
"name": "Falcon 9"
}
{
"payload": {
"code": "ARI-6",
"name": "Ariane 6",
"description": "European launch vehicle."
}
}
{
"payload": {
"code": "ARI-6",
"name": "Ariane 6",
"description": "European launch vehicle."
}
}
[
{
"id": 2,
"type": "rocket",
"code": "ARI-6",
"name": "Ariane 6",
"description": "European launch vehicle.",
"parts": []
}
]
[
{
"id": 2,
"type": "rocket",
"code": "ARI-6",
"name": "Ariane 6",
"description": "European launch vehicle.",
"parts": []
}
]
{
"include": {
"__all__": { "code": true, "name": true }
}
}
{
"include": {
"__all__": { "code": true, "name": true }
}
}
{
"code": "FAL-9",
"name": "Falcon 9"
}
{
"code": "FAL-9",
"name": "Falcon 9"
}
{
"payload": {
"code": "F9"
},
"include": {
"__all__": { "code": true, "name": true }
}
}
{
"payload": {
"code": "F9"
},
"include": {
"__all__": { "code": true, "name": true }
}
}
{
"code": "F9",
"name": "Falcon 9"
}
{
"code": "F9",
"name": "Falcon 9"
}
{
"payload": {
"code": "ARI-6",
"name": "Ariane 6",
"description": "European launch vehicle."
}
}
{
"payload": {
"code": "ARI-6",
"name": "Ariane 6",
"description": "European launch vehicle."
}
}
[
{
"id": 2,
"type": "rocket",
"code": "ARI-6",
"name": "Ariane 6",
"description": "European launch vehicle.",
"parts": []
}
]
[
{
"id": 2,
"type": "rocket",
"code": "ARI-6",
"name": "Ariane 6",
"description": "European launch vehicle.",
"parts": []
}
]
Shape API responses and manipulate resources with RestX expressive query language.
READ
Retrieves parts from rocket ID 4 where material codes start with 'NC', returning part IDs, quantities, and material details (code and name).
GET http://localhost:8000/rockets?.parts*.id=3 HTTP/1.1
content-type: application/json
{
"include": {
"__all__": {
"id": true,
"material": {
"code": true,
"name": true
},
"quantity": true
}
}
}
GET http://localhost:8000/rockets?.parts*.id=3 HTTP/1.1
content-type: application/json
{
"include": {
"__all__": {
"id": true,
"material": {
"code": true,
"name": true
},
"quantity": true
}
}
}
[
{
"id": 3,
"material": {
"code": "NC-150",
"name": "Nose Cone"
},
"quantity": 2
},
{
"id": 4,
"material": {
"code": "NC-600",
"name": "Navigation Computer"
},
"quantity": 5
}
]
[
{
"id": 3,
"material": {
"code": "NC-150",
"name": "Nose Cone"
},
"quantity": 2
},
{
"id": 4,
"material": {
"code": "NC-600",
"name": "Navigation Computer"
},
"quantity": 5
}
]
CREATE
Adds multiple rockets with nested parts using either material IDs or new material data.
POST http://127.0.0.1:8001/rockets HTTP/1.1
content-type: application/json
{
"payload": [
{
"name": "Atlas V",
"code": "ATL-6",
"parts": [
{
"material": 3,
"quantity": 1
},
...
]
},
{
"name": "Ariane 6",
"code": "ARI-6",
"parts": [
{
"material": {
"name": "Attitude Control System",
"code": "AC-650"
},
"quantity": 2
},
...
]
}
]
}
POST http://127.0.0.1:8001/rockets HTTP/1.1
content-type: application/json
{
"payload": [
{
"name": "Atlas V",
"code": "ATL-6",
"parts": [
{
"material": 3,
"quantity": 1
},
...
]
},
{
"name": "Ariane 6",
"code": "ARI-6",
"parts": [
{
"material": {
"name": "Attitude Control System",
"code": "AC-650"
},
"quantity": 2
},
...
]
}
]
}
UPDATE
Updates parts list for all rockets with codes containing 'ARI', replacing existing parts with new ones.
PATCH http://127.0.0.1:8001/rockets?.code=like~%ARI% HTTP/1.1
content-type: application/json
{
"payload": {
"parts": [
{
"material": 1,
"quantity": 2
},
{
"material": 4,
"quantity": 1
}
]
}
}
PATCH http://127.0.0.1:8001/rockets?.code=like~%ARI% HTTP/1.1
content-type: application/json
{
"payload": {
"parts": [
{
"material": 1,
"quantity": 2
},
{
"material": 4,
"quantity": 1
}
]
}
}