KnittingPattern Module

Here you can find the set of knit instructions in rows.

A knitting pattern set consists of several KnittingPatterns. Their functionality can be found in this module.

class knittingpattern.KnittingPattern.KnittingPattern(id_, name, rows, parser)[source]

Bases: object

Knitting patterns contain a set of instructions that form a pattern.

Usually you do not create instances of this but rather load a knitting pattern set.

__init__(id_, name, rows, parser)[source]

Create a new instance.

  • id_ – the id of this pattern
  • name – the human readable name of this pattern
  • rows – a collection of rows of instructions
  • parser (knittingpattern.Parser.Parser) – the parser to use to new content

list of weak references to the object (if defined)


Add a new row to the pattern.

Parameters:id_ – the id of the row

the identifier within a set of knitting patterns


The colors of the instructions.

Returns:the colors of the instructions listed in first appearance in knit order
Return type:list

a human readable name


a collection of rows that this pattern is made of

Usually this should be a knittingpattern.IdCollection.IdCollection of knittingpattern.Row.Row.


Return the rows in the order that they should be knit.

Return type:list
Returns:the rows in the order that they should be knit