mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-03-01 17:00:48 +01:00
chore: documentation (#76)
* chore: update docstring example to use python code block * docs: add documentation * feat: add docs build + fix other workdlows * fix: add missing return type
This commit is contained in:
27
docs/reference/cli.md
Normal file
27
docs/reference/cli.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# `cli`
|
||||
|
||||
Here's the reference for the CLI configuration helpers used to load settings from `pyproject.toml`.
|
||||
|
||||
You can import them directly from `fastapi_toolsets.cli.config`:
|
||||
|
||||
```python
|
||||
from fastapi_toolsets.cli.config import (
|
||||
import_from_string,
|
||||
get_config_value,
|
||||
get_fixtures_registry,
|
||||
get_db_context,
|
||||
get_custom_cli,
|
||||
)
|
||||
```
|
||||
|
||||
## ::: fastapi_toolsets.cli.config.import_from_string
|
||||
|
||||
## ::: fastapi_toolsets.cli.config.get_config_value
|
||||
|
||||
## ::: fastapi_toolsets.cli.config.get_fixtures_registry
|
||||
|
||||
## ::: fastapi_toolsets.cli.config.get_db_context
|
||||
|
||||
## ::: fastapi_toolsets.cli.config.get_custom_cli
|
||||
|
||||
## ::: fastapi_toolsets.cli.utils.async_command
|
||||
20
docs/reference/crud.md
Normal file
20
docs/reference/crud.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# `crud`
|
||||
|
||||
Here's the reference for the CRUD classes, factory, and search utilities.
|
||||
|
||||
You can import the main symbols from `fastapi_toolsets.crud`:
|
||||
|
||||
```python
|
||||
from fastapi_toolsets.crud import CrudFactory, AsyncCrud
|
||||
from fastapi_toolsets.crud.search import SearchConfig, get_searchable_fields, build_search_filters
|
||||
```
|
||||
|
||||
## ::: fastapi_toolsets.crud.factory.AsyncCrud
|
||||
|
||||
## ::: fastapi_toolsets.crud.factory.CrudFactory
|
||||
|
||||
## ::: fastapi_toolsets.crud.search.SearchConfig
|
||||
|
||||
## ::: fastapi_toolsets.crud.search.get_searchable_fields
|
||||
|
||||
## ::: fastapi_toolsets.crud.search.build_search_filters
|
||||
28
docs/reference/db.md
Normal file
28
docs/reference/db.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# `db`
|
||||
|
||||
Here's the reference for all database session utilities, transaction helpers, and locking functions.
|
||||
|
||||
You can import them directly from `fastapi_toolsets.db`:
|
||||
|
||||
```python
|
||||
from fastapi_toolsets.db import (
|
||||
LockMode,
|
||||
create_db_dependency,
|
||||
create_db_context,
|
||||
get_transaction,
|
||||
lock_tables,
|
||||
wait_for_row_change,
|
||||
)
|
||||
```
|
||||
|
||||
## ::: fastapi_toolsets.db.LockMode
|
||||
|
||||
## ::: fastapi_toolsets.db.create_db_dependency
|
||||
|
||||
## ::: fastapi_toolsets.db.create_db_context
|
||||
|
||||
## ::: fastapi_toolsets.db.get_transaction
|
||||
|
||||
## ::: fastapi_toolsets.db.lock_tables
|
||||
|
||||
## ::: fastapi_toolsets.db.wait_for_row_change
|
||||
13
docs/reference/dependencies.md
Normal file
13
docs/reference/dependencies.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# `dependencies`
|
||||
|
||||
Here's the reference for the FastAPI dependency factory functions.
|
||||
|
||||
You can import them directly from `fastapi_toolsets.dependencies`:
|
||||
|
||||
```python
|
||||
from fastapi_toolsets.dependencies import PathDependency, BodyDependency
|
||||
```
|
||||
|
||||
## ::: fastapi_toolsets.dependencies.PathDependency
|
||||
|
||||
## ::: fastapi_toolsets.dependencies.BodyDependency
|
||||
34
docs/reference/exceptions.md
Normal file
34
docs/reference/exceptions.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# `exceptions`
|
||||
|
||||
Here's the reference for all exception classes and handler utilities.
|
||||
|
||||
You can import them directly from `fastapi_toolsets.exceptions`:
|
||||
|
||||
```python
|
||||
from fastapi_toolsets.exceptions import (
|
||||
ApiException,
|
||||
UnauthorizedError,
|
||||
ForbiddenError,
|
||||
NotFoundError,
|
||||
ConflictError,
|
||||
NoSearchableFieldsError,
|
||||
generate_error_responses,
|
||||
init_exceptions_handlers,
|
||||
)
|
||||
```
|
||||
|
||||
## ::: fastapi_toolsets.exceptions.exceptions.ApiException
|
||||
|
||||
## ::: fastapi_toolsets.exceptions.exceptions.UnauthorizedError
|
||||
|
||||
## ::: fastapi_toolsets.exceptions.exceptions.ForbiddenError
|
||||
|
||||
## ::: fastapi_toolsets.exceptions.exceptions.NotFoundError
|
||||
|
||||
## ::: fastapi_toolsets.exceptions.exceptions.ConflictError
|
||||
|
||||
## ::: fastapi_toolsets.exceptions.exceptions.NoSearchableFieldsError
|
||||
|
||||
## ::: fastapi_toolsets.exceptions.exceptions.generate_error_responses
|
||||
|
||||
## ::: fastapi_toolsets.exceptions.handler.init_exceptions_handlers
|
||||
31
docs/reference/fixtures.md
Normal file
31
docs/reference/fixtures.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# `fixtures`
|
||||
|
||||
Here's the reference for the fixture registry, enums, and loading utilities.
|
||||
|
||||
You can import them directly from `fastapi_toolsets.fixtures`:
|
||||
|
||||
```python
|
||||
from fastapi_toolsets.fixtures import (
|
||||
Context,
|
||||
LoadStrategy,
|
||||
Fixture,
|
||||
FixtureRegistry,
|
||||
load_fixtures,
|
||||
load_fixtures_by_context,
|
||||
get_obj_by_attr,
|
||||
)
|
||||
```
|
||||
|
||||
## ::: fastapi_toolsets.fixtures.enum.Context
|
||||
|
||||
## ::: fastapi_toolsets.fixtures.enum.LoadStrategy
|
||||
|
||||
## ::: fastapi_toolsets.fixtures.registry.Fixture
|
||||
|
||||
## ::: fastapi_toolsets.fixtures.registry.FixtureRegistry
|
||||
|
||||
## ::: fastapi_toolsets.fixtures.utils.load_fixtures
|
||||
|
||||
## ::: fastapi_toolsets.fixtures.utils.load_fixtures_by_context
|
||||
|
||||
## ::: fastapi_toolsets.fixtures.utils.get_obj_by_attr
|
||||
13
docs/reference/logger.md
Normal file
13
docs/reference/logger.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# `logger`
|
||||
|
||||
Here's the reference for the logging utilities.
|
||||
|
||||
You can import them directly from `fastapi_toolsets.logger`:
|
||||
|
||||
```python
|
||||
from fastapi_toolsets.logger import configure_logging, get_logger
|
||||
```
|
||||
|
||||
## ::: fastapi_toolsets.logger.configure_logging
|
||||
|
||||
## ::: fastapi_toolsets.logger.get_logger
|
||||
15
docs/reference/metrics.md
Normal file
15
docs/reference/metrics.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# `metrics`
|
||||
|
||||
Here's the reference for the Prometheus metrics registry and endpoint handler.
|
||||
|
||||
You can import them directly from `fastapi_toolsets.metrics`:
|
||||
|
||||
```python
|
||||
from fastapi_toolsets.metrics import Metric, MetricsRegistry, init_metrics
|
||||
```
|
||||
|
||||
## ::: fastapi_toolsets.metrics.registry.Metric
|
||||
|
||||
## ::: fastapi_toolsets.metrics.registry.MetricsRegistry
|
||||
|
||||
## ::: fastapi_toolsets.metrics.handler.init_metrics
|
||||
28
docs/reference/pytest.md
Normal file
28
docs/reference/pytest.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# `pytest`
|
||||
|
||||
Here's the reference for all testing utilities and pytest fixtures.
|
||||
|
||||
You can import them directly from `fastapi_toolsets.pytest`:
|
||||
|
||||
```python
|
||||
from fastapi_toolsets.pytest import (
|
||||
register_fixtures,
|
||||
create_async_client,
|
||||
create_db_session,
|
||||
worker_database_url,
|
||||
create_worker_database,
|
||||
cleanup_tables,
|
||||
)
|
||||
```
|
||||
|
||||
## ::: fastapi_toolsets.pytest.plugin.register_fixtures
|
||||
|
||||
## ::: fastapi_toolsets.pytest.utils.create_async_client
|
||||
|
||||
## ::: fastapi_toolsets.pytest.utils.create_db_session
|
||||
|
||||
## ::: fastapi_toolsets.pytest.utils.worker_database_url
|
||||
|
||||
## ::: fastapi_toolsets.pytest.utils.create_worker_database
|
||||
|
||||
## ::: fastapi_toolsets.pytest.utils.cleanup_tables
|
||||
34
docs/reference/schemas.md
Normal file
34
docs/reference/schemas.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# `schemas` module
|
||||
|
||||
Here's the reference for all response models and types provided by the `schemas` module.
|
||||
|
||||
You can import them directly from `fastapi_toolsets.schemas`:
|
||||
|
||||
```python
|
||||
from fastapi_toolsets.schemas import (
|
||||
PydanticBase,
|
||||
ResponseStatus,
|
||||
ApiError,
|
||||
BaseResponse,
|
||||
Response,
|
||||
ErrorResponse,
|
||||
Pagination,
|
||||
PaginatedResponse,
|
||||
)
|
||||
```
|
||||
|
||||
## ::: fastapi_toolsets.schemas.PydanticBase
|
||||
|
||||
## ::: fastapi_toolsets.schemas.ResponseStatus
|
||||
|
||||
## ::: fastapi_toolsets.schemas.ApiError
|
||||
|
||||
## ::: fastapi_toolsets.schemas.BaseResponse
|
||||
|
||||
## ::: fastapi_toolsets.schemas.Response
|
||||
|
||||
## ::: fastapi_toolsets.schemas.ErrorResponse
|
||||
|
||||
## ::: fastapi_toolsets.schemas.Pagination
|
||||
|
||||
## ::: fastapi_toolsets.schemas.PaginatedResponse
|
||||
Reference in New Issue
Block a user