streamlog


Namestreamlog JSON
Version 3.0.0 PyPI version JSON
download
home_pagehttps://github.com/PrathmeShsoni/StreamLog
SummaryA Python package to send print statements to an API while printing to the console.
upload_time2025-01-10 19:07:30
maintainerNone
docs_urlNone
authorPrathmesh Soni
requires_python>=3.6
licenseMIT
keywords streamlog stream log api print
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # StreamLog

**StreamLog** is a Python package that extends the functionality of the `print` statement by simultaneously sending printed messages to an API. It’s designed to help developers log important information to remote servers while maintaining console output.


<p id="top" align="right">
  <a href="https://github.com/PrathmeshSoni">
  <img src="https://badges.pufler.dev/visits/prathmeshsoni/StreamLog?label=VISITOR&style=for-the-badge&logoColor=FFFFFF&color=purple&labelColor=640464&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9IndoaXRlIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2IiBjbGFzcz0ib2N0aWNvbiBvY3RpY29uLWV5ZSIgYXJpYS1oaWRkZW49InRydWUiPjxwYXRoIGQ9Ik04IDJjMS45ODEgMCAzLjY3MS45OTIgNC45MzMgMi4wNzggMS4yNyAxLjA5MSAyLjE4NyAyLjM0NSAyLjYzNyAzLjAyM2ExLjYyIDEuNjIgMCAwIDEgMCAxLjc5OGMtLjQ1LjY3OC0xLjM2NyAxLjkzMi0yLjYzNyAzLjAyM0MxMS42NyAxMy4wMDggOS45ODEgMTQgOCAxNGMtMS45ODEgMC0zLjY3MS0uOTkyLTQuOTMzLTIuMDc4QzEuNzk3IDEwLjgzLjg4IDkuNTc2LjQzIDguODk4YTEuNjIgMS42MiAwIDAgMSAwLTEuNzk4Yy40NS0uNjc3IDEuMzY3LTEuOTMxIDIuNjM3LTMuMDIyQzQuMzMgMi45OTIgNi4wMTkgMiA4IDJaTTEuNjc5IDcuOTMyYS4xMi4xMiAwIDAgMCAwIC4xMzZjLjQxMS42MjIgMS4yNDEgMS43NSAyLjM2NiAyLjcxN0M1LjE3NiAxMS43NTggNi41MjcgMTIuNSA4IDEyLjVjMS40NzMgMCAyLjgyNS0uNzQyIDMuOTU1LTEuNzE1IDEuMTI0LS45NjcgMS45NTQtMi4wOTYgMi4zNjYtMi43MTdhLjEyLjEyIDAgMCAwIDAtLjEzNmMtLjQxMi0uNjIxLTEuMjQyLTEuNzUtMi4zNjYtMi43MTdDMTAuODI0IDQuMjQyIDkuNDczIDMuNSA4IDMuNWMtMS40NzMgMC0yLjgyNS43NDItMy45NTUgMS43MTUtMS4xMjQuOTY3LTEuOTU0IDIuMDk2LTIuMzY2IDIuNzE3Wk04IDEwYTIgMiAwIDEgMS0uMDAxLTMuOTk5QTIgMiAwIDAgMSA4IDEwWiI+PC9wYXRoPjwvc3ZnPg==">
  </a> 
</p>

---

## Features

- Seamlessly integrates with the standard `print` function.
- Sends printed messages to a specified API endpoint.
- Retains all original `print` functionality, including custom separators, end characters, and file output.

---

## Installation

Install the package using `pip`:

```bash
pip install StreamLog
```

---

## Usage

### Enable StreamLog

To start using **StreamLog**, import and enable the custom print functionality by specifying your API endpoint:

```python
from StreamLog import enable_stream_log

# Enable StreamLog with your API endpoint
enable_stream_log(api_url="https://your-api-endpoint.com/logs")

# Use the print function as usual
print("Hello, World!")
```

### Example Output

#### Console Output:
```
Hello, World!
```

#### API Request:
**Endpoint:** `https://your-api-endpoint.com/logs`  
**Method:** `POST`
**Payload:**
```json
{
  "message": "Hello, World!"
}
```

---

## Parameters

The `enable_stream_log` function accepts the following parameter:

- `api_url` (str): The URL of the API endpoint where logs will be sent.  
  Default: `http://example.com/api/logs`

---

## Error Handling

If the API call fails (e.g., network issues, invalid endpoint), an error message is displayed in the console, and the `print` statement continues to function normally.

