MakeObj

Powerful Enumeration System
Download

MakeObj Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Joao Bernardo Oliveira
  • Publisher web site:
  • https://github.com/jbvsmo/

MakeObj Tags


MakeObj Description

MakeObj is a Python module, compatible with Python versions 2.6+ and 3.0+, to help developers create powerful enumeration classes that provide support to attributes specific for each element.Using itMakeObj lets you create enumerations with a simple language like that:@obj: RGBColors =: @keys = 'red', 'green', 'blue' @attr: hex = 'ff0000', '00ff00', '0000ff' @attr: is_nice =: @default = False @set => 'blue': TrueThen you can use like this:RGBColors = makeobj.parse(text)if RGBColors.blue.is_nice: print('I like blue')print('The hex value of {0.name} is #{0.hex}'.format(RGBColors.red))If you have simple enums, you can use like this:RGBColors = makeobj.make('RGBColors', )or, with some more data:RGBColors = makeobj.make('RGBColors', {'red': {'hex': 'ff0000'}, 'green': {'hex': '00ff00'}, 'blue': {'hex': '0000ff'}})Product's homepage


MakeObj Related Software