PyFlowintel is a Python library for interacting with Flowintel instances through their REST API. Flowintel is an open-source platform for security case management.
PyFlowintel is developed within SATRAP-DL, a sub-project of CyFORT (Cloud cybersecurity Fortress of Open Resources and Tools for resilience), carried out in the context of the IPCEI-CIS project.
- Overview
- Features
- Documentation
- Getting started
- Usage
- Testing
- Project status
- Roadmap
- License
- Acknowledgments
- Contact
PyFlowintel provides a Pythonic interface to Flowintel's REST API, enabling developers and security analysts to automate workflows integrating Flowintel with other security tools. It follows a layered architecture with dedicated endpoint modules (cases, tasks, templates, admin, importers), robust error handling, and flexible configuration.
For automated incident handling pipelines, see the SATRAP-DL technical documentation.
- API Coverage: Support for case, task, template, admin, and importer endpoints
- Clean Architecture: Dedicated endpoint modules with separation of concerns
- Error Handling: Custom exception hierarchy for different error scenarios
- Input Validation: Parameter validation with informative error messages
- Flexible Configuration: YAML files or direct arguments
- Centralized Logging: Package-wide logging with adjustable levels
- Context Manager: Automatic resource cleanup
- Free/libre and open source
- Modular and extensible design
- Minimal dependencies (requests, pyyaml)
- Features Documentation - All available methods and endpoints
- Installation Guide - Containerized development environment setup
Install either locally with Python/Poetry or using the containerized VS Code development environment.
This project uses Poetry for dependency and environment management. If you already have (the required versions of) Python and Poetry installed, this is the simplest option.
- Python 3.9 or higher
- Poetry 1.8 (see Poetry installation guide)
- Clone the repository and go to the project folder.
git clone https://github.com/AbstractionsLab/PyFlowintelcd pyflowintel- Install dependencies
poetry install- Activate the virtual environment
poetry shellThis project can also be run inside a Docker container, which comes with Poetry pre-installed, using Visual Studio Code with the Dev Containers extension. See the Installation guide for instructions on this deployment option.
- Access to a running Flowintel instance
- API key from the Flowintel instance
-
Copy the configuration example into a
config.yamlfile:cp config-example.yaml config.yaml
-
Edit
config.yamlwith your settings:# Production instance flowintel: base_url: http://localhost:7006/api api_key: your-actual-api-key-here # Testing instance (used for integration tests) testing: base_url: http://localhost:7006/api api_key: your-test-api-key-here
Note:
config.yamlis the default configuration file (searched at project root) and is gitignored.
Adjust the overall logging level in pyflowintel/commons/logging_config.py.
from pyflowintel import PyFlowintel
# Option 1: Default config.yaml (recommended)
client = PyFlowintel.from_config()
# Option 2: Custom config file
client = PyFlowintel.from_config("my_settings.yaml")
# Option 3: Explicit arguments
client = PyFlowintel.from_args(
base_url="http://localhost:7006/api",
api_key="your-api-key-here"
)
# Recommended: Use context manager for automatic cleanup
with PyFlowintel.from_config() as client:
cases = client.cases.list_all()
# Your code hereSee examples/ for working code examples and tests/ for usage patterns.
PyFlowintel includes unit and integration tests. For v0.1, tests cover the PyFlowintel client, templating endpoint, and utilities.
./scripts/run_tests.shUnit tests always run.
Integration tests require a running Flowintel instance and API key. Add the testing section to your config.yaml (see Configuration section). Integration tests run automatically if testing settings are provided, otherwise they're skipped.
Use the unittest module to run specific test cases. For example:
python -m unittest tests.test_template_endpoint.TestCaseTemplateOperationsPyFlowintel v0.1 (Alpha) - February 2026. Provides selected coverage of the Flowintel REST API as outlined in Features.
- Extend support prioritizing the
casesandtasksendpoints - Add support for the custom_tags endpoint
- Add input validation and sanitization
- Add unit and integration testing for all endpoints
- Extend documentation and examples
- Release as a PyPi library
Copyright (c) 2026 itrust Abstractions Lab and itrust consulting. All rights reserved.
PyFlowintel is licensed under the BSD 2-Clause license.
PyFlowintel is developed under SATRAP-DL, which is co-funded by the Ministry of the Economy of Luxembourg, in the context of the CyFORT project.
For questions, feedback, or feature requests, feel free to contact us at Abstractions Lab: info@abstractionslab.lu
