Modern Python CMS Framework - Fast, Typed, Secure, Modular
Project description
KardoCore
Modern Python Framework for CMS, Headless CMS, APIs and Enterprise Applications
๐ Overview
KardoCore is a hybrid, modular, and AI-ready Python framework designed for building modern web applications, CMS platforms, headless CMS, REST APIs, and enterprise solutions.
Key Features
- โก Asynchronous ASGI Architecture - Built for high performance
- ๐จ Native Template Engine (KardoTheme) - Natural syntax with
#prefix - ๐ฆ Package Manager - Install and manage themes easily
- ๐ Built-in Validation System - No external dependencies
- ๐ค AI-Ready (KardoAI) - Native integration for AI features
- ๐งฉ Extreme Modularity - Use only what you need
- ๐ Multi-language Support - i18n ready
๐ฏ Installation Modes
KardoCore offers 4 flexible installation modes to fit your needs:
1. Core Only - Headless CMS / REST API
Perfect for: API backends, microservices, headless CMS
โโโโโโโโโโโโโโโ
โ KardoCore โ โ Core framework only
โโโโโโโโโโโโโโโ
Use cases:
- REST API development
- Headless CMS backend
- Microservices
- GraphQL servers
- API-first applications
Installation:
pip install kardocore
2. Core + KardoAdmin - CMS with Admin Panel
Perfect for: Content management with admin interface
โโโโโโโโโโโโโโโ
โ KardoCore โ
โโโโโโโโโโโโโโโค
โ KardoAdmin โ โ Admin panel
โโโโโโโโโโโโโโโ
Use cases:
- Content management systems
- Admin dashboards
- User management
- Data administration
- Backend management
Installation:
pip install kardocore[admin]
3. Core + Admin + Theme - Full CMS (Complete Solution)
Perfect for: Full-featured websites and CMS platforms
โโโโโโโโโโโโโโโ
โ KardoCore โ
โโโโโโโโโโโโโโโค
โ KardoAdmin โ
โโโโโโโโโโโโโโโค
โ KardoTheme โ โ Frontend templates
โโโโโโโโโโโโโโโ
Use cases:
- Complete CMS platforms
- Corporate websites
- E-commerce sites
- Blogs and portfolios
- Multi-page applications
Installation:
pip install kardocore[full]
4. KardoTheme Only - Frontend Only
Perfect for: Static sites, frontend-only projects
โโโโโโโโโโโโโโโ
โ KardoTheme โ โ Template engine only
โโโโโโโโโโโโโโโ
Use cases:
- Static site generation
- Frontend templates
- Email templates
- PDF generation
- Report generation
Installation:
pip install kardotheme
๐ Quick Start
Installation Options
From PyPI (Recommended):
# Core only
pip install kardocore
# With admin panel
pip install kardocore[admin]
# Full CMS (Core + Admin + Theme)
pip install kardocore[full]
# Theme engine only
pip install kardotheme
From GitHub:
# Stable version (Python 3.11+)
pip install git+https://github.com/webcien/Kardo.git@v0.0.9
# Development version (Python 3.14+)
pip install git+https://github.com/webcien/Kardo.git@main
With npm (for frontend assets):
# Install KardoCSS
npm install @kardo/css
# Install KardoTheme compiler
npm install @kardo/theme-compiler
๐ Version Information
KardoCore is available in two versions to support different Python environments:
๐ฏ v0.0.9 (Stable) - RECOMMENDED FOR PRODUCTION
- Python: >= 3.11
- Status: Stable and production-ready
- Branch:
v0.0.9 - Compatible with: Python 3.11, 3.12, 3.13, 3.14+
๐ v0.1.0-alpha (Development)
- Python: >= 3.14
- Status: Active development
- Branch:
main - Features: Uses Python 3.14 modern features (PEP 649/749)
๐ See detailed version comparison โ
๐ก Usage Examples
Mode 1: Core Only (Headless API)
from kardocore import KardoApp
app = KardoApp()
@app.route("/api/posts")
async def get_posts(request):
return {
"posts": [
{"id": 1, "title": "First Post"},
{"id": 2, "title": "Second Post"}
]
}
if __name__ == "__main__":
app.run()
Mode 2: Core + Admin
from kardocore import KardoApp
from kardocore.admin import KardoAdmin
app = KardoApp()
admin = KardoAdmin(app)
# Register models for admin
@admin.register
class Post:
title: str
content: str
published: bool
if __name__ == "__main__":
app.run()
Access admin at: http://localhost:8000/admin
Mode 3: Full CMS (Core + Admin + Theme)
from kardocore import KardoApp
from kardocore.admin import KardoAdmin
from kardocore.theme import KardoTheme
app = KardoApp()
admin = KardoAdmin(app)
theme = KardoTheme(template_dir="templates")
@app.route("/")
async def index(request):
context = {
"title": "Welcome",
"posts": Post.objects.all()
}
return theme.render("index.html", context)
if __name__ == "__main__":
app.run()
Mode 4: Theme Only (Frontend)
from kardotheme import KardoTheme
theme = KardoTheme(template_dir="templates")
# Render template
html = theme.render("page.html", {
"title": "My Page",
"content": "Hello World"
})
# Save to file
with open("output.html", "w") as f:
f.write(html)
๐ค KardoAI - AI Integration
KardoAI is the native AI integration layer for KardoCore, providing seamless AI capabilities across all modes.
Key Features
- ๐ง Content Generation - AI-powered content creation
- ๐ Smart Search - Semantic search with embeddings
- ๐ฌ Chatbots - Integrated conversational AI
- ๐จ Image Generation - AI image creation and editing
- ๐ Auto-completion - Smart text suggestions
- ๐ Translation - Multi-language AI translation
- ๐ Analytics - AI-powered insights
How KardoAI Works
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Your Application โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ KardoCore โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ KardoAI โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โ โ AI Providers โ โ โ โ
โ โ โ โ - OpenAI โ โ โ โ
โ โ โ โ - Anthropic โ โ โ โ
โ โ โ โ - Google AI โ โ โ โ
โ โ โ โ - Local Models โ โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
KardoAI Usage Example
from kardocore import KardoApp
from kardocore.ai import KardoAI
app = KardoApp()
ai = KardoAI(app, provider="openai")
@app.route("/api/generate")
async def generate_content(request):
prompt = request.json.get("prompt")
# Generate content with AI
content = await ai.generate(
prompt=prompt,
max_tokens=500,
temperature=0.7
)
return {"content": content}
@app.route("/api/search")
async def semantic_search(request):
query = request.json.get("query")
# Semantic search with embeddings
results = await ai.search(
query=query,
collection="posts",
limit=10
)
return {"results": results}
@app.route("/api/chat")
async def chat(request):
message = request.json.get("message")
# Conversational AI
response = await ai.chat(
message=message,
context=request.session.get("chat_history", [])
)
return {"response": response}
KardoAI Configuration
# config.py
KARDOAI_CONFIG = {
"provider": "openai", # openai, anthropic, google, local
"api_key": "your-api-key",
"model": "gpt-4",
"temperature": 0.7,
"max_tokens": 1000,
# Features
"content_generation": True,
"semantic_search": True,
"chatbot": True,
"image_generation": True,
"translation": True,
# Embeddings
"embeddings_model": "text-embedding-3-small",
"vector_db": "chromadb", # chromadb, pinecone, weaviate
# Safety
"content_filter": True,
"rate_limiting": True,
"cost_tracking": True
}
KardoAI in Admin Panel
When using Mode 2 or Mode 3, KardoAI integrates directly into the admin panel:
- โ๏ธ Content Editor: AI writing assistant
- ๐ผ๏ธ Image Library: AI image generation
- ๐ Search Bar: Semantic search
- ๐ฌ Help Chat: AI-powered support
- ๐ Analytics: AI insights and recommendations
๐จ Template Engine (KardoTheme)
KardoCore includes a powerful native template engine with natural syntax.
Template Example
templates/index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<title>{title}</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@kardo/css@latest/dist/kardo.min.css">
</head>
<body>
<h1>{title}</h1>
#if items
<ul>
#for item in items
<li>{item.name} - ${item.price}</li>
#end
</ul>
#else
<p>No items available</p>
#end
#include "partials/footer.html"
</body>
</html>
Template Syntax
| Syntax | Description | Example |
|---|---|---|
{variable} |
Variable interpolation | {user.name} |
#if condition |
Conditional | #if user.is_admin |
#else |
Else clause | #else |
#end |
End block | #end |
#for item in items |
Loop | #for post in posts |
#include "file" |
Include template | #include "header.html" |
{# comment #} |
Comment | {# TODO: fix this #} |
๐ฆ Package Manager
Install and manage themes from the official registry.
CLI Commands
# Install a theme
kardo theme install wellness-clinic
# List installed themes
kardo theme list
# Search themes
kardo theme search health
# View theme info
kardo theme info wellness-clinic
# Uninstall theme
kardo theme uninstall wellness-clinic
๐๏ธ Project Structure
my_project/
โโโ app.py # Main application
โโโ config.py # Configuration
โโโ models/ # Data models
โ โโโ __init__.py
โ โโโ post.py
โ โโโ user.py
โโโ routes/ # Route handlers
โ โโโ __init__.py
โ โโโ api.py
โ โโโ web.py
โโโ templates/ # KardoTheme templates
โ โโโ layout.html
โ โโโ index.html
โ โโโ partials/
โ โโโ header.html
โ โโโ footer.html
โโโ static/ # Static files
โ โโโ css/
โ โโโ js/
โ โโโ images/
โโโ admin/ # Admin customization
โ โโโ config.py
โโโ requirements.txt
โโโ package.json # For npm dependencies
๐ Documentation
- Installation Guide - Detailed installation for all modes
- Quick Start Guide - Get started in 5 minutes
- Version Info - Compare v0.0.9 and v0.1.0
- Changelog - Version history
- Contributing - How to contribute
- KardoAI Guide - AI integration documentation
Language-Specific Documentation
- ๐บ๐ธ English: README.md (this file)
- ๐ช๐ธ Espaรฑol: README.es.md
๐ Ecosystem
KardoCore is part of the Kardo Ecosystem:
KardoCSS
Mobile-first CSS framework with utilities and components
- 67KB full / 50KB minified
- 20+ components
- 100+ utilities
- Touch-optimized
Installation:
npm install @kardo/css
# or
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@kardo/css@latest/dist/kardo.min.css">
KardoTemplates
Professional template collection for KardoCore
- 60 templates (50 frontend + 10 backend)
- 15 frontend categories
- 2 backend categories
- Mobile-first responsive
Installation:
kardo theme install wellness-clinic
๐ฏ Use Cases by Mode
Mode 1: Core Only
- โ REST API backends
- โ Headless CMS
- โ Microservices
- โ GraphQL servers
- โ API gateways
Mode 2: Core + Admin
- โ Content management
- โ User administration
- โ Data dashboards
- โ Backend systems
- โ Internal tools
Mode 3: Full CMS
- โ Corporate websites
- โ E-commerce platforms
- โ Blogs and magazines
- โ Portfolios
- โ Community sites
Mode 4: Theme Only
- โ Static site generation
- โ Email templates
- โ PDF reports
- โ Documentation sites
- โ Landing pages
๐ง Requirements
For v0.0.9 (Stable)
- Python >= 3.11
- uvicorn >= 0.30.0
For v0.1.0-alpha (Development)
- Python >= 3.14
- uvicorn >= 0.30.0
Optional Dependencies
- Admin Panel:
pip install kardocore[admin] - Full CMS:
pip install kardocore[full] - AI Features:
pip install kardocore[ai] - All Features:
pip install kardocore[all]
๐ค Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Development Setup
# Clone repository
git clone https://github.com/webcien/Kardo.git
cd Kardo
# For stable version
git checkout v0.0.9
# For development version
git checkout main
# Install in development mode with all features
pip install -e ".[all]"
# Run tests
pytest
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Full Documentation
- Discord: Join our community
๐บ๏ธ Roadmap
v0.0.9 (Current - Stable)
- โ Python 3.11+ compatibility
- โ Core features complete
- โ 4 installation modes
- ๐ Bug fixes and improvements
- ๐ Documentation
v0.1.0-alpha (Current - Development)
- โ Python 3.14+ optimizations
- ๐ KardoAI integration
- ๐ Experimental features
- ๐ PyPI publication
- ๐ npm packages
v1.0.0 (Future)
- ๐ Stable unified version
- ๐ Complete KardoAI features
- ๐ Multi-database support
- ๐ GraphQL support
- ๐ WebSocket support
- ๐ Complete documentation
- ๐ Production-ready
โญ Star History
If you find KardoCore useful, please consider giving it a star on GitHub!
Made with โค๏ธ by the Kardo Team
Website โข Documentation โข Blog โข Twitter
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kardocore-0.2.0.tar.gz.
File metadata
- Download URL: kardocore-0.2.0.tar.gz
- Upload date:
- Size: 85.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a342cbbc7577f7093eb83cac64ec1208b81992873fee908aa8d185ab8b9554a1
|
|
| MD5 |
b779934dd0b7d47286052d3b24ee4948
|
|
| BLAKE2b-256 |
29d13869005221ae8915cad7876c5c42e3f807fa9566e05521c7c3a53a1af471
|
File details
Details for the file kardocore-0.2.0-py3-none-any.whl.
File metadata
- Download URL: kardocore-0.2.0-py3-none-any.whl
- Upload date:
- Size: 57.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba4e2f49b8e1c1e5c4eb84bf1cd26782bf6b9eb1ce034ee413fab445c6d27d98
|
|
| MD5 |
51610bcd819d88e1000c3f108acceb9e
|
|
| BLAKE2b-256 |
a24f9c0b55c69321a3659280d09b2bf26e2362e5098d24cf8d620a672f875827
|