Skip to content

delimitry/aztec_code_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aztec Code generator

Aztec Code generator in Python

Dependencies:

PIL - Python Imaging Library (or Pillow)

Usage:

This code will generate an image file "aztec_code.png" with the Aztec Code that contains "Aztec Code 2D :)" text:

data = 'Aztec Code 2D :)'
aztec_code = AztecCode(data)
aztec_code.save('aztec_code.png', module_size=4)

Aztec Code

The generator supports SVG images, but without the upper text. In this case the module_size parameter has no effect and can be ommited, as the SVG images are scalable without loss of quality:

aztec_code = AztecCode('the data to store')
aztec_code.save('aztec_code.svg')

This code will print out resulting 19x19 (compact) Aztec Code to the standard output:

data = 'Aztec Code 2D :)'
aztec_code = AztecCode(data)
aztec_code.print_out()
      ##  # ## ####
 #   ## #####  ### 
 #  ##  # #   # ###
## #  #    ## ##   
    ## # #    # #  
## ############ # #
 ### #       ###  #
##   # ##### # ## #
 #   # #   # ##    
 # # # # # # ###   
    ## #   # ## ## 
#### # ##### ## #  
  # ##       ## ## 
 ##  ########### # 
  ##    # ##   ## #
     ## # ### #  ##
      ############ 
##   #     # ##   #
##  #    ## ###   #

License:

Released under The MIT License.

About

Aztec code generator in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages