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"
    }
  ]
}

๐Ÿค 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.0.0.tar.gz (35.0 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.0.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zenive-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8cd4a78ec644276fca41ade5952da5fbbee77f5bc8e22289221071d15a610703
MD5 05b2ef74e90182d61cbfaa6346bdbcc2
BLAKE2b-256 09d0dd805108a14319060299a9105777852c58dbddc23cf06247872e96a22110

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zenive-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96a03f2b2b04f73ae9e0a19f790e30de280d775e24dce35e3daae07e05643218
MD5 1d7bff18a75de50b9fc366a3ac18cf5d
BLAKE2b-256 59b081e50dc616e8f173cbcafe4c7a07da35cb584c8df67240b0f3869511384a

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