Name | pychartjs JSON |
Version |
1.0.0
JSON |
| download |
home_page | None |
Summary | git@github.com:tavallaie/pychartjs.git |
upload_time | 2024-08-19 00:33:51 |
maintainer | None |
docs_url | None |
author | Ali Tavallaie |
requires_python | <4.0,>=3.8 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Pychartjs
Pychartjs is a Python library for generating dynamic charts using Chart.js and integrating them into web applications. The library is built on top of the [Trunco](https://github.com/tavallaie/trunco) framework, which provides a component-based architecture to make it easy to create and manage various chart types.
## Features
- Support for all major chart types: Line, Bar, Pie, Doughnut, Radar, PolarArea, Bubble, and Scatter.
- Integration with various web frameworks including Robyn, Django, FastAPI, and other Python web frameworks.
- Dynamic chart rendering with context variables.
- Flexible and customizable chart options.
## Project Structure
```
pychartjs/
├── pychartjs/
│ ├── __init__.py
│ ├── charts.py
│ ├── datasets.py
│ ├── enums.py
│ ├── options.py
│ ├── scales.py
│ ├── plugins.py
│ ├── colors.py
├── tests/
│ ├── test_charts.py
│ ├── test_datasets.py
│ ├── test_options.py
│ ├── test_scales.py
│ ├── test_plugins.py
│ ├── test_colors.py
├── integration_tests/
│ ├── app.py
│ └── templates/
│ └── index.html
├── LICENSE
├── README.md
├── poetry.lock
└── pyproject.toml
```
- **`pychartjs/`**: Contains the core library code, including charts, datasets, enums, options, and scales.
- **`tests/`**: Unit tests for the various components of the library.
- **`integration_tests/`**: A sample application that demonstrates how to integrate `pychartjs` with a web framework like Robyn.
## Installation
1. **Install with Poetry:**
If you are using Poetry for dependency management, you can add `pychartjs` to your project with:
```bash
poetry add pychartjs
```
2. **Alternatively, install with pip:**
If you're using pip, you can install `pychartjs` with:
```bash
pip install pychartjs
```
## Usage
### Running the Integration Tests
The project includes an integration test that sets up a simple web server with Robyn to display all chart types.
1. **Navigate to the `integration_tests` directory:**
```bash
cd integration_tests
```
2. **Run the Application:**
Start the web server:
```bash
python app.py
```
3. **View in Browser:**
Open your browser and go to `http://localhost:8080`. You should see a page displaying all the supported chart types.
### Adding New Charts
To add a new chart type or customize an existing one, modify the `app.py` file and create new chart instances there.
### Context Variables
The charts can be dynamically generated with context variables. For example, you can pass a `year` or `month` variable to customize the labels and datasets.
### Integration with Other Web Frameworks
Pychartjs is flexible and can be integrated with other popular Python web frameworks such as:
- **Django**: Easily render charts within Django views and templates.
- **FastAPI**: Use Pychartjs to generate charts in FastAPI routes.
- **Flask**: Integrate with Flask to display dynamic charts.
- **Any other WSGI/ASGI framework**: Pychartjs can be adapted to work with any Python web framework that supports WSGI or ASGI.
Raw data
{
"_id": null,
"home_page": null,
"name": "pychartjs",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Ali Tavallaie",
"author_email": "a.tavallaie@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/13/27/87d0f9d362cd346f1676b2f15d4aee4c6a146474d3c94c5091b3505180eb/pychartjs-1.0.0.tar.gz",
"platform": null,
"description": " # Pychartjs\n\n Pychartjs is a Python library for generating dynamic charts using Chart.js and integrating them into web applications. The library is built on top of the [Trunco](https://github.com/tavallaie/trunco) framework, which provides a component-based architecture to make it easy to create and manage various chart types.\n\n ## Features\n\n - Support for all major chart types: Line, Bar, Pie, Doughnut, Radar, PolarArea, Bubble, and Scatter.\n - Integration with various web frameworks including Robyn, Django, FastAPI, and other Python web frameworks.\n - Dynamic chart rendering with context variables.\n - Flexible and customizable chart options.\n\n ## Project Structure\n\n ```\n pychartjs/\n \u251c\u2500\u2500 pychartjs/\n \u2502 \u251c\u2500\u2500 __init__.py\n \u2502 \u251c\u2500\u2500 charts.py\n \u2502 \u251c\u2500\u2500 datasets.py\n \u2502 \u251c\u2500\u2500 enums.py\n \u2502 \u251c\u2500\u2500 options.py\n \u2502 \u251c\u2500\u2500 scales.py\n \u2502 \u251c\u2500\u2500 plugins.py\n \u2502 \u251c\u2500\u2500 colors.py\n \u251c\u2500\u2500 tests/\n \u2502 \u251c\u2500\u2500 test_charts.py\n \u2502 \u251c\u2500\u2500 test_datasets.py\n \u2502 \u251c\u2500\u2500 test_options.py\n \u2502 \u251c\u2500\u2500 test_scales.py\n \u2502 \u251c\u2500\u2500 test_plugins.py\n \u2502 \u251c\u2500\u2500 test_colors.py\n \u251c\u2500\u2500 integration_tests/\n \u2502 \u251c\u2500\u2500 app.py\n \u2502 \u2514\u2500\u2500 templates/\n \u2502 \u2514\u2500\u2500 index.html\n \u251c\u2500\u2500 LICENSE\n \u251c\u2500\u2500 README.md\n \u251c\u2500\u2500 poetry.lock\n \u2514\u2500\u2500 pyproject.toml\n ```\n\n - **`pychartjs/`**: Contains the core library code, including charts, datasets, enums, options, and scales.\n - **`tests/`**: Unit tests for the various components of the library.\n - **`integration_tests/`**: A sample application that demonstrates how to integrate `pychartjs` with a web framework like Robyn.\n\n ## Installation\n\n 1. **Install with Poetry:**\n\n If you are using Poetry for dependency management, you can add `pychartjs` to your project with:\n\n ```bash\n poetry add pychartjs\n ```\n\n 2. **Alternatively, install with pip:**\n\n If you're using pip, you can install `pychartjs` with:\n\n ```bash\n pip install pychartjs\n ```\n\n ## Usage\n\n ### Running the Integration Tests\n\n The project includes an integration test that sets up a simple web server with Robyn to display all chart types.\n\n 1. **Navigate to the `integration_tests` directory:**\n\n ```bash\n cd integration_tests\n ```\n\n 2. **Run the Application:**\n\n Start the web server:\n\n ```bash\n python app.py\n ```\n\n 3. **View in Browser:**\n\n Open your browser and go to `http://localhost:8080`. You should see a page displaying all the supported chart types.\n\n ### Adding New Charts\n\n To add a new chart type or customize an existing one, modify the `app.py` file and create new chart instances there.\n\n ### Context Variables\n\n The charts can be dynamically generated with context variables. For example, you can pass a `year` or `month` variable to customize the labels and datasets.\n\n ### Integration with Other Web Frameworks\n\n Pychartjs is flexible and can be integrated with other popular Python web frameworks such as:\n\n - **Django**: Easily render charts within Django views and templates.\n - **FastAPI**: Use Pychartjs to generate charts in FastAPI routes.\n - **Flask**: Integrate with Flask to display dynamic charts.\n - **Any other WSGI/ASGI framework**: Pychartjs can be adapted to work with any Python web framework that supports WSGI or ASGI.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "git@github.com:tavallaie/pychartjs.git",
"version": "1.0.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8a6755480ad73ebfd5e7441e1eb737902884ab27fb3c49a04576b4b698885fa9",
"md5": "41c59e6107e792e6020b0b5df0872a7f",
"sha256": "70e2e6395fb9973bbacade9cc6b9d3fe4377f3731a331962683690b3f04bb3fd"
},
"downloads": -1,
"filename": "pychartjs-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "41c59e6107e792e6020b0b5df0872a7f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 8257,
"upload_time": "2024-08-19T00:33:49",
"upload_time_iso_8601": "2024-08-19T00:33:49.030798Z",
"url": "https://files.pythonhosted.org/packages/8a/67/55480ad73ebfd5e7441e1eb737902884ab27fb3c49a04576b4b698885fa9/pychartjs-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "132787d0f9d362cd346f1676b2f15d4aee4c6a146474d3c94c5091b3505180eb",
"md5": "189675938e9aecde1a6507334111dcfe",
"sha256": "e797607db47ddf983a5b19b510d39c10bef376dfa0dac5332dfe1c4c2112176e"
},
"downloads": -1,
"filename": "pychartjs-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "189675938e9aecde1a6507334111dcfe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 7387,
"upload_time": "2024-08-19T00:33:51",
"upload_time_iso_8601": "2024-08-19T00:33:51.118074Z",
"url": "https://files.pythonhosted.org/packages/13/27/87d0f9d362cd346f1676b2f15d4aee4c6a146474d3c94c5091b3505180eb/pychartjs-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-19 00:33:51",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pychartjs"
}