|
1 | | -# python-ooui |
2 | | -Port of ooui.js to Python |
| 1 | +# Python OOUI |
3 | 2 |
|
4 | | -## Testing |
| 3 | +Python OOUI (Open Object User Interface) is a Python port of ooui.js, providing powerful tools for data visualization and processing. |
5 | 4 |
|
6 | | -```shell |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Graph Processing**: Create line charts, bar charts, pie charts, and indicators |
| 8 | +- **Tree Views**: Handle structured data with advanced filtering and conditional formatting |
| 9 | +- **Data Helpers**: Utilities for domain parsing, condition evaluation, and data aggregation |
| 10 | +- **XML Parsing**: Parse XML-based graph and tree definitions |
| 11 | +- **Cross-Platform**: Compatible with Python 2.7+ and Python 3.x |
| 12 | + |
| 13 | +## Quick Start |
| 14 | + |
| 15 | +### Installation |
| 16 | + |
| 17 | +```bash |
| 18 | +pip install ooui |
| 19 | +``` |
| 20 | + |
| 21 | +### Basic Usage |
| 22 | + |
| 23 | +```python |
| 24 | +from ooui.graph import parse_graph |
| 25 | +from ooui.tree import parse_tree |
| 26 | + |
| 27 | +# Create a line chart |
| 28 | +graph_xml = ''' |
| 29 | +<graph type="line" string="Sales Trend"> |
| 30 | + <field name="date" type="date"/> |
| 31 | + <field name="amount" type="float" operator="sum"/> |
| 32 | +</graph> |
| 33 | +''' |
| 34 | +graph = parse_graph(graph_xml) |
| 35 | + |
| 36 | +# Create a tree view |
| 37 | +tree_xml = ''' |
| 38 | +<tree string="Customer List" editable="top"> |
| 39 | + <field name="name"/> |
| 40 | + <field name="email"/> |
| 41 | + <field name="status"/> |
| 42 | +</tree> |
| 43 | +''' |
| 44 | +tree = parse_tree(tree_xml) |
| 45 | +``` |
| 46 | + |
| 47 | +## Documentation |
| 48 | + |
| 49 | +📚 **[Complete Documentation](docs/index.md)** - Start here for comprehensive guides and examples |
| 50 | + |
| 51 | +### Quick Links |
| 52 | + |
| 53 | +- **[Installation Guide](docs/installation.md)** - Detailed setup instructions |
| 54 | +- **[Usage Guide](docs/usage.md)** - Core concepts and basic usage |
| 55 | +- **[API Reference](docs/api-reference.md)** - Complete API documentation |
| 56 | +- **[Examples](docs/examples.md)** - Practical code examples |
| 57 | +- **[Advanced Usage](docs/advanced-usage.md)** - Complex scenarios and advanced features |
| 58 | + |
| 59 | +## Key Components |
| 60 | + |
| 61 | +### Graph Processing |
| 62 | +```python |
| 63 | +from ooui.graph import parse_graph |
| 64 | + |
| 65 | +# Support for multiple chart types |
| 66 | +graph = parse_graph(xml_definition) |
| 67 | +result = graph.process(data, fields) |
| 68 | +``` |
| 69 | + |
| 70 | +### Tree Views |
| 71 | +```python |
| 72 | +from ooui.tree import parse_tree |
| 73 | + |
| 74 | +# Structured data with conditional formatting |
| 75 | +tree = parse_tree(xml_definition) |
| 76 | +conditional_fields = tree.fields_in_conditions |
| 77 | +``` |
| 78 | + |
| 79 | +### Condition Evaluation |
| 80 | +```python |
| 81 | +from ooui.helpers import ConditionParser |
| 82 | + |
| 83 | +parser = ConditionParser("red:amount < 100;green:amount >= 100") |
| 84 | +result = parser.eval({'amount': 150}) # Returns "green" |
| 85 | +``` |
| 86 | + |
| 87 | +### Domain Parsing |
| 88 | +```python |
| 89 | +from ooui.helpers import Domain |
| 90 | + |
| 91 | +domain = Domain("[('active', '=', True), ('age', '>', 18)]") |
| 92 | +parsed = domain.parse({'user_id': 42}) |
| 93 | +``` |
| 94 | + |
| 95 | +## Development |
| 96 | + |
| 97 | +### Setting Up Development Environment |
| 98 | + |
| 99 | +```bash |
| 100 | +# Clone the repository |
| 101 | +git clone https://github.com/gisce/python-ooui.git |
| 102 | +cd python-ooui |
| 103 | + |
| 104 | +# Install in development mode |
7 | 105 | pip install -e . |
| 106 | + |
| 107 | +# Install development dependencies |
8 | 108 | pip install -r requirements-dev.txt |
| 109 | +``` |
| 110 | + |
| 111 | +### Running Tests |
| 112 | + |
| 113 | +```bash |
| 114 | +# Run all tests |
9 | 115 | mamba |
| 116 | + |
| 117 | +# Tests use mamba (BDD testing framework) |
| 118 | +# See spec/ directory for test specifications |
10 | 119 | ``` |
| 120 | + |
| 121 | +### Project Structure |
| 122 | + |
| 123 | +``` |
| 124 | +ooui/ |
| 125 | +├── graph/ # Graph processing (charts, indicators) |
| 126 | +├── tree/ # Tree view processing |
| 127 | +└── helpers/ # Utilities (conditions, domain, dates, etc.) |
| 128 | +``` |
| 129 | + |
| 130 | +## Contributing |
| 131 | + |
| 132 | +Contributions are welcome! Please: |
| 133 | + |
| 134 | +1. Check the [documentation](docs/) to understand the project |
| 135 | +2. Review existing [examples](docs/examples.md) and [API reference](docs/api-reference.md) |
| 136 | +3. Follow the existing code style and patterns |
| 137 | +4. Add tests for new functionality |
| 138 | +5. Update documentation as needed |
| 139 | + |
| 140 | +## License |
| 141 | + |
| 142 | +MIT License - see LICENSE file for details. |
| 143 | + |
| 144 | +## About |
| 145 | + |
| 146 | +Developed by [GISCE](https://gisce.net) for the GISCE-ERP project. |
| 147 | + |
| 148 | +For more information, visit the [complete documentation](docs/index.md). |
0 commit comments