# Fast Abstract
Fast Abstract is a high-performance implementation of abstract base classes for Python, designed with optimized checks and minimal overhead. Created by Michael Avina, this module offers a lightweight solution for developers who want to leverage abstract classes without the additional overhead of Python's built-in `abc` module.
## Why?
I wanted a lightweight, high-performance alternative to Python's `abc` module that still provides the essential functionality of abstract base classes. Fast Abstract is perfect for applications that require speed and minimal overhead while still enforcing interface contracts within your Python code.
## Features
- **Optimized for Performance**: Fast Abstract uses tuples and avoids dynamic checks wherever possible to minimize runtime overhead.
- **Lightweight**: The module is small, simple, and easy to integrate into any Python project.
- **Flexible Enforcement Levels**: Allows you to specify enforcement levels ('error', 'warning', 'none') for abstract method checks.
## Installation
You can install Fast Abstract using `pip`
## Usage
```python
from fast_abstract import FastAbstract, abstractmethod, abstractproperty
class MyBase(FastAbstract):
@abstractmethod
def method(self):
pass
@abstractproperty
def my_property(self):
"""Abstract property example."""
pass
@abstractmethod
def abstract_another_method(self):
"""Abstract method example with prefix 'abstract_'."""
pass
class ConcreteClass(MyBase):
def method(self):
print("Method implemented in ConcreteClass")
@property
def my_property(self):
return "Property implemented in ConcreteClass"
def abstract_another_method(self):
print("Abstract method with prefix implemented")
obj = ConcreteClass()
obj.method() # This will print: Method implemented in ConcreteClass
print(obj.my_property) # This will print: Property implemented in ConcreteClass
obj.abstract_another_method() # This will print: Abstract method with prefix implemented
### 5. `LICENSE` File
The license remains the same:
#### `LICENSE`
```plaintext
MIT License
MIT License
Copyright (c) 2024 Michael Avina
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
SOFTWARE.
Raw data
{
"_id": null,
"home_page": "https://github.com/mavin2009/fast_abstract",
"name": "fast-abstract",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Michael Avina",
"author_email": "a.v.i.na.m@gm-ail.com",
"download_url": "https://files.pythonhosted.org/packages/c3/92/a56568489224a2db784c446c87cb4d9b88f25aec707a1ab18b3e1580a459/fast_abstract-0.1.0.tar.gz",
"platform": null,
"description": "# Fast Abstract\n\nFast Abstract is a high-performance implementation of abstract base classes for Python, designed with optimized checks and minimal overhead. Created by Michael Avina, this module offers a lightweight solution for developers who want to leverage abstract classes without the additional overhead of Python's built-in `abc` module.\n\n## Why?\n\nI wanted a lightweight, high-performance alternative to Python's `abc` module that still provides the essential functionality of abstract base classes. Fast Abstract is perfect for applications that require speed and minimal overhead while still enforcing interface contracts within your Python code.\n\n## Features\n\n- **Optimized for Performance**: Fast Abstract uses tuples and avoids dynamic checks wherever possible to minimize runtime overhead.\n- **Lightweight**: The module is small, simple, and easy to integrate into any Python project.\n- **Flexible Enforcement Levels**: Allows you to specify enforcement levels ('error', 'warning', 'none') for abstract method checks.\n\n\n## Installation\n\nYou can install Fast Abstract using `pip`\n\n## Usage\n\n```python\nfrom fast_abstract import FastAbstract, abstractmethod, abstractproperty\n\nclass MyBase(FastAbstract):\n @abstractmethod\n def method(self):\n pass\n \n @abstractproperty\n def my_property(self):\n \"\"\"Abstract property example.\"\"\"\n pass\n\n @abstractmethod\n def abstract_another_method(self):\n \"\"\"Abstract method example with prefix 'abstract_'.\"\"\"\n pass\n\nclass ConcreteClass(MyBase):\n def method(self):\n print(\"Method implemented in ConcreteClass\")\n\n @property\n def my_property(self):\n return \"Property implemented in ConcreteClass\"\n\n def abstract_another_method(self):\n print(\"Abstract method with prefix implemented\")\n\nobj = ConcreteClass()\nobj.method() # This will print: Method implemented in ConcreteClass\nprint(obj.my_property) # This will print: Property implemented in ConcreteClass\nobj.abstract_another_method() # This will print: Abstract method with prefix implemented\n\n### 5. `LICENSE` File\n\nThe license remains the same:\n\n#### `LICENSE`\n\n```plaintext\nMIT License\n\nMIT License\n\nCopyright (c) 2024 Michael Avina\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A high-performance abstract base class implementation for Python",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/mavin2009/fast_abstract"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d8be838b85bdbed0c321852d26f6d26d1c4d7ec106b261bbb0f280373073a5f3",
"md5": "b2f0deaf4cbd348e2c98543770ea70e8",
"sha256": "952bc7763ffbb313f58dadd9a4ee3d640a0d739197175aab9cbd88b2237cf146"
},
"downloads": -1,
"filename": "fast_abstract-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b2f0deaf4cbd348e2c98543770ea70e8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 3902,
"upload_time": "2024-08-27T04:01:15",
"upload_time_iso_8601": "2024-08-27T04:01:15.761576Z",
"url": "https://files.pythonhosted.org/packages/d8/be/838b85bdbed0c321852d26f6d26d1c4d7ec106b261bbb0f280373073a5f3/fast_abstract-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c392a56568489224a2db784c446c87cb4d9b88f25aec707a1ab18b3e1580a459",
"md5": "e22b73d54806321b366d2f10691ec98f",
"sha256": "3509e82ee4b5b59192fc0c282ba6b03ead9e351d1c2a6289a9a2de56633cc495"
},
"downloads": -1,
"filename": "fast_abstract-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "e22b73d54806321b366d2f10691ec98f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3886,
"upload_time": "2024-08-27T04:01:17",
"upload_time_iso_8601": "2024-08-27T04:01:17.554772Z",
"url": "https://files.pythonhosted.org/packages/c3/92/a56568489224a2db784c446c87cb4d9b88f25aec707a1ab18b3e1580a459/fast_abstract-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-27 04:01:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mavin2009",
"github_project": "fast_abstract",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fast-abstract"
}