{ "info": { "author": "Amit Assaraf", "author_email": "soit48@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Build Tools" ], "description": "Lang - Python Language Constraints\n=============================\n\nLang is a Python module that allows enforcing programming language constraints. Lang was built using a Java like mindset, so many of the constraints that are supported are mirrors of constraints in the Java programming language.\n\nFeatures:\n\n - Access Modifiers\n\t - Private & Protected modifiers\n\t - Protect variables, properties, getters and setters\n - Class decorators, Meta classes, Base classes to enforce constraints\n - Interface classes (Only signatures & class members)\n - Abstract classes, methods, properties\n - Final classes (& methods WIP)\n\nExamples:\n--------------\n**Protected/Private members**\n\n*Private variables can only be accessed by the same class while protected variables can also be accessed by subclasses. *\n\n class Box(object):\n\t __metaclass__ = EnforceProtectedMeta\n\t \n\t def __init__(self):\n\t self._cant_touch_this = 7\nor\n \n @enforce_protected\n class Box(object):\n\t \n\t def __init__(self):\n\t self._cant_touch_this = 7\nor\n \n class Box(EnforceProtected):\n\t \n\t def __init__(self):\n\t self._cant_touch_this = 7\nPrivate is that same as protected but exchange 'protected' with 'private'. Private variables are variables that begin with an '\\_' and end with an '\\_', for example: \\_i_am_private_for_this_class\\_\n\n**Protected/Private properties**\n\n class Box(object):\n\t @protected_property\n\t def size(self):\n\t\t ...\n\t\t\n\t\t@size.setter\n\t\tdef size(self, value):\n\t\t\t...\nProtected setter/getter only\n\n class Box(object):\n\t @protected_setter_only\n\t def size(self):\n\t\t ...\n\n\t\t@size.setter\n\t\tdef size(self):\n\t\t\t...\n**Interface Classes**\n\nAn interface is a class that can only implement function signatures and class members.\n\n class IBox(Interface):\n\t # or __metaclass__ = EnforceInterfaceMeta\n\t DEFAULT_HEIGHT = 10\n\t \n\t def size(self):\n\t\t pass\n\t\t \n\t\tdef calculate_volume(self):\n\t\t\tpass\n\t\t\t\nIf a function is implemented that it's source is not only 'pass' then an exception is thrown.\n\n**Abstract Classes**\n\nThis exists already in python (abc module) so I just wrapped it to be in the same package.\n\n class Box(Abstract): \n\t # or __metaclass__ = EnforceAbstractMeta\n\t \n\t @abstract_method\n\t def i_am_abstract(self):\n\t\t ...\n\t\t\n\t\t@abstract_property\n\t\tdef size(self):\n\t\t\t...\n\n**Final Classes**\n\nFinal classes are classes that cannot be subclassed\n\n class TheBestBox(object):\n\t __metaclass__ = FinalClassMeta\n\nInstallation\n----------------\n\nEither install from pip:\n\n pip install lang\n\nor clone the git repo and run:\n\n python setup.py install\n\nLicense\n----------\nThis module is under [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) license. \n\n\nContact Me\n----------------\n\nIf you have any ideas or suggestions or bugs, please do contact me!\n\nLinkedIn: Amit Assaraf\n\nEmail: amit@helpi.me", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/amitassaraf/lang", "keywords": "lang language enforcing protected development", "license": "APACHE", "maintainer": null, "maintainer_email": null, "name": "lang", "package_url": "https://pypi.org/project/lang/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lang/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/amitassaraf/lang" }, "release_url": "https://pypi.org/project/lang/1.0.5/", "requires_dist": null, "requires_python": null, "summary": "Module for enforcing language constraints in Python", "version": "1.0.5" }, "last_serial": 1895240, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "26746639acf146f7bbd39057c36e990c", "sha256": "1d75fb7cdc3cbae7ec59a77eff1c2e56cd562995298b0160352683b4dc7d2540" }, "downloads": -1, "filename": "lang-1.0.3.tar.gz", "has_sig": false, "md5_digest": "26746639acf146f7bbd39057c36e990c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5839, "upload_time": "2016-01-08T16:20:59", "url": "https://files.pythonhosted.org/packages/95/96/55ac6b6c858fd34ce7943f6a207e02a21b8be5d7b8b3ca5ae087341de890/lang-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "a0a96cf626356f23e35cbb8538083a52", "sha256": "36473d9205a3bd88b5b9d2e2b888c77a7232a55b7e2d667d2b062e3c0b5e8123" }, "downloads": -1, "filename": "lang-1.0.4.tar.gz", "has_sig": false, "md5_digest": "a0a96cf626356f23e35cbb8538083a52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5684, "upload_time": "2016-01-08T16:26:53", "url": "https://files.pythonhosted.org/packages/3d/be/266619c1db24a170e472c6e7055aede52e8636b483e52f87f243f64fa6d7/lang-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "193504841037e7b7be6e20124cd615a6", "sha256": "6481a91ccd6417bec4a4aab7bb803e10412d41db636ebbf010f7e87670e062a5" }, "downloads": -1, "filename": "lang-1.0.5.tar.gz", "has_sig": false, "md5_digest": "193504841037e7b7be6e20124cd615a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5692, "upload_time": "2016-01-08T16:35:04", "url": "https://files.pythonhosted.org/packages/2f/aa/73a380e9eba91c8f836404b0d0ee895c71712a6e717e0be54c928713000a/lang-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "193504841037e7b7be6e20124cd615a6", "sha256": "6481a91ccd6417bec4a4aab7bb803e10412d41db636ebbf010f7e87670e062a5" }, "downloads": -1, "filename": "lang-1.0.5.tar.gz", "has_sig": false, "md5_digest": "193504841037e7b7be6e20124cd615a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5692, "upload_time": "2016-01-08T16:35:04", "url": "https://files.pythonhosted.org/packages/2f/aa/73a380e9eba91c8f836404b0d0ee895c71712a6e717e0be54c928713000a/lang-1.0.5.tar.gz" } ] }