# WorkFrame
Simple Flask-based framework for building business applications quickly.
## Overview
WorkFrame is a Python framework designed specifically for building business applications with minimal ceremony. It focuses on business logic while handling all the web application plumbing automatically.
### Core Philosophy
- **Business-first**: Target business applications, not generic web development
- **Zero ceremony**: Minimal boilerplate code required
- **Convention over configuration**: Sensible defaults that work out of the box
- **Escape hatches**: Always provide ways to customize when needed
- **Developer experience**: Should feel like magic for common use cases
- **Production ready**: Suitable for real business applications from day one
## Quick Start
### Installation
```bash
pip install workframe
```
### Simple Example
Create a file called `app.py`:
```python
from workframe import WorkFrame, crud
# Create app with custom branding
app = WorkFrame(__name__,
app_name="My Business App",
app_description="Customer Management System")
# Create a simple contact management system
contacts = crud('contacts', ['name', 'email', 'phone', 'company'])
app.register_module('/contacts', contacts, menu_title='Contacts', icon='bi-person')
if __name__ == '__main__':
app.run(debug=True)
```
Run the application:
```bash
python app.py
```
Visit `http://localhost:5000` and login with `admin/admin`.
That's it! You now have a fully functional business application with:
- User authentication and session management
- Complete CRUD operations for contacts
- Professional Bootstrap 5 dark theme UI
- Responsive design for mobile/tablet
- Admin interface for user management
### Advanced Example
```python
from workframe import WorkFrame, crud, Field
app = WorkFrame(__name__)
# Define companies first (lookup target)
companies = crud('companies', [
'name',
'website',
Field('industry', enum=['Technology', 'Healthcare', 'Finance', 'Other']),
Field('employee_count', type='number'),
Field('is_client', type='boolean', default=False),
])
# Define contacts with advanced field types
contacts = crud('contacts', [
'name', # simple text field
'email', # auto-detected email field
Field('company_id', lookup='companies', display='name'), # foreign key dropdown
Field('status', enum=['Active', 'Inactive']), # dropdown
Field('created_date', readonly=True, hidden_in_form=True),
Field('notes', type='textarea', optional=True),
])
# Register modules with icons (companies first since contacts references it)
app.register_module('/companies', companies, menu_title='Companies', icon='bi-building')
app.register_module('/contacts', contacts, menu_title='Contacts', icon='bi-person-lines-fill')
if __name__ == '__main__':
app.run(debug=True)
```
## Features
### Automatic CRUD Generation
- **One-line CRUD**: `crud('table_name', ['field1', 'field2'])` creates complete CRUD
- **List views**: Paginated, searchable, sortable data tables
- **CSV Export**: Export data to CSV with one click (NEW)
- **Bulk Actions**: Select multiple records and delete in bulk (NEW)
- **Forms**: Auto-generated forms with validation
- **Detail views**: View and edit individual records
### Rich Field Types
- Text, email, phone, date, datetime, currency, textarea
- **Foreign key lookups with dropdowns** (NEW)
- Enumeration fields with select options
- Boolean fields with checkboxes
- Auto-detection based on field names
- Extensive customization options
### Built-in Authentication
- **Secure by default** - All CRUD operations require authentication
- **Smart navigation** - Menu items only appear when user is authenticated
- **Production-ready security** - No exposed credentials or security hints (NEW)
- User management with admin/regular user roles
- Session-based authentication
- Password hashing and security
- Admin interface for user management
### Professional UI
- Bootstrap 5 dark theme
- **Mobile-first responsive design**
- **Smart navigation** with conditional menu items and multi-level support (NEW)
- **Complete custom branding** - app name appears throughout entire application (NEW)
- **Clean, professional styling** - no framework branding or copyright clutter (NEW)
- **Bootstrap icons** for menu items with 1,800+ icons available (NEW)
- Auto-generated navigation
- Flash messaging system
- **Automatic schema migration** - your code is the source of truth (NEW)
- **Smart error handling** with helpful migration instructions (NEW)
- Professional data export functionality
### Business Application Ready
- Multi-module applications
- Admin vs user permission separation
- **Authentication required by default** - no unsecured endpoints
- **Automatic database schema updates** - no manual migrations needed
- Production-ready security defaults
- SQLite for development, configurable for production
## Customization Options
### Application Branding
```python
from workframe import WorkFrame
# Customize your application's branding
app = WorkFrame(__name__,
app_name="My Business App", # Custom app name in navbar and title
app_description="Customer Management" # Custom footer description
)
```
### Admin-Only Modules
```python
# Create admin-restricted CRUD modules
admin_reports = crud('reports', [
'title',
'description',
Field('created_date', readonly=True)
], admin_required=True) # Only admin users can access
app.register_module('/admin/reports', admin_reports,
menu_title='Reports',
admin_only=True)
```
### Navigation and Menus
```python
# Single-level menu with icon
app.register_module('/contacts', contacts,
menu_title='Contacts',
icon='bi-person-lines-fill')
# Multi-level menu (dropdown)
app.register_module('/contacts', contacts,
menu_title='All Contacts',
icon='bi-person-lines-fill',
parent='Customer Management')
app.register_module('/companies', companies,
menu_title='All Companies',
icon='bi-building',
parent='Customer Management')
# Admin-only modules
app.register_module('/reports', reports,
menu_title='Reports',
icon='bi-graph-up',
admin_only=True)
```
### Field Customization
```python
from workframe import Field
# Advanced field definition
Field('field_name',
type='text|email|phone|date|datetime|currency|textarea',
required=True|False,
readonly=True|False,
hidden=True|False,
placeholder='text',
default='value'|callable,
validation=callable,
enum=['option1', 'option2'], # dropdown options
lookup='table_name', # foreign key
display='field_name', # display field for lookups
rows=5, # textarea rows
format='${:,.2f}' # display formatting
)
```
## Generated Routes
Every module automatically gets:
- `/module` - List all records with bulk selection
- `/module/export.csv` - Export data to CSV (NEW)
- `/module/bulk-delete` - Delete multiple records (NEW)
- `/module/new` - Create new record
- `/module/<id>` - View record details
- `/module/<id>/edit` - Edit record
- `/module/<id>/delete` - Delete record
Plus admin routes:
- `/admin/users` - User management
- `/admin/groups` - Group management
## Requirements
- Python 3.9+
- Flask 2.3+
- Modern web browser
## Development Status
WorkFrame is currently in beta. The core functionality is stable and suitable for development and testing. Production use is possible but please test thoroughly.
## Documentation
More detailed documentation and examples are coming soon.
## Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
## License
MIT License - see LICENSE file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/massyn/workframe",
"name": "workframe",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "WorkFrame Contributors <workframe@example.com>",
"keywords": "flask, framework, business, crud, web, application",
"author": "WorkFrame Contributors",
"author_email": "WorkFrame Contributors <workframe@example.com>",
"download_url": "https://files.pythonhosted.org/packages/a1/05/e8ca27519c9bae84a8fef65f800e216d532dcadf840258aa804a0258a9f1/workframe-0.1.1.tar.gz",
"platform": null,
"description": "# WorkFrame\n\nSimple Flask-based framework for building business applications quickly.\n\n## Overview\n\nWorkFrame is a Python framework designed specifically for building business applications with minimal ceremony. It focuses on business logic while handling all the web application plumbing automatically.\n\n### Core Philosophy\n- **Business-first**: Target business applications, not generic web development\n- **Zero ceremony**: Minimal boilerplate code required \n- **Convention over configuration**: Sensible defaults that work out of the box\n- **Escape hatches**: Always provide ways to customize when needed\n- **Developer experience**: Should feel like magic for common use cases\n- **Production ready**: Suitable for real business applications from day one\n\n## Quick Start\n\n### Installation\n\n```bash\npip install workframe\n```\n\n### Simple Example\n\nCreate a file called `app.py`:\n\n```python\nfrom workframe import WorkFrame, crud\n\n# Create app with custom branding\napp = WorkFrame(__name__, \n app_name=\"My Business App\", \n app_description=\"Customer Management System\")\n\n# Create a simple contact management system\ncontacts = crud('contacts', ['name', 'email', 'phone', 'company'])\napp.register_module('/contacts', contacts, menu_title='Contacts', icon='bi-person')\n\nif __name__ == '__main__':\n app.run(debug=True)\n```\n\nRun the application:\n\n```bash\npython app.py\n```\n\nVisit `http://localhost:5000` and login with `admin/admin`.\n\nThat's it! You now have a fully functional business application with:\n- User authentication and session management\n- Complete CRUD operations for contacts\n- Professional Bootstrap 5 dark theme UI\n- Responsive design for mobile/tablet\n- Admin interface for user management\n\n### Advanced Example\n\n```python\nfrom workframe import WorkFrame, crud, Field\n\napp = WorkFrame(__name__)\n\n# Define companies first (lookup target)\ncompanies = crud('companies', [\n 'name',\n 'website', \n Field('industry', enum=['Technology', 'Healthcare', 'Finance', 'Other']),\n Field('employee_count', type='number'),\n Field('is_client', type='boolean', default=False),\n])\n\n# Define contacts with advanced field types\ncontacts = crud('contacts', [\n 'name', # simple text field\n 'email', # auto-detected email field\n Field('company_id', lookup='companies', display='name'), # foreign key dropdown\n Field('status', enum=['Active', 'Inactive']), # dropdown\n Field('created_date', readonly=True, hidden_in_form=True),\n Field('notes', type='textarea', optional=True),\n])\n\n# Register modules with icons (companies first since contacts references it)\napp.register_module('/companies', companies, menu_title='Companies', icon='bi-building')\napp.register_module('/contacts', contacts, menu_title='Contacts', icon='bi-person-lines-fill')\n\nif __name__ == '__main__':\n app.run(debug=True)\n```\n\n## Features\n\n### Automatic CRUD Generation\n- **One-line CRUD**: `crud('table_name', ['field1', 'field2'])` creates complete CRUD\n- **List views**: Paginated, searchable, sortable data tables\n- **CSV Export**: Export data to CSV with one click (NEW)\n- **Bulk Actions**: Select multiple records and delete in bulk (NEW)\n- **Forms**: Auto-generated forms with validation\n- **Detail views**: View and edit individual records\n\n### Rich Field Types\n- Text, email, phone, date, datetime, currency, textarea\n- **Foreign key lookups with dropdowns** (NEW)\n- Enumeration fields with select options\n- Boolean fields with checkboxes\n- Auto-detection based on field names\n- Extensive customization options\n\n### Built-in Authentication\n- **Secure by default** - All CRUD operations require authentication\n- **Smart navigation** - Menu items only appear when user is authenticated\n- **Production-ready security** - No exposed credentials or security hints (NEW)\n- User management with admin/regular user roles\n- Session-based authentication\n- Password hashing and security\n- Admin interface for user management\n\n### Professional UI\n- Bootstrap 5 dark theme\n- **Mobile-first responsive design**\n- **Smart navigation** with conditional menu items and multi-level support (NEW)\n- **Complete custom branding** - app name appears throughout entire application (NEW)\n- **Clean, professional styling** - no framework branding or copyright clutter (NEW)\n- **Bootstrap icons** for menu items with 1,800+ icons available (NEW)\n- Auto-generated navigation\n- Flash messaging system\n- **Automatic schema migration** - your code is the source of truth (NEW)\n- **Smart error handling** with helpful migration instructions (NEW)\n- Professional data export functionality\n\n### Business Application Ready\n- Multi-module applications\n- Admin vs user permission separation\n- **Authentication required by default** - no unsecured endpoints\n- **Automatic database schema updates** - no manual migrations needed\n- Production-ready security defaults\n- SQLite for development, configurable for production\n\n## Customization Options\n\n### Application Branding\n\n```python\nfrom workframe import WorkFrame\n\n# Customize your application's branding\napp = WorkFrame(__name__,\n app_name=\"My Business App\", # Custom app name in navbar and title\n app_description=\"Customer Management\" # Custom footer description\n)\n```\n\n### Admin-Only Modules\n\n```python\n# Create admin-restricted CRUD modules\nadmin_reports = crud('reports', [\n 'title',\n 'description', \n Field('created_date', readonly=True)\n], admin_required=True) # Only admin users can access\n\napp.register_module('/admin/reports', admin_reports, \n menu_title='Reports', \n admin_only=True)\n```\n\n### Navigation and Menus\n\n```python\n# Single-level menu with icon\napp.register_module('/contacts', contacts, \n menu_title='Contacts', \n icon='bi-person-lines-fill')\n\n# Multi-level menu (dropdown)\napp.register_module('/contacts', contacts, \n menu_title='All Contacts', \n icon='bi-person-lines-fill', \n parent='Customer Management')\n\napp.register_module('/companies', companies, \n menu_title='All Companies', \n icon='bi-building', \n parent='Customer Management')\n\n# Admin-only modules\napp.register_module('/reports', reports, \n menu_title='Reports', \n icon='bi-graph-up',\n admin_only=True)\n```\n\n### Field Customization\n\n```python\nfrom workframe import Field\n\n# Advanced field definition\nField('field_name',\n type='text|email|phone|date|datetime|currency|textarea',\n required=True|False,\n readonly=True|False, \n hidden=True|False,\n placeholder='text',\n default='value'|callable,\n validation=callable,\n enum=['option1', 'option2'], # dropdown options\n lookup='table_name', # foreign key\n display='field_name', # display field for lookups\n rows=5, # textarea rows\n format='${:,.2f}' # display formatting\n)\n```\n\n## Generated Routes\n\nEvery module automatically gets:\n- `/module` - List all records with bulk selection\n- `/module/export.csv` - Export data to CSV (NEW)\n- `/module/bulk-delete` - Delete multiple records (NEW)\n- `/module/new` - Create new record\n- `/module/<id>` - View record details \n- `/module/<id>/edit` - Edit record\n- `/module/<id>/delete` - Delete record\n\nPlus admin routes:\n- `/admin/users` - User management\n- `/admin/groups` - Group management\n\n## Requirements\n\n- Python 3.9+\n- Flask 2.3+\n- Modern web browser\n\n## Development Status\n\nWorkFrame is currently in beta. The core functionality is stable and suitable for development and testing. Production use is possible but please test thoroughly.\n\n## Documentation\n\nMore detailed documentation and examples are coming soon.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues and pull requests.\n\n## License\n\nMIT License - see LICENSE file for details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple Flask-based framework for building business applications quickly",
"version": "0.1.1",
"project_urls": {
"Bug Tracker": "https://github.com/massyn/workframe/issues",
"Documentation": "https://github.com/massyn/workframe/",
"Homepage": "https://github.com/massyn/workframe/",
"Repository": "https://github.com/massyn/workframe/"
},
"split_keywords": [
"flask",
" framework",
" business",
" crud",
" web",
" application"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1bfc521758fa19d226dd98953cba7a2ae8e887c5960c3bae25e2774bc99a8b38",
"md5": "709dc069241427a5ca1e6e059372ad15",
"sha256": "6b10f53ec63d41a624b6336f44ce68ebec049195b7aad3d1178d0c285218bce5"
},
"downloads": -1,
"filename": "workframe-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "709dc069241427a5ca1e6e059372ad15",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 80938,
"upload_time": "2025-08-03T10:51:43",
"upload_time_iso_8601": "2025-08-03T10:51:43.227587Z",
"url": "https://files.pythonhosted.org/packages/1b/fc/521758fa19d226dd98953cba7a2ae8e887c5960c3bae25e2774bc99a8b38/workframe-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a105e8ca27519c9bae84a8fef65f800e216d532dcadf840258aa804a0258a9f1",
"md5": "5e0c2243e3a2d26e90930ed9ee5956c1",
"sha256": "f231147b3cfba6fb87ed740a441c97c09b7f5b01addcb348f4b2c597c58bec43"
},
"downloads": -1,
"filename": "workframe-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "5e0c2243e3a2d26e90930ed9ee5956c1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 66466,
"upload_time": "2025-08-03T10:51:44",
"upload_time_iso_8601": "2025-08-03T10:51:44.386337Z",
"url": "https://files.pythonhosted.org/packages/a1/05/e8ca27519c9bae84a8fef65f800e216d532dcadf840258aa804a0258a9f1/workframe-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-03 10:51:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "massyn",
"github_project": "workframe",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "Flask",
"specs": [
[
">=",
"2.3.0"
]
]
},
{
"name": "Flask-SQLAlchemy",
"specs": [
[
">=",
"3.0.0"
]
]
},
{
"name": "Flask-Login",
"specs": [
[
">=",
"0.6.0"
]
]
},
{
"name": "Werkzeug",
"specs": [
[
">=",
"2.3.0"
]
]
},
{
"name": "Jinja2",
"specs": [
[
">=",
"3.1.0"
]
]
},
{
"name": "WTForms",
"specs": [
[
">=",
"3.0.0"
]
]
},
{
"name": "colorama",
"specs": [
[
">=",
"0.4.0"
]
]
}
],
"lcname": "workframe"
}