{"library":"s3pypi","title":"s3pypi - S3-backed Python Package Repository","description":"s3pypi is a Python command-line interface and library for creating and managing a private Python Package Index hosted in an Amazon S3 bucket. It supports uploading packages (wheels and source distributions), generating `index.html` files, and integrating with `pip`. The current version is `2.0.1`. It maintains an active development pace with releases typically tied to feature enhancements or bug fixes.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install s3pypi"],"cli":{"name":"s3pypi","version":"2.0.1"}},"imports":["from s3pypi.main import S3PyPI"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport shutil\nfrom pathlib import Path\nfrom s3pypi.main import S3PyPI\n\n# 1. Create a temporary directory and a dummy package file\ndist_dir = Path(\"dist_temp_s3pypi\")\ndist_dir.mkdir(exist_ok=True)\ndummy_package_name = \"my_dummy_package-1.0.0-py3-none-any.whl\"\ndummy_package_path = dist_dir / dummy_package_name\ndummy_package_path.write_text(\"This is a dummy package file content.\")\nprint(f\"Created dummy package file: {dummy_package_path}\")\n\n# 2. Configure S3PyPI using environment variables for AWS credentials\n#    Ensure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION are set in your environment\n#    and S3_PYPI_BUCKET points to your target S3 bucket.\naws_region = os.environ.get('AWS_REGION', 'us-east-1')\ns3_bucket_name = os.environ.get('S3_PYPI_BUCKET', 'your-s3pypi-bucket-name')\n\nprint(f\"\\nAttempting to deploy package to s3://{s3_bucket_name} in region {aws_region}...\")\n\ntry:\n    s3 = S3PyPI(\n        bucket=s3_bucket_name,\n        region=aws_region,\n        files=[str(dummy_package_path)] # Directly provide the path to the artifact\n    )\n    s3.deploy() # Use .deploy() as .upload() was removed in v2.0.0\n    print(f\"Successfully deployed {dummy_package_name} to s3://{s3_bucket_name}.\")\nexcept Exception as e:\n    print(f\"Error deploying package: {e}\")\n    print(\"\\nEnsure you have configured AWS credentials (e.g., via environment variables, ~/.aws/credentials) \")\n    print(f\"and that S3 bucket '{s3_bucket_name}' exists and you have write permissions (s3:PutObject, s3:GetObject, s3:ListBucket).\")\n\n# 3. Clean up temporary files\nshutil.rmtree(dist_dir)\nprint(\"Cleaned up temporary files.\")\n","lang":"python","description":"This quickstart demonstrates programmatically deploying a dummy Python package to an S3-backed PyPI repository. It requires AWS credentials and an S3 bucket configured in your environment variables. `s3pypi` will automatically pick up credentials from standard AWS locations (environment, shared credentials file).","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}