Skip to main content

Python component registry system inspired by shadcn/ui - install components from GitHub

Project description

zen

A Python component registry system inspired by shadcn/ui - install Python components from anywhere with a single command.

๐Ÿš€ Quick Start

Installation

pip install zen

Initialize a Project

zen init my-project
cd my-project

Install Components (shadcn/ui style!)

# Install from GitHub repository (auto-discovers component.json)
zen add https://github.com/user/awesome-components

# Install from specific component directory
zen add https://github.com/user/components/tree/main/email-validator

# Install from direct JSON URL
zen add https://raw.githubusercontent.com/user/repo/main/component.json

# Install to custom path
zen add https://github.com/user/jwt-auth --path src/auth

# Skip confirmation prompts
zen add https://github.com/user/component --yes

๐ŸŽฏ How It Works

zen works exactly like shadcn/ui but for Python:

  1. Developers create components in GitHub repositories with separate files
  2. Users install components directly into their projects from GitHub URLs
  3. Files are copied into the project with automatic dependency management
  4. No registry lock-in - install from any GitHub repository or URL

๐Ÿ“ฆ Component Format (New & Improved!)

Components are now organized like shadcn/ui - separate files with a simple JSON config:

Directory Structure:

email-validator/
โ”œโ”€โ”€ component.json       # Component metadata
โ”œโ”€โ”€ validator.py         # Main component code
โ”œโ”€โ”€ __init__.py         # Module initialization  
โ””โ”€โ”€ requirements.txt    # Dependencies

component.json:

{
  "name": "email-validator",
  "version": "1.0.0", 
  "description": "Simple email validation utility",
  "category": "utils",
  "dependencies": ["email-validator"],
  "files": [
    {
      "name": "validator.py",
      "path": "src/utils/validator.py",
      "url": "./validator.py"
    },
    {
      "name": "__init__.py",
      "path": "src/utils/__init__.py", 
      "url": "./__init__.py"
    }
  ]
}

No more embedded content! Just reference your files with url paths.

๐Ÿ—๏ธ Project Structure

zen creates organized Python projects:

my-project/
โ”œโ”€โ”€ .zen/
โ”‚   โ””โ”€โ”€ config.yaml    # Project configuration
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/    # General components
โ”‚   โ”œโ”€โ”€ utils/         # Utility functions
โ”‚   โ”œโ”€โ”€ models/        # Data models
โ”‚   โ”œโ”€โ”€ services/      # Business logic
โ”‚   โ”œโ”€โ”€ auth/          # Authentication
โ”‚   โ””โ”€โ”€ data/          # Data processing
โ”œโ”€โ”€ requirements.txt   # Auto-managed dependencies
โ””โ”€โ”€ README.md

๐Ÿ”ง CLI Commands (shadcn/ui inspired)

# Initialize new project
zen init [project-name]

# Install component from URL (with preview!)
zen add <component-url>

# Skip confirmation prompts
zen add <component-url> --yes

# Install to custom path
zen add <component-url> --path src/custom

# Overwrite existing files
zen add <component-url> --overwrite

# Dry run (show what would happen)
zen add <component-url> --dry-run

# List installed components
zen list

# Show component details
zen info <component-name>

# Remove component
zen remove <component-name>

# Help
zen --help
zen add --help

๐Ÿ“š Creating Components (The shadcn/ui Way!)

1. Component Structure (New!)

Create a directory with separate files (much cleaner!):

my-component/
โ”œโ”€โ”€ component.json      # Metadata only
โ”œโ”€โ”€ main.py            # Your Python code
โ”œโ”€โ”€ utils.py           # Additional files
โ”œโ”€โ”€ __init__.py        # Module init
โ””โ”€โ”€ requirements.txt   # Dependencies

component.json (no embedded content!):

{
  "name": "my-component",
  "version": "1.0.0",
  "description": "What this component does",
  "category": "utils",
  "dependencies": ["requests", "pydantic"],
  "files": [
    {
      "name": "main.py",
      "path": "src/utils/main.py",
      "url": "./main.py"
    },
    {
      "name": "requirements.txt",
      "path": "requirements.txt", 
      "url": "./requirements.txt"
    }
  ]
}

2. Hosting Components (GitHub First!)

Push your component directory to GitHub:

git add .
git commit -m "Add my awesome component"
git push origin main

3. Sharing Components

Users install with any of these formats:

# Repository root (auto-finds component.json)
zen add https://github.com/user/my-component

