Metadata-Version: 2.1
Name: spartan-module-feature-flag
Version: 0.3.1
Summary: A module for managing feature flags.
Author: Duc Duong
Author-email: duc.duong@c0x12c.com
Requires-Python: >=3.12,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: asyncpg (>=0.29.0,<0.30.0)
Requires-Dist: greenlet (>=3.0.3,<4.0.0)
Requires-Dist: httpx (>=0.27.0,<0.28.0)
Requires-Dist: inflection (>=0.5.1,<0.6.0)
Requires-Dist: orjson (>=3.10.7,<4.0.0)
Requires-Dist: psycopg2-binary (>=2.9.1,<3.0.0)
Requires-Dist: redis (>=5.0.8,<6.0.0)
Requires-Dist: sqlalchemy (>=2.0.32,<3.0.0)
Requires-Dist: sqlparse (>=0.5.1,<0.6.0)
Description-Content-Type: text/markdown

# spartan-module-feature-flag

This module provides a flexible and standardized way to manage feature flags in Python applications. It supports PostgreSQL for persistent storage and optional Redis caching for improved performance.

## Features
- **CRUD Operations**: Create, read, update, and delete feature flags.
- **Database Support**: PostgreSQL integration.
- **Optional Redis Caching**: Cache feature flag data for faster access. Redis integration is optional and can be omitted.

## Installation
To install the module and its dependencies, use:
  ```bash
  poetry install
  ```

## Example Usage
In the [`examples/basic-usage`](./examples/basic-usage) directory, you will find a complete example of how to use the Feature Flag module in a FastAPI application.

## Development

### Debugging & Fixing Issues:
Local Debugging: clone the module repository and install it in "editable" mode using `pip install -e .`.

### Install
- To install the module and its dev dependencies, use:
  ```bash
  poetry install --with dev
  ```

### Run docker-compose
- To run the PostgreSQL and Redis services, use:
  ```bash
  docker-compose -f docker-compose.ci.yml up -d
  ```

- To shut down the services, use:
  ```bash
  docker-compose -f docker-compose.ci.yml down
  ```

### Testing
To run the tests, use:
- Unit tests:
  ```bash
  poetry run pytest tests/unit
  ```

- Integration tests:
  ```bash
  poetry run pytest tests/integration
  ```

- Or we can run all tests:
  ```bash
  poetry run pytest tests/
  ```

## Release
Please follow guidelines in [docs/RELEASE.md](./docs/RELEASE.md)

## Contributors

<!-- readme: collaborators,contributors -start -->
<table>
	<tbody>
		<tr>
            <td align="center">
                <a href="https://github.com/spartan-ductduong">
                    <img src="https://avatars.githubusercontent.com/u/112845152?v=4" width="100;" alt="spartan-ductduong"/>
                    <br />
                    <sub><b>Duc Duong</b></sub>
                </a>
            </td>
            <td align="center">
                <a href="https://github.com/spartan-haobui">
                    <img src="https://avatars.githubusercontent.com/u/146458589?v=4" width="100;" alt="spartan-haobui"/>
                    <br />
                    <sub><b>Hao Bui</b></sub>
                </a>
            </td>
		</tr>
	<tbody>
</table>
<!-- readme: collaborators,contributors -end -->