Example:
```
StreamLog Error: Failed to send message to API: [Error details]
```

---

## Requirements

- Python 3.6 or higher
- `requests` library

---

## Installation from Source

Clone the repository and install the package locally:

```bash
git clone https://github.com/PrathmeshSoni/StreamLog.git
cd StreamLog
pip install .
```

---

## Contributing

Contributions are welcome! Please follow these steps:

1. Fork the repository.
2. Create a new branch (`feature/new-feature`).
3. Commit your changes.
4. Open a pull request.

---

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

---

## Contact

Developed by **Prathmesh Soni**  
For more details, visit [GitHub Repo](https://github.com/PrathmeshSoni/StreamLog).


```
Let me know if you'd like any modifications!
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/PrathmeShsoni/StreamLog",
    "name": "streamlog",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "streamlog stream log api print",
    "author": "Prathmesh Soni",
    "author_email": "info@soniprathmesh.com",
    "download_url": "https://files.pythonhosted.org/packages/51/c0/e0c24abd04d79e812d66fc4f471f36694c5aaaf09a87eb429eb1b32c5174/streamlog-3.0.0.tar.gz",
    "platform": null,
    "description": "# StreamLog\r\n\r\n**StreamLog** is a Python package that extends the functionality of the `print` statement by simultaneously sending printed messages to an API. It\u2019s designed to help developers log important information to remote servers while maintaining console output.\r\n\r\n\r\n<p id=\"top\" align=\"right\">\r\n  <a href=\"https://github.com/PrathmeshSoni\">\r\n  <img src=\"https://badges.pufler.dev/visits/prathmeshsoni/StreamLog?label=VISITOR&style=for-the-badge&logoColor=FFFFFF&color=purple&labelColor=640464&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9IndoaXRlIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2IiBjbGFzcz0ib2N0aWNvbiBvY3RpY29uLWV5ZSIgYXJpYS1oaWRkZW49InRydWUiPjxwYXRoIGQ9Ik04IDJjMS45ODEgMCAzLjY3MS45OTIgNC45MzMgMi4wNzggMS4yNyAxLjA5MSAyLjE4NyAyLjM0NSAyLjYzNyAzLjAyM2ExLjYyIDEuNjIgMCAwIDEgMCAxLjc5OGMtLjQ1LjY3OC0xLjM2NyAxLjkzMi0yLjYzNyAzLjAyM0MxMS42NyAxMy4wMDggOS45ODEgMTQgOCAxNGMtMS45ODEgMC0zLjY3MS0uOTkyLTQuOTMzLTIuMDc4QzEuNzk3IDEwLjgzLjg4IDkuNTc2LjQzIDguODk4YTEuNjIgMS42MiAwIDAgMSAwLTEuNzk4Yy40NS0uNjc3IDEuMzY3LTEuOTMxIDIuNjM3LTMuMDIyQzQuMzMgMi45OTIgNi4wMTkgMiA4IDJaTTEuNjc5IDcuOTMyYS4xMi4xMiAwIDAgMCAwIC4xMzZjLjQxMS42MjIgMS4yNDEgMS43NSAyLjM2NiAyLjcxN0M1LjE3NiAxMS43NTggNi41MjcgMTIuNSA4IDEyLjVjMS40NzMgMCAyLjgyNS0uNzQyIDMuOTU1LTEuNzE1IDEuMTI0LS45NjcgMS45NTQtMi4wOTYgMi4zNjYtMi43MTdhLjEyLjEyIDAgMCAwIDAtLjEzNmMtLjQxMi0uNjIxLTEuMjQyLTEuNzUtMi4zNjYtMi43MTdDMTAuODI0IDQuMjQyIDkuNDczIDMuNSA4IDMuNWMtMS40NzMgMC0yLjgyNS43NDItMy45NTUgMS43MTUtMS4xMjQuOTY3LTEuOTU0IDIuMDk2LTIuMzY2IDIuNzE3Wk04IDEwYTIgMiAwIDEgMS0uMDAxLTMuOTk5QTIgMiAwIDAgMSA4IDEwWiI+PC9wYXRoPjwvc3ZnPg==\">\r\n  </a> \r\n</p>\r\n\r\n---\r\n\r\n## Features\r\n\r\n- Seamlessly integrates with the standard `print` function.\r\n- Sends printed messages to a specified API endpoint.\r\n- Retains all original `print` functionality, including custom separators, end characters, and file output.\r\n\r\n---\r\n\r\n## Installation\r\n\r\nInstall the package using `pip`:\r\n\r\n```bash\r\npip install StreamLog\r\n```\r\n\r\n---\r\n\r\n## Usage\r\n\r\n### Enable StreamLog\r\n\r\nTo start using **StreamLog**, import and enable the custom print functionality by specifying your API endpoint:\r\n\r\n```python\r\nfrom StreamLog import enable_stream_log\r\n\r\n# Enable StreamLog with your API endpoint\r\nenable_stream_log(api_url=\"https://your-api-endpoint.com/logs\")\r\n\r\n# Use the print function as usual\r\nprint(\"Hello, World!\")\r\n```\r\n\r\n### Example Output\r\n\r\n#### Console Output:\r\n```\r\nHello, World!\r\n```\r\n\r\n#### API Request:\r\n**Endpoint:** `https://your-api-endpoint.com/logs`  \r\n**Method:** `POST`\r\n**Payload:**\r\n```json\r\n{\r\n  \"message\": \"Hello, World!\"\r\n}\r\n```\r\n\r\n---\r\n\r\n## Parameters\r\n\r\nThe `enable_stream_log` function accepts the following parameter:\r\n\r\n- `api_url` (str): The URL of the API endpoint where logs will be sent.  \r\n  Default: `http://example.com/api/logs`\r\n\r\n---\r\n\r\n## Error Handling\r\n\r\nIf the API call fails (e.g., network issues, invalid endpoint), an error message is displayed in the console, and the `print` statement continues to function normally.\r\n\r\nExample:\r\n```\r\nStreamLog Error: Failed to send message to API: [Error details]\r\n```\r\n\r\n---\r\n\r\n## Requirements\r\n\r\n- Python 3.6 or higher\r\n- `requests` library\r\n\r\n---\r\n\r\n## Installation from Source\r\n\r\nClone the repository and install the package locally:\r\n\r\n```bash\r\ngit clone https://github.com/PrathmeshSoni/StreamLog.git\r\ncd StreamLog\r\npip install .\r\n```\r\n\r\n---\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please follow these steps:\r\n\r\n1. Fork the repository.\r\n2. Create a new branch (`feature/new-feature`).\r\n3. Commit your changes.\r\n4. Open a pull request.\r\n\r\n---\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\r\n\r\n---\r\n\r\n## Contact\r\n\r\nDeveloped by **Prathmesh Soni**  \r\nFor more details, visit [GitHub Repo](https://github.com/PrathmeshSoni/StreamLog).\r\n\r\n\r\n```\r\nLet me know if you'd like any modifications!\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python package to send print statements to an API while printing to the console.",
    "version": "3.0.0",
    "project_urls": {
        "Homepage": "https://github.com/PrathmeShsoni/StreamLog"
    },
    "split_keywords": [
        "streamlog",
        "stream",
        "log",
        "api",
        "print"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5e108836ae2e8d649a482b003024180f842b8275bccac12a6f67eec9bb9204dd",
                "md5": "a0c12afc07c696c0f38bb0817e7282b6",
                "sha256": "a39a400ad06715aab6b565692518749082eb1b16b9f1a8e87c62244d212fdfa0"
            },
            "downloads": -1,
            "filename": "streamlog-3.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a0c12afc07c696c0f38bb0817e7282b6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5930,
            "upload_time": "2025-01-10T19:07:28",
            "upload_time_iso_8601": "2025-01-10T19:07:28.741745Z",
            "url": "https://files.pythonhosted.org/packages/5e/10/8836ae2e8d649a482b003024180f842b8275bccac12a6f67eec9bb9204dd/streamlog-3.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "51c0e0c24abd04d79e812d66fc4f471f36694c5aaaf09a87eb429eb1b32c5174",
                "md5": "abaa2dbfe40b2566c4deff52e95f59d3",
                "sha256": "a0942d2f829552569c4f419d0f093c3bdda89bcde36da17cea7d4c54dc8831bf"
            },
            "downloads": -1,
            "filename": "streamlog-3.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "abaa2dbfe40b2566c4deff52e95f59d3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5308,
            "upload_time": "2025-01-10T19:07:30",
            "upload_time_iso_8601": "2025-01-10T19:07:30.184729Z",
            "url": "https://files.pythonhosted.org/packages/51/c0/e0c24abd04d79e812d66fc4f471f36694c5aaaf09a87eb429eb1b32c5174/streamlog-3.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-10 19:07:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PrathmeShsoni",
    "github_project": "StreamLog",
    "github_not_found": true,
    "lcname": "streamlog"
}
        
Elapsed time: 0.38759s