https://github.com/delimitry/aztec_code_generator
Aztec code generator in Python
https://github.com/delimitry/aztec_code_generator
aztec aztec-code python
Last synced: about 1 month ago
JSON representation
Aztec code generator in Python
- Host: GitHub
- URL: https://github.com/delimitry/aztec_code_generator
- Owner: delimitry
- License: mit
- Created: 2016-08-04T12:57:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-09-16T14:20:36.000Z (over 1 year ago)
- Last Synced: 2024-09-17T17:04:59.566Z (over 1 year ago)
- Topics: aztec, aztec-code, python
- Language: Python
- Size: 24.4 KB
- Stars: 19
- Watchers: 5
- Forks: 20
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```python
data = 'Aztec Code 2D :)'
aztec_code = AztecCode(data)
aztec_code.save('aztec_code.png', module_size=4)
```

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:
```python
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:
```python
data = 'Aztec Code 2D :)'
aztec_code = AztecCode(data)
aztec_code.print_out()
```
```
## # ## ####
# ## ##### ###
# ## # # # ###
## # # ## ##
## # # # #
## ############ # #
### # ### #
## # ##### # ## #
# # # # ##
# # # # # # ###
## # # ## ##
#### # ##### ## #
# ## ## ##
## ########### #
## # ## ## #
## # ### # ##
############
## # # ## #
## # ## ### #
```
## License:
Released under [The MIT License](https://github.com/delimitry/aztec_code_generator/blob/master/LICENSE).