CIFS/SMB
CIFS/SMB datasources allow CloudQuant Data Liberator to read CSV, TSV, and other delimited files from Windows file shares or Samba servers. This is commonly used in enterprise environments where data is published to shared network drives.
Connection Configuration
Required Fields
| Field | Type | Description |
|---|
username | string | Windows/Samba domain username |
password | string | Password for authentication |
server | string | Server hostname or IP address |
path | string | UNC path to the share (e.g., "sharename" or "sharename/subfolder") |
The connection_type for CIFS/SMB connections is inferred from the presence of the server and path fields. Unlike other connection types, there is no explicit connection_type field required.
Optional Fields
| Field | Type | Default | Description |
|---|
prefix | string | "" | Subdirectory within the share to use as root |
Example Connection
{
"name": "cifs-shared-drive",
"username": "DOMAIN\\datauser",
"password": "w1nd0wsP@ss",
"server": "fileserver.corp.example.com",
"path": "MarketData",
"prefix": "daily/equities/"
}
Use a dedicated service account with read-only permissions on the share. Avoid using personal credentials, as password changes would break the connection.
Domain Authentication
For Active Directory environments, include the domain in the username:
{
"username": "CORP\\svc-liberator"
}
Or use the UPN format:
{
"username": "svc-liberator@corp.example.com"
}
Dataset Configuration (data_args)
The data_args fields are identical to all file-based sources. See Local File for the full reference. The file_pattern is evaluated relative to the prefix configured on the connection.
Required data_args
| Field | Type | Description |
|---|
file_pattern | string | Glob pattern relative to the prefix, e.g., "*.csv" |
data_dt_column | string or list | Column(s) containing the datetime value |
data_dt_format | string or list | strptime format or special values ("muts", "uts", "datetime") |
data_key_column | string or list | Symbol/key column(s) |
Optional data_args
| Field | Type | Default | Description |
|---|
sep_override | string | "," | Delimiter character |
encoding | string | "utf-8" | File encoding |
data_dt_timezone | string | "UTC" | Source data timezone |
fname_dt_regex | string | | Regex to extract date from filename |
fname_dt_format | string | | strptime format for filename date |
fname_dt_timezone | string | | Timezone of filename date |
fname_dt_nudge | int | 0 | Microsecond offset for filename date |
fname_dt_approx_seconds | int | | Approximate seconds per file |
arrow_sort | list | ["symbol", "muts"] | Sort order |
arrow_timestamp | bool | true | Generate human-readable timestamp column |
Complete Example
Connection
{
"name": "cifs-risk-reports",
"username": "CORP\\svc-liberator",
"password": "s3rv1ceAcct!",
"server": "nas01.corp.example.com",
"path": "RiskReports",
"prefix": "daily/"
}
Dataset
{
"name": "daily-risk-metrics",
"connection": "cifs-risk-reports",
"data_args": {
"file_pattern": "risk_*.csv",
"sep_override": ",",
"encoding": "utf-8",
"data_dt_column": "report_date",
"data_dt_format": "%Y-%m-%d",
"data_dt_timezone": "America/New_York",
"data_key_column": "portfolio_id",
"fname_dt_regex": "risk_(\\d{8})\\.csv",
"fname_dt_format": "%Y%m%d",
"fname_dt_timezone": "America/New_York",
"fname_dt_approx_seconds": 86400,
"arrow_sort": ["symbol", "muts"],
"arrow_timestamp": true
},
"schema": [
{ "name": "portfolio_id", "type": "string", "group": "key", "description": "Portfolio identifier" },
{ "name": "report_date", "type": "string", "group": "time", "description": "Report date" },
{ "name": "var_95", "type": "double", "group": "value", "description": "95th percentile VaR" },
{ "name": "var_99", "type": "double", "group": "value", "description": "99th percentile VaR" },
{ "name": "cvar", "type": "double", "group": "value", "description": "Conditional VaR" },
{ "name": "beta", "type": "double", "group": "value", "description": "Portfolio beta" },
{ "name": "sharpe", "type": "double", "group": "value", "description": "Sharpe ratio" }
]
}
Network Requirements
| Requirement | Detail |
|---|
| Outbound port | TCP port 445 (SMB) to the file server |
| DNS resolution | The server hostname must resolve from the CloudQuant Data Liberator host |
| Authentication | NTLM or Kerberos (depending on domain configuration) |
| SMB version | SMB 2.0 or higher recommended; SMBv1 is deprecated and insecure |
If the CloudQuant Data Liberator host is Linux-based, ensure cifs-utils is installed for CIFS mount support. On Debian/Ubuntu: apt install cifs-utils. On RHEL/CentOS: yum install cifs-utils.
Troubleshooting
| Issue | Possible Cause | Solution |
|---|
| Mount fails with “Permission denied” | Incorrect credentials or insufficient share permissions | Verify credentials and ensure the service account has read access to the share |
| Mount fails with “Host is down” | Network connectivity or firewall blocking port 445 | Check firewall rules and verify SMB port is reachable |
| Files not found | Incorrect path or prefix | Verify the UNC path using smbclient or Windows Explorer |
| Encoding errors | Files use non-UTF-8 encoding | Set encoding in data_args (common alternatives: "latin-1", "cp1252" for Windows-origin files) |