# Specific directory in repo
zen add https://github.com/user/components/tree/main/my-component

# Direct JSON URL (still works)
zen add https://raw.githubusercontent.com/user/repo/main/component.json

๐ŸŒŸ Features

  • Zero Configuration: Works out of the box
  • No Registry Lock-in: Install from any URL
  • Automatic Dependencies: Updates requirements.txt automatically
  • File Ownership: Code is copied into your project (you own it)
  • Flexible Paths: Install to any directory structure
  • Rich CLI: Beautiful terminal interface with progress indicators

๐ŸŽฏ Use Cases

Company Internal Components

zen add https://github.com/company/components/tree/main/auth/sso
zen add https://github.com/company/components/tree/main/data/processor

Open Source Components

zen add https://github.com/TheRaj71/Zenive/tree/main/components/email-validator
zen add https://github.com/TheRaj71/Zenive/tree/main/components/jwt-auth

Personal Collections

zen add https://github.com/yourusername/my-components/tree/main/text-utils
zen add https://github.com/yourusername/my-components/tree/main/config-loader

๐Ÿ”„ Development Workflow

  1. Create component JSON with embedded Python code
  2. Host JSON file on GitHub, website, CDN, etc.
  3. Share URL with users
  4. Users install with zen add <your-url>
  5. Files copied directly into user projects
  6. Dependencies automatically added to requirements.txt

๐Ÿ†š Why zen?

Feature zen pip packages git submodules
Easy Installation โœ… zen add <url> โœ… pip install โŒ Complex setup
Code Ownership โœ… Files in project โŒ External dependency โœ… Files in project
No Registry Lock-in โœ… Any GitHub URL โŒ PyPI only โœ… Any git repo
Dependency Management โœ… Auto-updates requirements.txt โœ… Auto-installed โŒ Manual
Easy Customization โœ… Edit copied files โŒ Hard to modify โœ… Easy to modify
Preview Before Install โœ… Shows what will be added โŒ No preview โŒ No preview

๐Ÿ“– Examples

Email Validator Component

{
  "name": "email-validator", 
  "version": "1.0.0",
  "description": "Email validation utilities with multiple validation methods",
  "category": "utils",
  "dependencies": ["email-validator"],
  "files": [
    {
      "name": "validator.py",
      "path": "src/utils/validator.py",
      "url": "./validator.py"
    },
    {
      "name": "__init__.py",
      "path": "src/utils/__init__.py",
      "url": "./__init__.py"
    }
  ]
}

JWT Auth Component

{
  "name": "jwt-auth",
  "version": "2.0.0", 
  "description": "JWT authentication utilities with middleware support",
  "category": "auth",
  "dependencies": ["PyJWT", "cryptography"],
  "files": [
    {
      "name": "jwt_handler.py",
      "path": "src/auth/jwt_handler.py",
      "url": "./jwt_handler.py"
    },
    {
      "name": "middleware.py",
      "path": "src/auth/middleware.py",
      "url": "./middleware.py"
    }
  ]
}

๐Ÿ“š Documentation

For detailed documentation, see the docs folder:

๐Ÿค Contributing

zen is open source. Contributions welcome!

๐Ÿ“„ License

MIT License - see LICENSE file for details.


zen - Python components made simple, inspired by shadcn/ui โœจ

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

zenive-1.1.0.tar.gz (135.2 kB view details)

Uploaded Source

Built Distribution

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

zenive-1.1.0-py3-none-any.whl (128.3 kB view details)

Uploaded Python 3

File details

Details for the file zenive-1.1.0.tar.gz.

File metadata

  • Download URL: zenive-1.1.0.tar.gz
  • Upload date:
  • Size: 135.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for zenive-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8a0a4c8a79e3207b7ffeec1d820eb7832fe1fa20008f3150d686338f8dde23e1
MD5 e33300e83de13c0fa01e134197761df0
BLAKE2b-256 60567a229a752a4067ed0df0a36fb304cae947fb034ea4a3bbeb0e33467c2d4a

See more details on using hashes here.

File details

Details for the file zenive-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: zenive-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 128.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for zenive-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 397f48d7901ae7167e5c9f145eaced176d59b3ece9387469911db5643809ff11
MD5 4ab1b80aea1be5f55c883403aaedbe30
BLAKE2b-256 a66ace0353330113ab006e7c221b0de1c3c37c936917b0594b876eaaf45717aa

See more details on using hashes here.

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