Install & Compatibility
Where this runs
tested against v1.5.20 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.940 runs
installs and imports cleanly · install 0.0s · import 4.211s · 18MB
glibcpy 3.10–3.940 runs
installs and imports cleanly · install 1.6s · import 3.999s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Connection
✓ from sling import Connection
✗ from sling.connections import Connection
All core components are exposed directly from the top-level 'sling' package.
Source
✓ from sling import Source
Source definition for data ingestion.
Target
✓ from sling import Target
Target definition for data destination.
run
✓ from sling import run
✗ from sling.jobs import run
The 'run' function for executing a data sling job is exposed directly from 'sling'.
This quickstart demonstrates how to define a PostgreSQL source and a Snowflake target, then execute a data movement job. It uses environment variables for sensitive connection details, which is a recommended practice. Ensure you have the necessary `sling` extras installed (e.g., `sling[postgres,snowflake]`) and your environment variables configured for a successful run.
import os
from sling import Connection, Source, Target, run
# Configure connections using environment variables for sensitive data
# For a real run, ensure these environment variables are set:
# SLING_PG_HOST, SLING_PG_USER, SLING_PG_PASS, SLING_PG_DB
# SLING_SNF_ACCOUNT, SLING_SNF_USER, SLING_SNF_PASS, SLING_SNF_DB, SLING_SNF_WAREHOUSE
postgres_conn = Connection(
name='my_postgres',
type='postgres',
host=os.environ.get('SLING_PG_HOST', 'localhost'),
port=5432,
user=os.environ.get('SLING_PG_USER', 'user'),
password=os.environ.get('SLING_PG_PASS', 'password'),
database=os.environ.get('SLING_PG_DB', 'source_db')
)
snowflake_conn = Connection(
name='my_snowflake',
type='snowflake',
account=os.environ.get('SLING_SNF_ACCOUNT', 'your_account'),
user=os.environ.get('SLING_SNF_USER', 'user'),
password=os.environ.get('SLING_SNF_PASS', 'password'),
database=os.environ.get('SLING_SNF_DB', 'target_db'),
warehouse=os.environ.get('SLING_SNF_WAREHOUSE', 'COMPUTE_WH')
)
# Define source and target for a simple table copy
source_table = Source(
connection=postgres_conn,
object='public.my_source_table'
)
target_table = Target(
connection=snowflake_conn,
object='public.my_target_table',
mode='full_refresh' # or 'append', 'incremental'
)
# Run the data sling job
try:
result = run(source_table, target_table)
print(f"Sling job completed. Rows replicated: {result.rows_replicated}")
except Exception as e:
print(f"Sling job failed: {e}")
# Example of retrieving connection by name if already added to a global registry (e.g., via CLI or config file)
# connection = Connection.get_connection('my_postgres')
sling --version
Errors
Common errors & fixes
sling.exceptions.SlingConnectionException: Failed to connect to database: fe_sendauth: no password supplied
Incorrect or missing authentication credentials (user, password) for the database connection.
fixVerify that the `user` and `password` parameters in your `Connection` object are correct and match the database server's requirements. Ensure environment variables (if used) are properly set and accessible.
ModuleNotFoundError: No module named 'sling.connections'
Attempting to import submodules directly instead of the top-level package. All core classes and functions are exposed directly under the `sling` package.
fixChange your import statement from `from sling.connections import Connection` (or similar for other components) to `from sling import Connection` (or `from sling import Source, Target, run`).
KeyError: 'SomeEnvVar'
Attempting to access an environment variable directly via `os.environ['KEY']` which is not set, instead of using `os.environ.get('KEY', default_value)`.
fixUse `os.environ.get('KEY', '')` or `os.environ.get('KEY', None)` to safely retrieve environment variables and provide a default value or handle the `None` case, preventing the `KeyError`. Upgrade
Version history
1.5.20latest on PyPI · released Jun 7, 2026
Audit
Dependencies
pyyamlrequiredUsed for configuration parsing.
requestsrequiredUsed for HTTP API interactions, critical for many connectors.