Welcome to Genenga’s documentation!

Contents:

Genenga is generator PDF of Nengajo from address list.

This utility is generate PDF for printing address “Happy new year card”, a.k.a. “Nengajo” in Japanese.

https://secure.travis-ci.org/mkouhei/Genenga.png?branch=master https://coveralls.io/repos/mkouhei/Genenga/badge.png?branch=master https://pypip.in/v/Genenga/badge.png Documentation Status

Requirement

Debian Packages

  • texlive-binaries (>= 2017.20170613.44)
  • texlive-lang-japanese
  • libc-bin
  • python2.7 over or python3.5 over
  • fonts-takao-gothic
  • fonts-takao-mincho
  • make
  • python-pystache or python3-pystache

format of address.csv

address list is CSV. It is syntax is below:

status,PersonLastName,PersonFirstName1,PersonFirstName2,address,address2,address3,PostalCode1,PostalCode2,PostalCode3,PostalCode4,PostalCode5,PostalCode6,PostalCode7

Example

1,子猫,にゃんこ,ねこちゃん,東京都中央区ねこまた町0ー0,,,0,0,0,0,0,0,0
1,猫山,にゃんごろ,,東京都太田区ねこむら町0ー0,キャットマンション101,,0,0,0,0,0,0,0
1,猫村,にゃん太,にゃんこ,東京都新宿区ねこ町0ー0,,,0,0,0,0,0,0,0
0,猫太,ねこのすけ,,東京都三鷹市こねこ町0ー0,,,0,0,0,0,0,0,0
1,猫野,ねこ太,ねこ助,神奈川県横浜市こねこ町0ー0,,,0,0,0,0,0,0,0

Warning

The csv format has changed in v0.5.0. address3 is inserted before PostalCode1.

Flag of address first field

  1. target this year.
  2. next year target but not sent this year.
  3. sent the before last.
  4. remove.

Usage

  1. Update address.csv

    1. Reset last year status.
    2. Update latest status.
  2. convert photo, extractbb photoimage

  3. edit nenga-yoko.tex

  4. make, generate nenga-yoko.pdf, print this pdf

  5. generate atena.pdf, print this:

    $ genenga -t path/to/yourtemplate.mustache address.csv
    

References

genenga.control.

genenga.control.check_existence_dir(dirpath=None)

check directory existence.

Return type:str
Returns:directory path
Parameters:path (str) – directory path
genenga.control.check_existence_files(*args)

check exisitence of files.

Return type:bool
Parameters:path (str) – file path
genenga.control.generate_atena(convt)

generate atena.

Parameters:convt (convert.Convert) – intermediate object for converting address.
genenga.control.generate_atena_tex(template, address_file, outfile_path)

generate atena TeX file.

Parameters:
  • template (str) – template dictionary
  • address_file (str) – address list csv file
  • outfile_path (str) – output TeX file path

genenga.convert.

class genenga.convert.Convert

Bases: object

The intermediate object for converting to Address object.

convert_from_argparse(args)

Convert to artparse.Namespace to Convert object.

set_param(name, value)

set name:value property to convert object.

genenga.convert.atena2dict(atena)

deprecated.

genenga.convert.csv2addr(address_file)

convert csv to address.

genenga.convert.gen_atena(record)

generate atena object.

genenga.address.

class genenga.models.Address(*args, **kwargs)

Bases: object

Address class.

convert_deprecated()

convert deprecated format.

class genenga.models.Atena(person, another_person, postal_code, address)

Bases: object

Atena.

class genenga.models.Person(first_name, last_name='')

Bases: object

Person class.

class genenga.models.PostalCode(postal_code)

Bases: object

The Japanese postal code class.

static parse_postal_code(postal_code)

parse postal code string.

genenga.exceptions.

exception genenga.exceptions.Error

Bases: Exception

Base error class.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception genenga.exceptions.InvalidFormat

Bases: genenga.exceptions.Error

Invalid format.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception genenga.exceptions.NotFound

Bases: genenga.exceptions.Error

not found.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

HISTORY

0.6.0 (2017-01-06)

  • Supports Python 3.5 over.
  • Changes LaTeX template layout.
  • Changes default fonts to Takao Gothic and Takao Mincho.
  • Fixes pylint violatins.

0.5.1 (2016-12-23)

  • Fixes address.mustache template for TeX Live 2016.

0.5.0 (2015-12-31)

  • Changes CSV formats.
  • Supports Python 3.5.

0.4.1 (2015-04-26)

  • Fixes pep8 violations.
  • Fixes pep257 violations.

0.4.0 (2014-07-25)

  • Applied pychecker and pylint, and fixed those violations.
  • Increase code coverage to > 90%.

0.3 (2013-12-23)

  • Change template layout
  • Change “–template-path” option to be requrired
  • Fix a bug: always used a default template instead of a loaded template

0.2 (2012-09-21)

  • suport pystache 0.5.x
  • Refacotroing

0.1 (2011-12-01)

  • First release

Indices and tables