Skip to main content

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

FieldTypeDescription
usernamestringWindows/Samba domain username
passwordstringPassword for authentication
serverstringServer hostname or IP address
pathstringUNC 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

FieldTypeDefaultDescription
prefixstring""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

FieldTypeDescription
file_patternstringGlob pattern relative to the prefix, e.g., "*.csv"
data_dt_columnstring or listColumn(s) containing the datetime value
data_dt_formatstring or liststrptime format or special values ("muts", "uts", "datetime")
data_key_columnstring or listSymbol/key column(s)

Optional data_args

FieldTypeDefaultDescription
sep_overridestring","Delimiter character
encodingstring"utf-8"File encoding
data_dt_timezonestring"UTC"Source data timezone
fname_dt_regexstringRegex to extract date from filename
fname_dt_formatstringstrptime format for filename date
fname_dt_timezonestringTimezone of filename date
fname_dt_nudgeint0Microsecond offset for filename date
fname_dt_approx_secondsintApproximate seconds per file
arrow_sortlist["symbol", "muts"]Sort order
arrow_timestampbooltrueGenerate 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

RequirementDetail
Outbound portTCP port 445 (SMB) to the file server
DNS resolutionThe server hostname must resolve from the CloudQuant Data Liberator host
AuthenticationNTLM or Kerberos (depending on domain configuration)
SMB versionSMB 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

IssuePossible CauseSolution
Mount fails with “Permission denied”Incorrect credentials or insufficient share permissionsVerify credentials and ensure the service account has read access to the share
Mount fails with “Host is down”Network connectivity or firewall blocking port 445Check firewall rules and verify SMB port is reachable
Files not foundIncorrect path or prefixVerify the UNC path using smbclient or Windows Explorer
Encoding errorsFiles use non-UTF-8 encodingSet encoding in data_args (common alternatives: "latin-1", "cp1252" for Windows-origin files)