Skip to main content

A Node.js-style package manager for Python with zero configuration

Project description

๐Ÿ Snakeer

A Node.js-style package manager for Python with zero configuration required.

Architecture

Snakeer uses a serverless-first, zero-config architecture:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      HTTP API       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Python    โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€> โ”‚  Serverless     โ”‚
โ”‚   Client    โ”‚                     โ”‚  Functions      โ”‚
โ”‚  (snakeer)  โ”‚ <โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚ (Netlify/Vercel)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
      โ”‚                                    โ”‚
      โ”‚ No env vars needed                 โ”‚ GITHUB_TOKEN
      โ”‚                                    v
      โ”‚                           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
      โ”‚                           โ”‚  GitHub      โ”‚
      โ”‚                           โ”‚  Repository  โ”‚
      โ”‚                           โ”‚ Package Storeโ”‚
      โ”‚                           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
      โ”‚
      โ–ผ
Automatic fallback:
- Primary: https://snakeer.vercel.app/
- Fallback: https://snakeer-package-api.netlify.app/functions/

Key Design:

  • Zero configuration - No environment variables needed on client
  • Automatic fallback - If Vercel fails, automatically tries Netlify
  • Secure - GITHUB_TOKEN only exists in serverless environment

Features

  • ๐Ÿ“ฆ Node.js-style package management - Familiar commands like install, add, remove, update
  • ๐Ÿ”’ Lock file support - Exact version tracking in project_packages.json
  • ๐Ÿš€ Zero configuration - Works out of the box, no setup needed
  • ๐Ÿ”„ Automatic failover - Vercel primary, Netlify backup
  • ๐Ÿ”„ Semantic versioning - Support for >=, ^, ~ version specifiers
  • ๐Ÿ“ Flat installation - All packages in snakeer_modules/ (no nesting)

Installation

# Clone the repository
git clone https://github.com/andy64lol/snakeer.git
cd snakeer

# Install the package
pip install -e .

# Or install from source
python setup.py install

Quick Start

No configuration needed! Just use it:

# Install all dependencies from project_packages.json
snakeer install

# Add a dependency
snakeer add coolpkg@1.0.0
snakeer add utilpkg@^2.0.0

# List installed packages
snakeer list

# Publish your package
snakeer publish

Use in your code:

from snakeer import require

coolpkg = require("coolpkg")
result = coolpkg.some_function()

CLI Commands

Command Description
snakeer install Install all dependencies from project_packages.json
snakeer add <pkg>@<version> Add a new package to dependencies
snakeer remove <pkg> Remove a package from dependencies
snakeer update [pkg] Update packages according to version ranges
snakeer list List installed packages
snakeer publish Publish current package to registry

How It Works

Automatic API Selection

The client automatically tries APIs in this order:

  1. Primary: https://snakeer.vercel.app/api/
  2. Fallback: https://snakeer-package-api.netlify.app/functions/

If the primary API fails, it automatically falls back to the secondary.

Serverless Functions

All GitHub API interactions happen in serverless functions:

Function Vercel URL Netlify URL
Download /api/download /functions/download.js
Upload /api/upload /functions/upload.js

Project Structure

my_project/
โ”œโ”€โ”€ main.py                        # Your entry point
โ”œโ”€โ”€ project_packages.json           # Config + lock file
โ”œโ”€โ”€ snakeer_modules/               # Installed packages
โ”‚   โ”œโ”€โ”€ coolpkg/
โ”‚   โ”‚   โ”œโ”€โ”€ index.py               # Package entry
โ”‚   โ”‚   โ””โ”€โ”€ metadata.json          # Package metadata
โ”‚   โ””โ”€โ”€ utilpkg/
โ””โ”€โ”€ .snakeer_cache/                # Cached downloads

Configuration (project_packages.json)

{
  "name": "my_project",
  "version": "1.0.0",
  "snakeer_dependencies": {
    "coolpkg": ">=1.0.0",
    "utilpkg": "^2.1.0"
  },
  "installed_dependencies_versions": {
    "coolpkg": "1.2.3",
    "utilpkg": "2.1.5"
  }
}

Package Format

Each package in snakeer_modules/ contains:

  • index.py - Main module with functions/classes
  • metadata.json - Package metadata and dependencies

Example metadata.json:

{
  "name": "coolpkg",
  "version": "1.2.3",
  "dependencies": {
    "utilpkg": ">=2.0.0"
  }
}

Version Specifiers

  • 1.0.0 - Exact version
  • >=1.0.0 - Greater than or equal
  • ^1.0.0 - Compatible with (same major version)
  • ~1.0.0 - Approximately equivalent (same major.minor)
  • latest - Latest available version

Serverless Deployment (For Maintainers)

If you're maintaining the Snakeer registry:

Netlify

  • Deploy functions/ directory
  • Set GITHUB_TOKEN in environment variables
  • URL: https://snakeer-package-api.netlify.app/functions/

Vercel

  • Deploy api/ directory
  • Set GITHUB_TOKEN in environment variables
  • URL: https://snakeer.vercel.app/api/

Required Serverless Environment Variables

  • GITHUB_TOKEN - GitHub personal access token with repo access (server-side only!)

Development

# Run the demo
python main.py

# Run CLI commands
python -m snakeer install
python -m snakeer add coolpkg@1.0.0

Security

  • โœ… No client-side credentials - Users don't need any tokens
  • โœ… Automatic failover - Works even if one service is down
  • โœ… Server-side only tokens - GITHUB_TOKEN never exposed to clients

License

MIT License - see LICENSE file for details.

Contributing

Contributions welcome! Please read CONTRIBUTING.md for guidelines.


Made with ๐Ÿ by andy64lol

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snakeer-1.0.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snakeer-1.0.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file snakeer-1.0.0.tar.gz.

File metadata

  • Download URL: snakeer-1.0.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for snakeer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 33c8f08e8e204a195597bb0feca2b4b311f16d67da49500758425d0e94fc6151
MD5 50a7e984cda5a7a683863053f83c0c2f
BLAKE2b-256 ecd09e550d26a6a580d7f6c7455a818f7eab1d41acac74b3a51f8bcaba2cd47f

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeer-1.0.0.tar.gz:

Publisher: python-publish.yml on andy64lol/snakeer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: snakeer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for snakeer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c8dc61bc8f28c20b35caf17c53816e66b103ef4fd6b3f8b690d1aabb12adf7d
MD5 3c59706583d86a680f161c3754ac09ce
BLAKE2b-256 b66bef048814a07f570e8e9ab7ef3a4a157bc525a41162558d70240a5867ca59

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeer-1.0.0-py3-none-any.whl:

Publisher: python-publish.yml on andy64lol/snakeer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page