# LogFlux Python SDK (BETA)
[](https://www.python.org/downloads/)
[](LICENSE-APACHE-2.0)
[](https://github.com/logflux-io/logflux-python-sdk/issues)
> **BETA SOFTWARE**: This SDK is feature-complete for basic logging use cases but is marked as BETA while we gather community feedback and add additional features. The API is stable but may evolve based on user needs.
A lightweight Python SDK for communicating with the LogFlux agent.
## Installation
Install from PyPI:
```bash
pip install logflux-io
```
For development:
```bash
git clone https://github.com/logflux-io/logflux-python-sdk.git
cd logflux-python-sdk
pip install -e .[dev]
```
## Current Status
- **Stable API** for core logging functionality
- **Production quality** code and testing
- **Ready for evaluation** and non-critical use cases
- **Additional features** (metrics, traces, events) coming soon
- **Gathering feedback** for API refinements
## Package Structure
```
logflux/
├── types.py # Core types (LogEntry, LogBatch, etc.)
├── client.py # Client implementation (Client class)
├── batch.py # Batch client for high-throughput logging
├── config.py # Configuration management
└── integrations/ # Logger integrations
└── logging_handler.py # Python logging integration
examples/ # Usage examples
├── basic/ # Basic client usage
├── batch/ # Batch client usage
├── config/ # Configuration examples
└── integrations/ # Integration examples
└── logging/ # Python logging integration
```
## Quick Start
```python
import logflux
# Create client - async mode enabled by default for non-blocking sends
client = logflux.new_unix_client("/tmp/logflux-agent.sock")
client.connect()
# Send log entry (non-blocking with circuit breaker protection)
entry = (logflux.new_log_entry("Hello, LogFlux!", "my-app")
.with_log_level(logflux.LEVEL_INFO)
.with_metadata("environment", "production"))
client.send_log_entry(entry)
client.close()
```
## Installation
```bash
# Install from PyPI (when available)
pip install logflux
# Install from source
pip install -e .
```
## Examples
### Basic Usage
```python
import logflux
client = logflux.new_unix_client("/tmp/logflux-agent.sock")
client.connect()
entry = (logflux.new_log_entry("User authenticated", "auth-service")
.with_log_level(logflux.LEVEL_INFO)
.with_metadata("user_id", "12345"))
client.send_log_entry(entry)
client.close()
```
### Batch Processing
```python
import logflux
batch_config = logflux.BatchConfig(max_batch_size=10, auto_flush=True)
client = logflux.new_batch_unix_client("/tmp/logflux-agent.sock", batch_config)
client.connect()
for i in range(25):
entry = logflux.new_log_entry(f"Log entry {i}", "batch-app")
client.send_log_entry(entry)
client.close()
```
### Python Logging Integration
```python
import logging
import logflux
from logflux.integrations import LogFluxHandler
client = logflux.new_unix_client("/tmp/logflux-agent.sock")
client.connect()
handler = LogFluxHandler(client=client, source="my-app", json_format=True)
logger = logging.getLogger()
logger.addHandler(handler)
logger.setLevel(logging.INFO)
logger.info("Application started", extra={"version": "1.0.0"})
handler.close()
```
## Security
The LogFlux Python SDK prioritizes security and undergoes comprehensive automated security scanning:
### Continuous Security Monitoring
- **Static Analysis**: Bandit scans for security vulnerabilities in code
- **Dependency Scanning**: Safety checks for known vulnerabilities in dependencies
- **Advanced Pattern Analysis**: Semgrep detects security anti-patterns and OWASP issues
- **Secrets Detection**: Automated scanning for hardcoded credentials and sensitive data
- **Supply Chain Security**: Package integrity verification and suspicious dependency detection
### Security Scans Run On:
- Every pull request and code change
- Weekly scheduled comprehensive scans
- All releases and deployments
### Security Features
- Zero production dependencies (eliminates attack surface)
- Defensive programming with comprehensive error handling
- No credential storage or sensitive data processing
- Safe defaults and input validation
- Resource cleanup and timeout protection
For security reports or to report vulnerabilities, see [SECURITY.md](SECURITY.md).
## License
This project is licensed under the Apache License 2.0. See [LICENSE-APACHE-2.0](LICENSE-APACHE-2.0) for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "logflux-io",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "logflux, logging, telemetry, monitoring, observability",
"author": null,
"author_email": "LogFlux Team <support@logflux.io>",
"download_url": "https://files.pythonhosted.org/packages/19/59/7a085a34c1639444ac2ce253fad35a62e61b77e7db54755464e9828fe68c/logflux_io-0.1.0b0.tar.gz",
"platform": null,
"description": "# LogFlux Python SDK (BETA)\n\n[](https://www.python.org/downloads/)\n[](LICENSE-APACHE-2.0)\n[](https://github.com/logflux-io/logflux-python-sdk/issues)\n\n> **BETA SOFTWARE**: This SDK is feature-complete for basic logging use cases but is marked as BETA while we gather community feedback and add additional features. The API is stable but may evolve based on user needs.\n\nA lightweight Python SDK for communicating with the LogFlux agent.\n\n## Installation\n\nInstall from PyPI:\n\n```bash\npip install logflux-io\n```\n\nFor development:\n\n```bash\ngit clone https://github.com/logflux-io/logflux-python-sdk.git\ncd logflux-python-sdk\npip install -e .[dev]\n```\n\n## Current Status\n\n- **Stable API** for core logging functionality\n- **Production quality** code and testing \n- **Ready for evaluation** and non-critical use cases\n- **Additional features** (metrics, traces, events) coming soon\n- **Gathering feedback** for API refinements\n\n## Package Structure\n\n```\nlogflux/\n\u251c\u2500\u2500 types.py # Core types (LogEntry, LogBatch, etc.)\n\u251c\u2500\u2500 client.py # Client implementation (Client class)\n\u251c\u2500\u2500 batch.py # Batch client for high-throughput logging\n\u251c\u2500\u2500 config.py # Configuration management\n\u2514\u2500\u2500 integrations/ # Logger integrations\n \u2514\u2500\u2500 logging_handler.py # Python logging integration\nexamples/ # Usage examples\n\u251c\u2500\u2500 basic/ # Basic client usage\n\u251c\u2500\u2500 batch/ # Batch client usage\n\u251c\u2500\u2500 config/ # Configuration examples\n\u2514\u2500\u2500 integrations/ # Integration examples\n \u2514\u2500\u2500 logging/ # Python logging integration\n```\n\n## Quick Start\n\n```python\nimport logflux\n\n# Create client - async mode enabled by default for non-blocking sends\nclient = logflux.new_unix_client(\"/tmp/logflux-agent.sock\")\nclient.connect()\n\n# Send log entry (non-blocking with circuit breaker protection)\nentry = (logflux.new_log_entry(\"Hello, LogFlux!\", \"my-app\")\n .with_log_level(logflux.LEVEL_INFO)\n .with_metadata(\"environment\", \"production\"))\n\nclient.send_log_entry(entry)\nclient.close()\n```\n\n## Installation\n\n```bash\n# Install from PyPI (when available)\npip install logflux\n\n# Install from source\npip install -e .\n```\n\n## Examples\n\n### Basic Usage\n\n```python\nimport logflux\n\nclient = logflux.new_unix_client(\"/tmp/logflux-agent.sock\")\nclient.connect()\n\nentry = (logflux.new_log_entry(\"User authenticated\", \"auth-service\")\n .with_log_level(logflux.LEVEL_INFO)\n .with_metadata(\"user_id\", \"12345\"))\n\nclient.send_log_entry(entry)\nclient.close()\n```\n\n### Batch Processing\n\n```python\nimport logflux\n\nbatch_config = logflux.BatchConfig(max_batch_size=10, auto_flush=True)\nclient = logflux.new_batch_unix_client(\"/tmp/logflux-agent.sock\", batch_config)\nclient.connect()\n\nfor i in range(25):\n entry = logflux.new_log_entry(f\"Log entry {i}\", \"batch-app\")\n client.send_log_entry(entry)\n\nclient.close()\n```\n\n### Python Logging Integration\n\n```python\nimport logging\nimport logflux\nfrom logflux.integrations import LogFluxHandler\n\nclient = logflux.new_unix_client(\"/tmp/logflux-agent.sock\")\nclient.connect()\n\nhandler = LogFluxHandler(client=client, source=\"my-app\", json_format=True)\nlogger = logging.getLogger()\nlogger.addHandler(handler)\nlogger.setLevel(logging.INFO)\n\nlogger.info(\"Application started\", extra={\"version\": \"1.0.0\"})\nhandler.close()\n```\n\n## Security\n\nThe LogFlux Python SDK prioritizes security and undergoes comprehensive automated security scanning:\n\n### Continuous Security Monitoring\n\n- **Static Analysis**: Bandit scans for security vulnerabilities in code\n- **Dependency Scanning**: Safety checks for known vulnerabilities in dependencies \n- **Advanced Pattern Analysis**: Semgrep detects security anti-patterns and OWASP issues\n- **Secrets Detection**: Automated scanning for hardcoded credentials and sensitive data\n- **Supply Chain Security**: Package integrity verification and suspicious dependency detection\n\n### Security Scans Run On:\n- Every pull request and code change\n- Weekly scheduled comprehensive scans\n- All releases and deployments\n\n### Security Features\n- Zero production dependencies (eliminates attack surface)\n- Defensive programming with comprehensive error handling\n- No credential storage or sensitive data processing\n- Safe defaults and input validation\n- Resource cleanup and timeout protection\n\nFor security reports or to report vulnerabilities, see [SECURITY.md](SECURITY.md).\n\n## License\n\nThis project is licensed under the Apache License 2.0. See [LICENSE-APACHE-2.0](LICENSE-APACHE-2.0) for details.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A lightweight Python SDK for LogFlux agent communication",
"version": "0.1.0b0",
"project_urls": {
"Bug Tracker": "https://github.com/logflux-io/logflux-python-sdk/issues",
"Documentation": "https://docs.logflux.io",
"Homepage": "https://github.com/logflux-io/logflux-python-sdk",
"Repository": "https://github.com/logflux-io/logflux-python-sdk"
},
"split_keywords": [
"logflux",
" logging",
" telemetry",
" monitoring",
" observability"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a13b0fb90924539c96f2156537968124630483acaa747848c9439ccf8bae60ec",
"md5": "0fe75a5fb82e1e509eff0f7020e98219",
"sha256": "db9ac257ede2730b1114a400b60f4d2064a0a23acc97d2af4db4f8cde7ce3192"
},
"downloads": -1,
"filename": "logflux_io-0.1.0b0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0fe75a5fb82e1e509eff0f7020e98219",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 21784,
"upload_time": "2025-09-07T19:38:47",
"upload_time_iso_8601": "2025-09-07T19:38:47.386142Z",
"url": "https://files.pythonhosted.org/packages/a1/3b/0fb90924539c96f2156537968124630483acaa747848c9439ccf8bae60ec/logflux_io-0.1.0b0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "19597a085a34c1639444ac2ce253fad35a62e61b77e7db54755464e9828fe68c",
"md5": "fa8b87ff83c4f2975a9ed134c3d9cce1",
"sha256": "e8c558c48d097e3073196aff89521e5ec3e8316043ad1384bd8ee90378168d19"
},
"downloads": -1,
"filename": "logflux_io-0.1.0b0.tar.gz",
"has_sig": false,
"md5_digest": "fa8b87ff83c4f2975a9ed134c3d9cce1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 61287,
"upload_time": "2025-09-07T19:38:48",
"upload_time_iso_8601": "2025-09-07T19:38:48.902613Z",
"url": "https://files.pythonhosted.org/packages/19/59/7a085a34c1639444ac2ce253fad35a62e61b77e7db54755464e9828fe68c/logflux_io-0.1.0b0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-07 19:38:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "logflux-io",
"github_project": "logflux-python-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "logflux-io"
}