Running a test to ensure actual/expected trait distributions line up, with a sample of 9,000 addresses:
$ python generate_traits.py test
trait_type value expected actual
0 Color 1 Blue 0.2 0.200889
1 Color 1 Red 0.5 0.498222
2 Color 1 Green 0.3 0.300889
3 Color 2 Blue 0.1 0.098667
4 Color 2 Red 0.1 0.104889
5 Color 2 Green 0.8 0.796444
6 Color 3 Blue 0.6 0.597556
7 Color 3 Red 0.2 0.197444
8 Color 3 Green 0.2 0.205000
9 Color 4 Maroon 0.7 0.700000
10 Color 4 Turquoise 0.1 0.100556
11 Color 4 Chartreuse 0.2 0.199444
Example use
Generating traits from an address (we hash the address, so any string should be supported — it is not restricted to a specific format):
Specification file example:
Running a test to ensure actual/expected trait distributions line up, with a sample of 9,000 addresses: