# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['shapeless']

package_data = \
{'': ['*']}

install_requires = \
['pickle']

setup_kwargs = {
    'name': 'shapeless',
    'version': '0.0.7',
    'description': 'Poly - Pytorch',
    'long_description': '[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)\n\n# Poly 💧\n<!-- ![Poly banner](shapeless.png) -->\n\nA Fluid, PolyMorphic,and shapeless Types Package that activates radically flexiblity and simplicity in your programs\n\n[Shapeless Announcement 💧](https://medium.com/@kyeg/embrace-shapelessness-the-design-philosophy-of-the-future-1d530c075789)\n\n-----\n\n## Installation\n\nYou can install the package using pip\n\n```bash\npip install shapeless\n```\n----\n\n# Usage\n\nHere\'s a simple example of how to use the\xa0`Poly`\xa0class:\n\n```python\nfrom shapeless import Poly\n\n# Create a Poly object with an integer\np = Poly(10)\n\n# Determine the type of the data\nprint(p.determine())  # <class \'int\'>\n\n# Shift the data to a string\nprint(p.shift(str))  # \'10\'\n\n# Validate that the data is a string\nprint(p.validate(str))  # True\n```\n\nYou can also use\xa0`Poly`\xa0as a type hint in your functions:\n\n```python\nfrom shapeless import Poly\n\ndef my_func(a: Poly):\n    print(type(a))\n\n# Create a Poly object with a string\np = Poly(\'10\')\n\n# Pass the Poly object to my_func\nmy_func(p)  # <class \'__main__.Poly\'>\n```\n------\n\n# `shapeless` Decorator\nWith the shapeless decorator you can wrap entire classes and transform all their variables into the `Poly` type!\n\n```python\nfrom shapeless import shapeless\n\n@shapeless\nclass SimpleClass:\n    def __init__(self, x, y):\n        self.x = x\n        self.y = y\n\n    def add(self):\n        return self.x + self.y\n    \nsc = SimpleClass(1, 2)\nprint(sc.add())  # prints 3\n\n```\n\n-----\n\n\n# `fluid` Decorator\nFluid is like the `shapeless` decorator but for classes, just wrap it around your function to transform all the variables to the `Poly`\xa0shapeless type.\n\n```python\nfrom shapeless import fluid\n\n@fluid\ndef add(a, b):\n    return a.data + b.data\n\nprint(add(1, 2))\nprint(add("hello", \'world\'))\n\n```\n\n----\n\n# Why use Shapeless?\n\nShapeless is a powerful tool for creating fluid programs because it allows developers to handle data types dynamically and polymorphically. This means that the same class or function can handle different types of data, making the program more flexible and versatile.\n\nShapeless also provides thread safety, which is crucial for multi-threaded applications. This ensures that the data remains consistent and prevents race conditions.\n\nFurthermore, Shapeless provides logging, type aliasing, type annotation, type extension, and serialization and deserialization features. These features make it easier to write, debug, and understand the code, and they allow developers to create more complex and flexible data structures.\n\nIn conclusion, Shapeless is a powerful tool for creating fluid programs that can handle a wide range of data types and that are safe, flexible, and easy to understand.\n\n## Benefits\n\n1.  Dynamic Type Handling\xa0🔄: Poly and Shapeless allow developers to handle data types dynamically. This means that the type of data can be determined, selected, shifted, validated, aliased, annotated, extended, serialized, and deserialized on the fly.\n\n2.  Thread Safety\xa0🔒: Both Poly and Shapeless provide thread safety, which is crucial for multi-threaded applications. This ensures that the data remains consistent and prevents race conditions.\n\n3.  Logging\xa0📝: With the verbose option, all operations can be logged. This is useful for debugging and understanding the flow of data and operations in the program.\n\n4.  Polymorphism\xa0🐾: Poly and Shapeless make it easy to create polymorphic classes and functions. This means that the same class or function can handle different types of data, making the program more flexible and versatile.\n\n5.  Type Aliasing\xa0🏷️: Poly allows developers to add aliases for types. This can make the code more readable and easier to understand.\n\n6.  Type Annotation\xa0🖊️: Poly provides a method to annotate the data with a type. This can be useful for static type checking and for making the code more self-explanatory.\n\n7.  Type Extension\xa0🧩: With Poly, the type of the data can be extended with a new type. This allows developers to create more complex and flexible data structures.\n\n8.  Serialization and Deserialization\xa0💾: Poly provides methods to serialize and deserialize the data. This is useful for saving and loading data, and for sending and receiving data over a network.\n\n\n------\n\n# Documentation\n`Poly` is a utility class that encapsulates dynamic type handling for any data. It provides flexibility and convenience when working with types. With `Poly`, users can determine, select, shift, validate, alias, annotate, extend, serialize, and deserialize data types. The class also ensures thread safety and supports optional logging of operations.\n\n## Class Definition:\n\n```python\nclass Poly(Generic[T]):\n```\n\n### Parameters:\n\n- **data (Any)**: Data whose type is to be managed.\n- **verbose (bool, optional)**: If `True`, operations will be logged. Default is `False`.\n\n## Methods:\n\n### `__init__(self, data: Any, verbose: bool = False)`\n\nInitializes a new instance of `Poly`.\n\n### `determine(self) -> Type`\n\nDetermines the type of the contained data.\n\n**Returns**: \n- **Type** - The type of the data.\n\n### `select(self, target) -> Type`\n\nSelects the type of the data.\n\n**Parameters**:\n- **target**: The target type to select.\n\n**Returns**: \n- **Type** - The selected type.\n\n### `shift(self, target: Type) -> Any`\n\nTries to convert the data to the specified target type.\n\n**Parameters**:\n- **target**: The desired type to convert the data to.\n\n**Returns**: \n- **Any** - The data after conversion.\n\n**Raises**: \n- **TypeError**: If the data cannot be shifted to the target type.\n\n### `validate(self, target: Type) -> bool`\n\nChecks if the data is of the given type.\n\n**Parameters**:\n- **target**: The type to check against.\n\n**Returns**: \n- **bool** - `True` if the data is of the target type, `False` otherwise.\n\n**Raises**:\n- **TypeError**: If the data is not of the target type.\n\n### `add_alias(self, alias: str, target: Type)`\n\nCreates an alias for a specific type.\n\n**Parameters**:\n- **alias**: Alias name.\n- **target**: Target type for which alias is created.\n\n### `annotate(self, annotation: Type)`\n\nProvides a type hint to the data.\n\n**Parameters**:\n- **annotation**: The type hint.\n\n### `extend(self, extension: Type)`\n\nExtends the current type of data with a new type.\n\n**Parameters**:\n- **extension**: The new type to be added to the current type.\n\n### `serialize(self) -> bytes`\n\nConverts the data into its byte representation.\n\n**Returns**: \n- **bytes** - The byte representation of the data.\n\n### `deserialize(self, serialized_data: bytes) -> Any`\n\nConverts byte representation back to its original form.\n\n**Parameters**:\n- **serialized_data**: Byte representation of data.\n\n**Returns**: \n- **Any** - The deserialized data.\n\n### `__instancecheck__(self, instance: Any) -> bool`\n\nChecks if an instance matches the selected type.\n\n**Parameters**:\n- **instance**: The instance to be checked.\n\n**Returns**: \n- **bool** - `True` if the instance matches, otherwise `False`.\n\n## Usage Examples:\n\n### 1. Determining and Selecting Type\n\n```python\nfrom shapeless import Poly\n\ndata = 1234\np = Poly(data, verbose=True)\nprint(p.determine())  # Outputs: <class \'int\'>\nprint(p.select(int))  # Outputs: <class \'int\'>\n```\n\n### 2. Shifting and Validating Type\n\n```python\np.shift(str)\nprint(p.data)  # Outputs: "1234"\np.validate(str)  # Validates if data is of type \'str\'\n```\n\n### 3. Serialization and Deserialization\n\n```python\nserialized_data = p.serialize()\nnew_poly = Poly(0)\nnew_poly.deserialize(serialized_data)\nprint(new_poly.data)  # Outputs: "1234"\n```\n\n## Mathematical Representation:\n\nGiven data `d` and a set of types `T`, `Poly` allows for dynamic conversions and operations on `d` with respect to `T`. If `t` belongs to `T`, operations are possible. If not, errors might be raised.\n\nNote:\nEnsure thread-safety when using `Poly` in multi-threaded environments. Also, it is essential to be aware of potential pitfalls when serializing and deserializing data, especially when security is a concern.\n\n## Additional Information:\n\n- **Thread Safety**: All operations on the `Poly` class are thread-safe, ensuring data consistency and integrity in multi-threaded environments.\n  \n- **Logging**: The `Poly` class has a verbose mode that can be activated upon initialization. This mode logs all operations, which can be helpful for debugging or understanding the sequence of operations applied to the data.\n\n## References:\n\nFor more information on Python\'s dynamic type system, you can refer to the official Python documentation: [Python Types](https://docs.python.org/3/library/types.html)\n\nFor a deeper understanding of generics in Python, consider reading PEP 484: [Type Hints](https://www.python.org/dev/peps/pep-0484/).\n\n-----\n\n# Vision\nIn today\'s world, programming languages are often divided into statically-typed and dynamically-typed. While statically-typed languages provide type safety and performance benefits, they often lack the flexibility and simplicity that dynamically-typed languages offer. This has led to a growing demand for tools that can bring the benefits of both worlds together.\n\nWe believe the future of programming lies in the ability to handle types in a fluid and flexible manner, without sacrificing the benefits of static typing. However, achieving this is not easy. It requires a deep understanding of both static and dynamic typing, as well as the ability to create a tool that is easy to use, performant, and thread-safe.\n\nMany have tried to solve this problem, but none have succeeded. The challenge lies in creating a tool that is both powerful and simple to use. It requires a radical new approach, one that is not constrained by the traditional boundaries of static and dynamic typing.\n\nThat\'s where Poly comes in. Our secret is our deep understanding of the problems with static types. As creators of multi-modality and fluid intelligences with no defined shape, we have the unique insight and expertise needed to solve this problem. We have created a tool that allows you to handle dynamic types in a flexible and thread-safe manner, without sacrificing the benefits of static typing.\n\nWe are confident that Poly is the best solution to this problem. With our unique approach and deep expertise, we are perfectly positioned to bring this vision to life. Join us on this journey and experience the future of programming today.\n\nContribute Now\n\n\n-----\n\n\n# License\nMIT\n\n',
    'author': 'Kye Gomez',
    'author_email': 'kye@apac.ai',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'https://github.com/kyegomez/Poly',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.6,<4.0',
}


setup(**setup_kwargs)
