knittingpattern
Module¶
The knitting pattern module.
Load and convert knitting patterns using the convinience functions lited below.
-
knittingpattern.
load_from_object
(object_)[source]¶ Load a knitting pattern from an object.
Return type: knittingpattern.KnittingPatternSet.KnittingPatternSet
-
knittingpattern.
load_from_string
(string)[source]¶ Load a knitting pattern from a string.
Return type: knittingpattern.KnittingPatternSet.KnittingPatternSet
-
knittingpattern.
load_from_file
(file)[source]¶ Load a knitting pattern from a file-like object.
Return type: knittingpattern.KnittingPatternSet.KnittingPatternSet
-
knittingpattern.
load_from_path
(path)[source]¶ Load a knitting pattern from a file behind located at path.
Return type: knittingpattern.KnittingPatternSet.KnittingPatternSet
-
knittingpattern.
load_from_url
(url)[source]¶ Load a knitting pattern from a url.
Return type: knittingpattern.KnittingPatternSet.KnittingPatternSet
-
knittingpattern.
load_from_relative_file
(module, path_relative_to)[source]¶ Load a knitting pattern from a path relative to a module.
Parameters: Return type:
-
knittingpattern.
convert_from_image
(colors=('white', 'black'))[source]¶ Convert and image to a knitting pattern.
Returns: a loader Return type: knittingpattern.Loader.PathLoader Parameters: colors¶ (tuple) – the colors to convert to convert_from_image().path("pattern.png").path("pattern.json") convert_from_image().path("pattern.png").knitting_pattern()
See also
knittingoattern.convert.image_to_knitting_pattern
-
knittingpattern.
load_from
()[source]¶ Create a loader to load knitting patterns with.
Returns: the loader to load objects with Return type: knittingpattern.Loader.JSONLoader Example:
import knittingpattern, webbrowser k = knittingpattern.load_from().example("Cafe.json") webbrowser.open(k.to_svg(25).temporary_path(".svg"))
-
knittingpattern.
new_knitting_pattern
(id_, name=None)[source]¶ Create a new knitting pattern.
Returns: a new empty knitting pattern.
Parameters: Return type: See also
-
knittingpattern.
new_knitting_pattern_set
()[source]¶ Create a new, empty knitting pattern set.
Return type: knittingpattern.KnittingPatternSet.KnittingPatternSet Returns: a new, empty knitting pattern set