Name | masterpiece JSON |
Version |
0.1.12
JSON |
| download |
home_page | None |
Summary | Masterpiece framework |
upload_time | 2025-01-12 11:37:48 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License =========== Copyright (c) 2024, Juha Meskanen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
keywords |
object-oriented
plugin
framework
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Masterpiece™
============
Welcome to **Masterpiece™** - Quite a Piece of Work!
----------------------------------------------------
Masterpiece™ is a **Python framework** designed for creating modular, scalable, plugin-aware, multi-threaded, and
object-oriented IoT applications — and even non-IoT applications!
**Note**: While Python's Global Interpreter Lock (GIL) might make multi-threading a challenging topic for some developers,
I trust the Python community will continue to evolve and address these concerns over time.
Goals
-----
The primary goal of Masterpiece™ is to **have fun while learning the Python ecosystem!**
**Please note:** This is an *alpha* release. It is not ready for production use. Please experiment, explore, and provide feedback, but avoid using it for critical applications!
Design Concepts and Features
----------------------------
- **MQTT Communication**: Enables seamless communication between components using the MQTT protocol, ideal for distributed systems.
- **Pythonic Purity**: Adheres to Python conventions, ensuring idiomatic, readable, and maintainable code.
- **First-Time Excellence**: Designed to be reliable, correct, and efficient from the start—while keeping things fun!
- **Completeness**: A minimal yet robust API that gives developers total control over all aspects of their applications.
- **Productivity**: Highly modular and reusable codebase to achieve maximum functionality with minimal effort. Productivity grows with the size of the project.
- **Proper Abstraction**: Provides clean abstractions for essential third-party libraries, shielding application code from underlying framework changes.
- **User Interface/Time Series Support**: Leverages InfluxDB V3 for time-series databases, enabling seamless integration with third-party visualization tools like Grafana.
Project Status and Current State
--------------------------------
Here’s what’s currently available in Masterpiece™:
- **Absolutely Bug-free Status!**: Just kidding—there are no *known* bugs (so far).
- **Wiki**: The initial Wiki pages are under construction. Visit the `Masterpiece Wiki <https://gitlab.com/juham/masterpiece/-/wikis/home>`_.
- **Tutorial**: A `tutorial <docs/source/tutorial.rst>`_ to help you get started with building your masterpieces.
- **Package Infrastructure**: The Python package setup is finalized, using `pyproject.toml`.
- **Classes**: Existing classes have been finalized and tested in a production environment.
- **Example Application**: A sample application (`examples/myhome.py`) prints out its instance structure when run.
Despite its simplicity, it demonstrates the structure of a typical scalable and fully configurable software.
- **Plugin Projects**: Several plugin examples, such as `masterpiece_plugin`, which adds a "Hello World" greeting to `myhome.py`,
demonstrate minimal yet functional plugin implementations.
- **MQTT API**: Enables communication between all Masterpiece™ objects.
- **InfluxDB V3 Time Series**: Supports writing and reading from time-series databases.
- **Serialization**: Built-in support for JSON serialization, with options to extend to other formats via plugins.
- **...**: And probably more features I’ve forgotten while writing this.
Projects
--------
Masterpiece comes in a set of Python projects:
1. **Masterpiece (core framework)**:
This is the core framework for building plugin-aware, multi-threaded applications. It includes a simple yet
fully functional application to help you get started and serves as a plugin-aware reference application
that can be scaled up to any size.
2. **Masterpiece Plugin (plugin example)**:
This is a basic plugin example that demonstrates how to create third-party plugins for applications built
using Masterpiece. It’s as simple as saying **"Hello, World!"**, literally.
3. **Masterpiece XML Format plugin:**:
Plugin that adds XML serialization format support to Masterpiece.
4. **Masterpiece Yaml Format plugin:**:
Another format plugin. Adds Yaml support to Masterpiece.
5. **Masterpiece Influx:**:
Support for InfluxDB V3 time series database.
6. **Masterpiece Paho MQTT:**:
Support for Paho Mosquitto MQTT.
Installing Masterpiece
----------------------
**Step 1**: Install Masterpiece and run the example application
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To install the core framework:
.. code-block:: bash
pip install masterpiece
Then, navigate to the example folder and run the application:
.. code-block:: bash
python examples/myhome.py
The application will print out its instance hierarchy. This is a simple example application to demonstrate the
basic structure of any multi-threaded, plugin-based, scalable MasterPiece applications.
**Example output**:
.. code-block:: text
home
├─ grid
├─ downstairs
│ └─ kitchen
│ ├─ oven
│ └─ fridge
└─ garage
└─ EV charger
**Step 2**: Install the desired Masterpiece Plugins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To extend the application with the say **masterpiece_plugin**:
.. code-block:: bash
pip install masterpiece_plugin
Run the application again:
.. code-block:: bash
python examples/myhome.py
You'll now see a new object in the instance hierarchy, along with a friendly "Hello, World!" object.
**Example output**:
.. code-block:: text
home
├─ grid
├─ downstairs
│ └─ kitchen
│ ├─ oven
│ └─ fridge
├─ garage
│ └─ EV charger
└─ Hello World - A Plugin
**Step 3**: Configurating
^^^^^^^^^^^^^^^^^^^^^^^^^
The application also demonstrates the usage of startup arguments. Run the application again:
.. code-block:: text
examples/myhome.py --init --solar 10 --color red
and new 'Solar plant 10 kW' object appears in the tree.
- The ``--init`` argument tells the application to save its current configuration to a configuration files.
- The ``--solar`` argument creates an instance of a solar power plant with a specified peak power of 10 kW.
- The ``--color`` argument can be used for setting the color for the tree diagram.
The above class properties (and many more) can also be defined in the class configuration files. By default,
the configuration files are created in the ``~/.myhome/config`` folder, as determined by the ``application identifier``
and ``--config [anyname]``.
For example, ``--config temp`` will use the configuration files stored in the ``~/.myhome/temp/``
folder.
What's next
-----------
Congratulations! You've successfully installed Masterpiece, extended it with a plugin, and explored its configuration system.
But what is all this for?
That part is up to your imagination. Here's what you can explore next:
- Write Plugins: Develop your own plugins to extend Masterpiece with domain-specific functionality.
Use the masterpiece_plugin as a starting point for inspiration.
- Leverage Configurations: Take advantage of configuration files to fine-tune your application's behavior
without changing the code. Experiment with the --config argument to manage multiple configurations for
different scenarios.
- Design a Custom Application: Build a unique application that fits your needs by combining existing plugins,
creating new objects in the instance hierarchy, and integrating external services or data sources.
- Contribute to the Community: Share your plugins or improvements with the Masterpiece community.
Masterpiece provides the building blocks. Where you go from here is entirely up to you. Happy coding!
Contributing
------------
Please check out the `Masterpiece Issue Board <https://gitlab.com/juham/masterpiece/-/boards>`_ for tracking progress
and tasks.
Developer Documentation
-----------------------
For full documentation and usage details, see the full documentation at `Documentation Index <docs/build/html/index.html>`_
(The docs may look rough; I’m still unraveling Sphinx's mysteries).
Special Thanks
--------------
Big thanks to the generous support of [Mahi.fi](https://mahi.fi) for helping bring this framework to life.
Raw data
{
"_id": null,
"home_page": null,
"name": "masterpiece",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "\"J. Meskanen\" <juham.api@gmail.com>",
"keywords": "object-oriented, plugin, framework",
"author": null,
"author_email": "J Meskanen <juham.api@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ef/95/fa7a953a6f22e8a06e579030bbbaac57458495359bc5f0b8b597eba64ae9/masterpiece-0.1.12.tar.gz",
"platform": null,
"description": "Masterpiece\u2122\n============\n\nWelcome to **Masterpiece\u2122** - Quite a Piece of Work!\n----------------------------------------------------\n\nMasterpiece\u2122 is a **Python framework** designed for creating modular, scalable, plugin-aware, multi-threaded, and \nobject-oriented IoT applications \u2014 and even non-IoT applications!\n\n**Note**: While Python's Global Interpreter Lock (GIL) might make multi-threading a challenging topic for some developers, \nI trust the Python community will continue to evolve and address these concerns over time.\n\n\nGoals\n-----\n\nThe primary goal of Masterpiece\u2122 is to **have fun while learning the Python ecosystem!**\n\n**Please note:** This is an *alpha* release. It is not ready for production use. Please experiment, explore, and provide feedback, but avoid using it for critical applications!\n\nDesign Concepts and Features\n----------------------------\n\n- **MQTT Communication**: Enables seamless communication between components using the MQTT protocol, ideal for distributed systems.\n- **Pythonic Purity**: Adheres to Python conventions, ensuring idiomatic, readable, and maintainable code.\n- **First-Time Excellence**: Designed to be reliable, correct, and efficient from the start\u2014while keeping things fun!\n- **Completeness**: A minimal yet robust API that gives developers total control over all aspects of their applications.\n- **Productivity**: Highly modular and reusable codebase to achieve maximum functionality with minimal effort. Productivity grows with the size of the project.\n- **Proper Abstraction**: Provides clean abstractions for essential third-party libraries, shielding application code from underlying framework changes.\n- **User Interface/Time Series Support**: Leverages InfluxDB V3 for time-series databases, enabling seamless integration with third-party visualization tools like Grafana.\n\n \nProject Status and Current State\n--------------------------------\n\nHere\u2019s what\u2019s currently available in Masterpiece\u2122:\n\n- **Absolutely Bug-free Status!**: Just kidding\u2014there are no *known* bugs (so far).\n- **Wiki**: The initial Wiki pages are under construction. Visit the `Masterpiece Wiki <https://gitlab.com/juham/masterpiece/-/wikis/home>`_.\n- **Tutorial**: A `tutorial <docs/source/tutorial.rst>`_ to help you get started with building your masterpieces.\n- **Package Infrastructure**: The Python package setup is finalized, using `pyproject.toml`.\n- **Classes**: Existing classes have been finalized and tested in a production environment.\n- **Example Application**: A sample application (`examples/myhome.py`) prints out its instance structure when run. \n Despite its simplicity, it demonstrates the structure of a typical scalable and fully configurable software.\n- **Plugin Projects**: Several plugin examples, such as `masterpiece_plugin`, which adds a \"Hello World\" greeting to `myhome.py`, \n demonstrate minimal yet functional plugin implementations.\n- **MQTT API**: Enables communication between all Masterpiece\u2122 objects.\n- **InfluxDB V3 Time Series**: Supports writing and reading from time-series databases.\n- **Serialization**: Built-in support for JSON serialization, with options to extend to other formats via plugins.\n- **...**: And probably more features I\u2019ve forgotten while writing this.\n\n\n\nProjects\n--------\n\nMasterpiece comes in a set of Python projects:\n\n1. **Masterpiece (core framework)**:\n\n This is the core framework for building plugin-aware, multi-threaded applications. It includes a simple yet \n fully functional application to help you get started and serves as a plugin-aware reference application \n that can be scaled up to any size.\n\n2. **Masterpiece Plugin (plugin example)**:\n\n This is a basic plugin example that demonstrates how to create third-party plugins for applications built \n using Masterpiece. It\u2019s as simple as saying **\"Hello, World!\"**, literally.\n\n3. **Masterpiece XML Format plugin:**:\n\n Plugin that adds XML serialization format support to Masterpiece. \n\n4. **Masterpiece Yaml Format plugin:**:\n\n Another format plugin. Adds Yaml support to Masterpiece.\n\n5. **Masterpiece Influx:**:\n\n Support for InfluxDB V3 time series database.\n\n6. **Masterpiece Paho MQTT:**:\n\n Support for Paho Mosquitto MQTT.\n\n\n\n\n\nInstalling Masterpiece\n----------------------\n\n**Step 1**: Install Masterpiece and run the example application\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo install the core framework:\n\n.. code-block:: bash\n\n pip install masterpiece\n\nThen, navigate to the example folder and run the application:\n\n.. code-block:: bash\n\n python examples/myhome.py\n\nThe application will print out its instance hierarchy. This is a simple example application to demonstrate the\nbasic structure of any multi-threaded, plugin-based, scalable MasterPiece applications.\n\n**Example output**:\n\n.. code-block:: text\n\n home\n \u251c\u2500 grid\n \u251c\u2500 downstairs\n \u2502 \u2514\u2500 kitchen\n \u2502 \u251c\u2500 oven\n \u2502 \u2514\u2500 fridge\n \u2514\u2500 garage\n \u2514\u2500 EV charger\n\n\n**Step 2**: Install the desired Masterpiece Plugins\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo extend the application with the say **masterpiece_plugin**:\n\n.. code-block:: bash\n\n pip install masterpiece_plugin\n\nRun the application again:\n\n.. code-block:: bash\n\n python examples/myhome.py\n\nYou'll now see a new object in the instance hierarchy, along with a friendly \"Hello, World!\" object.\n\n**Example output**:\n\n.. code-block:: text\n\n home\n \u251c\u2500 grid\n \u251c\u2500 downstairs\n \u2502 \u2514\u2500 kitchen\n \u2502 \u251c\u2500 oven\n \u2502 \u2514\u2500 fridge\n \u251c\u2500 garage\n \u2502 \u2514\u2500 EV charger\n \u2514\u2500 Hello World - A Plugin\n\n\n**Step 3**: Configurating\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe application also demonstrates the usage of startup arguments. Run the application again:\n\n.. code-block:: text\n\n examples/myhome.py --init --solar 10 --color red\n\nand new 'Solar plant 10 kW' object appears in the tree.\n\n- The ``--init`` argument tells the application to save its current configuration to a configuration files. \n- The ``--solar`` argument creates an instance of a solar power plant with a specified peak power of 10 kW.\n- The ``--color`` argument can be used for setting the color for the tree diagram.\n\nThe above class properties (and many more) can also be defined in the class configuration files. By default, \nthe configuration files are created in the ``~/.myhome/config`` folder, as determined by the ``application identifier`` \nand ``--config [anyname]``.\n\nFor example, ``--config temp`` will use the configuration files stored in the ``~/.myhome/temp/`` \nfolder.\n\n\nWhat's next\n-----------\n\nCongratulations! You've successfully installed Masterpiece, extended it with a plugin, and explored its configuration system. \nBut what is all this for? \n\nThat part is up to your imagination. Here's what you can explore next:\n\n- Write Plugins: Develop your own plugins to extend Masterpiece with domain-specific functionality.\n Use the masterpiece_plugin as a starting point for inspiration.\n\n- Leverage Configurations: Take advantage of configuration files to fine-tune your application's behavior \n without changing the code. Experiment with the --config argument to manage multiple configurations for \n different scenarios.\n\n- Design a Custom Application: Build a unique application that fits your needs by combining existing plugins, \n creating new objects in the instance hierarchy, and integrating external services or data sources.\n\n- Contribute to the Community: Share your plugins or improvements with the Masterpiece community. \n\nMasterpiece provides the building blocks. Where you go from here is entirely up to you. Happy coding!\n\n\nContributing\n------------\n\nPlease check out the `Masterpiece Issue Board <https://gitlab.com/juham/masterpiece/-/boards>`_ for tracking progress \nand tasks.\n\n\nDeveloper Documentation\n-----------------------\n\nFor full documentation and usage details, see the full documentation at `Documentation Index <docs/build/html/index.html>`_ \n(The docs may look rough; I\u2019m still unraveling Sphinx's mysteries).\n\n\nSpecial Thanks\n--------------\n\nBig thanks to the generous support of [Mahi.fi](https://mahi.fi) for helping bring this framework to life.\n",
"bugtrack_url": null,
"license": "MIT License =========== Copyright (c) 2024, Juha Meskanen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ",
"summary": "Masterpiece framework",
"version": "0.1.12",
"project_urls": {
"Bug Reports": "https://gitlab.com/juham/masterpiece",
"Homepage": "https://gitlab.com/juham/masterpiece",
"Say Thanks!": "http://meskanen.com",
"Source": "https://gitlab.com/juham/masterpiece"
},
"split_keywords": [
"object-oriented",
" plugin",
" framework"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "546e057971f6af3d5f0e782c678a72ff232bfa8ac1891c6a48992e89f389e871",
"md5": "34d0facee7ef88392eca0d0c5c9db1ba",
"sha256": "37397d2ae00e9130913615e4f561c670dfe7dd0185167b237cd0925573facb5b"
},
"downloads": -1,
"filename": "masterpiece-0.1.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "34d0facee7ef88392eca0d0c5c9db1ba",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 34084,
"upload_time": "2025-01-12T11:37:44",
"upload_time_iso_8601": "2025-01-12T11:37:44.937931Z",
"url": "https://files.pythonhosted.org/packages/54/6e/057971f6af3d5f0e782c678a72ff232bfa8ac1891c6a48992e89f389e871/masterpiece-0.1.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ef95fa7a953a6f22e8a06e579030bbbaac57458495359bc5f0b8b597eba64ae9",
"md5": "bf1f5cab2634202773f6c60c0a761375",
"sha256": "8e7e084c1e44d26a9a72a4681c744780f26d68b8570776d1aca24a8dfe5933c5"
},
"downloads": -1,
"filename": "masterpiece-0.1.12.tar.gz",
"has_sig": false,
"md5_digest": "bf1f5cab2634202773f6c60c0a761375",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 1255788,
"upload_time": "2025-01-12T11:37:48",
"upload_time_iso_8601": "2025-01-12T11:37:48.723160Z",
"url": "https://files.pythonhosted.org/packages/ef/95/fa7a953a6f22e8a06e579030bbbaac57458495359bc5f0b8b597eba64ae9/masterpiece-0.1.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-12 11:37:48",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "juham",
"gitlab_project": "masterpiece",
"lcname": "masterpiece"
}