__init__.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. from __future__ import absolute_import, division, print_function
  2. import sys
  3. from functools import partial
  4. from . import converters, exceptions, filters, setters, validators
  5. from ._cmp import cmp_using
  6. from ._config import get_run_validators, set_run_validators
  7. from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
  8. from ._make import (
  9. NOTHING,
  10. Attribute,
  11. Factory,
  12. attrib,
  13. attrs,
  14. fields,
  15. fields_dict,
  16. make_class,
  17. validate,
  18. )
  19. from ._version_info import VersionInfo
  20. __version__ = "21.2.0"
  21. __version_info__ = VersionInfo._from_version_string(__version__)
  22. __title__ = "attrs"
  23. __description__ = "Classes Without Boilerplate"
  24. __url__ = "https://www.attrs.org/"
  25. __uri__ = __url__
  26. __doc__ = __description__ + " <" + __uri__ + ">"
  27. __author__ = "Hynek Schlawack"
  28. __email__ = "hs@ox.cx"
  29. __license__ = "MIT"
  30. __copyright__ = "Copyright (c) 2015 Hynek Schlawack"
  31. s = attributes = attrs
  32. ib = attr = attrib
  33. dataclass = partial(attrs, auto_attribs=True) # happy Easter ;)
  34. __all__ = [
  35. "Attribute",
  36. "Factory",
  37. "NOTHING",
  38. "asdict",
  39. "assoc",
  40. "astuple",
  41. "attr",
  42. "attrib",
  43. "attributes",
  44. "attrs",
  45. "cmp_using",
  46. "converters",
  47. "evolve",
  48. "exceptions",
  49. "fields",
  50. "fields_dict",
  51. "filters",
  52. "get_run_validators",
  53. "has",
  54. "ib",
  55. "make_class",
  56. "resolve_types",
  57. "s",
  58. "set_run_validators",
  59. "setters",
  60. "validate",
  61. "validators",
  62. ]
  63. if sys.version_info[:2] >= (3, 6):
  64. from ._next_gen import define, field, frozen, mutable
  65. __all__.extend((define, field, frozen, mutable))