flexout-0.2.3
توضیحات
Write text or tabular data to a flexible, easily configurable output: CSV or Excel file, or tabulated stdout/stderr.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | flexout-0.2.3 |
| نام | flexout |
| نسخه کتابخانه | 0.2.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Ipamo <dev@ipamo.net> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/flexout/ |
| مجوز | - |
Flexout
=======
A Python library to write text or tabular data to a flexible, easily configurable output: CSV or Excel file, or tabulated stdout/stderr.
The output file may be on the local file system or on a Windows/Samba share (including when the library is used on Linux).
## Installation
Install with all optional dependencies:
pip install flexout[all]
Optional dependencies may also be requested individually:
pip install flexout[tabulate,excel,smb]
## Usage
Export text to stdout or to a file:
```py
import sys
from flexout import flexout
with flexout(filename or sys.stdout) as o:
o.file.write("Content")
```
Export tabular data to stdout or to a file:
```py
import sys
from flexout import flexout
with flexout(filename or sys.stdout, headers=["Id", "Word"]) as o:
o.append(1, "Hello")
o.append(2, "World")
```
Tabular data can also be exported using dictionnaries (in this case, headers will be detected automatically by the library):
```py
import sys
from flexout import flexout
with flexout(filename or sys.stdout) as o:
o.append({'id': 1, 'name': "Hello"})
o.append({'id': 2, 'col3': True})
```
If `filename` has extension with `.xlsx`, output will be in Excel 2010 format.
Otherwise it will be in CSV format.
If `filename` starts with `\\`, output will be done on the corresponding Windows/Samba share.
To indicate Samba credentials, call `configure_smb_credentials` before using function `flexout`.
Example:
```py
from flexout import flexout, configure_smb_credentials
configure_smb_credentials(user=..., password=...)
with flexout(r"\\server\share\path\to\file") as o:
...
```
نیازمندی
| مقدار | نام |
|---|---|
| - | typing-extensions |
| - | tabulate |
| - | openpyxl |
| - | defusedxml |
| - | smbprotocol |
| - | openpyxl |
| - | defusedxml |
| - | smbprotocol |
| - | tabulate |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7.3 | Python |
نحوه نصب
نصب پکیج whl flexout-0.2.3:
pip install flexout-0.2.3.whl
نصب پکیج tar.gz flexout-0.2.3:
pip install flexout-0.2.3.tar.gz