Skip to main content

A component registry for discovering, installing, and managing reusable code components

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 zenive

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

Components are organized with separate files and 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"
    }
  ]
}

Reference your files with url paths for clean organization.

๐Ÿ—๏ธ 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

# 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>

# View available animations
zen animations

# Help
zen --help
zen add --help

๐Ÿ“š Creating Components

1. Component Structure

Create a directory with separate files:

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

component.json:

{
  "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

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
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/TheRaj71/my-components/tree/main/text-utils
zen add https://github.com/TheRaj71/my-components/tree/main/config-loader

๐Ÿ”„ Development Workflow

  1. Create component directory with JSON config and Python files
  2. Host component on GitHub or any accessible URL
  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.1.tar.gz (68.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.1-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zenive-1.1.1.tar.gz
  • Upload date:
  • Size: 68.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.1.tar.gz
Algorithm Hash digest
SHA256 b092099e2997220423ae91699d07ae7ce2c350ab3c9bf3a831893511a4bd0ed4
MD5 f370f08314f49876e9f6b9497571f16b
BLAKE2b-256 cd0fb28a4e5568ea008503564e2d2db44f954654f9731f2c77518e868dbe559d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zenive-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f666fcd99cd6f1501d3810b4bb8d858ee09c3b8907926721044d69fcb37cdc2d
MD5 f53e40e47ab2f79876f20d656bba5f0b
BLAKE2b-256 bf3e8308453b722d56f33d4b6f5ba2aaca81f93f3b72aeeb2124e51ba6d02881

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