Metadata-Version: 2.4
Name: fastapi-blocks
Version: 0.1.4.2
Summary: A library for creating modular FastAPI applications.
Author: r3sbarra)
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi
Requires-Dist: pydantic
Requires-Dist: pydantic-settings
Requires-Dist: toml
Requires-Dist: jinja2
Requires-Dist: dirhash
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: httpx; extra == "dev"
Dynamic: license-file

# FastAPI Blocks

[![PyPI version](https://badge.fury.io/py/fastapi-blocks.svg)](https://badge.fury.io/py/fastapi-blocks)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/release/python-311/)
![Tests](https://github.com/r3sbarra/fastapi-blocks/actions/workflows/python-tests.yml/badge.svg)


`fastapi-blocks` is a Python package that allows you to structure your FastAPI applications using a modular "blocks" architecture. Each block is a self-contained component with its own routes, static files, and templates. This makes it easy to develop and maintain large FastAPI applications by breaking them down into smaller, reusable pieces.

## Installation

```bash
pip install fastapi-blocks
```

Then run
```bash
python -m fastapi_blocks setup -f BLOCKS_FOLDER
```
*Replace `BLOCKS_FOLDER` with path to blocks folder from root

### Updating blocks

```bash
python -m fastapi_blocks update
```

Additional flags:
- -A - Auto-install pip packages from blocks
- -S - Save block hashes
- -V - Do not verify block hashes (Default is to verify)

## Examples

### Example Block
- [Example Block](https://github.com/r3sbarra/fablocks-example-block) - An example block

### Example Project
- [Example Project](https://github.com/r3sbarra/fablocks-example-project) - An example project

## Reserved Words

### Variable names
- `router` - In router files, the variable router is used to searche for router to include into app.

### Template names
- 

## Todo:

- [ ] Put more meaningful tests
- [ ] Add command to setup templates/default
- [ ] Add todos
- [ ] Add some sort of security check   
