A simple Python interface to the OpenPattern library for generating professional sewing patterns. This tool creates standard patterns (Bodice, Skirt, and Trousers) and exports them as PDF files.
OpenPattern is a Python library for generating professional sewing patterns based on established patternmaking techniques by Jacqueline Chiappetta, Theresa Gilewska, and Antonio Donnanno. It provides:
- Professional-grade pattern blocks with accurate drafting
- Support for standard sizing systems (French, Italian)
- Multiple drafting styles from renowned pattern makers
- High-quality pattern generation suitable for professional use
- Python 3.7 or higher
- pip (Python package manager)
- Install the required packages:
pip install -r requirements.txt- Install OpenPattern:
pip install git+https://github.com/fmetivier/OpenPattern.gitRun the main script to generate all three pattern types (Bodice, Skirt, and Trousers):
python generate_patterns.pyThis will create three PDF files in the output/ directory:
bodice_W36G.pdf- Women's bodice (Gilewska style)skirt_W6C.pdf- Women's skirt (Chiappetta style)Donnanno_Basic_Trousers_M44D_FullSize.pdf- Men's trousers (Donnanno style)
You can also run individual pattern examples from the examples/ directory:
python examples/bodice_example.pypython examples/skirt_example.pypython examples/trousers_example.pyYou can import and use the pattern generation functions in your own scripts:
import matplotlib.pyplot as plt
import OpenPattern as OP
# Create a women's bodice pattern
p = OP.Basic_Bodice(
pname="W36G",
gender='w',
style='Gilewska'
)
# Draw and save as PDF
p.draw()
plt.savefig('my_bodice.pdf', format='pdf', bbox_inches='tight')
plt.show()- Style: Gilewska
- Parameters: pname, gender, style
- Example:
OP.Basic_Bodice(pname="W36G", gender='w', style='Gilewska')
- Style: Chiappetta
- Parameters: pname, gender, style, ease, curves
- Example:
OP.Basic_Skirt(pname="W6C", gender='G', style='Chiappetta', ease=8, curves=False) - Note: Skirt patterns use
gender='G'(general/women) and simpler pattern names like "W6C" instead of "W36C"
- Style: Donnanno
- Parameters: pname, gender, style, darts
- Example:
OP.Basic_Trousers(pname="M44D", gender='m', style='Donnanno', darts=True)
Pattern names follow the OpenPattern convention:
- First letter: Gender ('W' for women, 'M' for men)
- Number: Size (e.g., 36, 38, 40, 44)
- Last letter: Style initial (G=Gilewska, C=Chiappetta, D=Donnanno)
Examples:
W36G- Women's size 36, Gilewska styleW40C- Women's size 40, Chiappetta styleM44D- Men's size 44, Donnanno style
You can customize patterns by modifying parameters:
# Women's bodice with different size
p = OP.Basic_Bodice(pname="W40G", gender='w', style='Gilewska')
# Skirt with more ease
p = OP.Basic_Skirt(pname="W6C", gender='G', style='Chiappetta', ease=10, curves=True)
# Women's trousers
trousers = OP.Basic_Trousers(pname="W38D", gender='w', style='Donnanno', darts=True)All patterns are saved as PDF files that can be:
- Viewed on screen
- Printed at full scale for pattern making
- Edited with PDF software if needed
The patterns include professional-grade details like:
- Accurate pattern pieces
- Proper seam allowances
- Grainlines and notches
- Pattern labels
The examples/ directory contains individual scripts for each pattern type:
bodice_example.py- Basic bodice patternskirt_example.py- Basic skirt patterntrousers_example.py- Basic trousers pattern
See the examples/README.md for more details.
If you get an error about OpenPattern not being installed:
pip install git+https://github.com/fmetivier/OpenPattern.gitIf patterns don't display properly, make sure you have a display configured. On headless systems, use:
import matplotlib
matplotlib.use('Agg') # Use non-interactive backendThis project is open source and available under the MIT License.
- OpenPattern library by François Métivier
- Pattern drafting methods by Jacqueline Chiappetta, Theresa Gilewska, and Antonio Donnanno