{"id":4277,"library":"tentaclio-s3","title":"Tentaclio S3","description":"Tentaclio-s3 is a Python package that provides all the necessary dependencies to enable S3 protocol support within the `tentaclio` library. The `tentaclio` library itself simplifies handling streams from various protocols (like file, ftp, sftp, s3) and manages credentials. Tentaclio-s3, currently at version 0.0.3, acts as an 'extra' dependency for tentaclio, not a standalone library for direct S3 interaction.","status":"active","version":"0.0.3","language":"en","source_language":"en","source_url":"https://github.com/octopus-energy/tentaclio-s3","tags":["s3","aws","storage","io","streams","tentaclio","cloud"],"install":[{"cmd":"pip install tentaclio-s3","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"This package provides S3 protocol handling for the core tentaclio library.","package":"tentaclio"},{"reason":"Used under the hood for AWS S3 authentication and interaction.","package":"boto3","optional":false}],"imports":[{"note":"tentaclio-s3 is an 'extra' package for tentaclio; core functionality is accessed via the main tentaclio library.","symbol":"open","correct":"from tentaclio import open"}],"quickstart":{"code":"import os\nfrom tentaclio import open\n\n# Ensure AWS credentials are set via environment variables (e.g., AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)\n# or other boto3-supported methods (IAM role, ~/.aws/credentials).\n# For demonstration, we'll use a dummy bucket and key.\nS3_BUCKET = os.environ.get('TEST_S3_BUCKET', 'your-test-s3-bucket')\nS3_KEY = os.environ.get('TEST_S3_KEY', 'path/to/my_file.txt')\nS3_PATH = f\"s3://{S3_BUCKET}/{S3_KEY}\n\n# Example: Write to an S3 file\ncontent_to_write = \"Hello from tentaclio-s3!\"\ntry:\n    with open(S3_PATH, mode=\"w\") as writer:\n        writer.write(content_to_write)\n    print(f\"Content successfully written to {S3_PATH}\")\n\n    # Example: Read from an S3 file\n    with open(S3_PATH, mode=\"r\") as reader:\n        read_content = reader.read()\n    print(f\"Content read from {S3_PATH}: {read_content}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure your AWS credentials are configured and the S3 bucket/key are accessible.\")\n","lang":"python","description":"This quickstart demonstrates how to use `tentaclio.open` to write to and read from an S3 path. It assumes AWS credentials (e.g., `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`) are configured in the environment or via other `boto3` supported methods. The `tentaclio-s3` package is automatically utilized when an `s3://` URL is provided to `tentaclio.open`."},"warnings":[{"fix":"Ensure your imports are from `tentaclio` (e.g., `from tentaclio import open`) and that `tentaclio-s3` is installed as a dependency to enable S3 scheme support.","message":"Tentaclio-s3 is an 'extra' package for the main `tentaclio` library. You should always import and interact with S3 via `tentaclio.open` (or `tentaclio.copy`, `tentaclio.remove`, etc.) rather than attempting to import directly from `tentaclio_s3`.","severity":"gotcha","affected_versions":"0.0.1+"},{"fix":"Set appropriate AWS environment variables, configure `~/.aws/credentials`, or ensure your execution environment (e.g., EC2) has an attached IAM role with S3 access permissions.","message":"Authentication for S3 resources relies on `boto3`'s credential resolution chain. This means AWS credentials must be configured in your environment (e.g., `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`), via an IAM role for EC2 instances, or in `~/.aws/credentials`.","severity":"gotcha","affected_versions":"0.0.1+"},{"fix":"Upgrade your Python interpreter to version 3.9 or newer.","message":"The `tentaclio` library, which `tentaclio-s3` extends, requires Python 3.9 or higher. Ensure your environment meets this minimum Python version.","severity":"gotcha","affected_versions":"0.0.1+"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}