Skip to main content

Convert handweaving files from dtx format (FiberWorks) to wif

Project description

Convert FiberWorks .dtx weaving pattern files to WIF 1.1

This package can also convert WeavePoint .wpo files to WIF 1.1, though without per-fiber thickness or spacing information.

This runs as a command-line script written in Python. See Installation and Usage for instructions.

This package can also read .wif, .dtx, and .wpo files into a standard in-memory model (dtx_to_wif.PatternData). This may be used for writing weaving design or loom driver software.

This software is licensed under the MIT license; see license.text for details.

Installation

Test if you have Python installed by running your terminal application and typing python at the command prompt. If this runs a Python interpreter and the displayed version is at least 3.7, then you are good to go.

If you don't already have Python installed, or your installed version is too old, download the free installer from python.org and run it. Then repeat the test above, to be sure the installation was successful.

Run the following terminal command to install the package:

python -m pip install dtx_to_wif

Watch the output carefully to see where it installs dtx_to_wif and wpo_to_wif (or, on Windows, dtx_to_wif.exe and wpo_to_wif). On Windows these will be buried very deeply.

The code is hosted on github. If you prefer to run from source, download the package, unpack it, cd to the source directory, and run: pip install .. (If you want to work on the software, or try it out without installing it, you can make a local "editable install" from downloaded source using pip install -e .).

Usage

Run your terminal application.

Type the following on macOS or unix:

dtx_to_wif path1 path2 ...  # on macOS or unix

If this fails, specify the path to dtx_to_wif (as shown in the output from python -m pip install), or add its directory to the PATH. Replace "dtx" with "wpo" to convert .wpo files.

On Windows type:

<...path to dtx_to_wif...>dtx_to_wif.exe path1 path2 ...

where <...path to dtx_to_wif...> is the path to the file, as shown in the output from python -m pip install.

Each path argument is the path to a .dtx file or a directory (folder) containing .dtx files. On macOS, if you drag a file or folder from Finder onto your Terminal, the path will be typed for you.

The program will scan each provided directory for files whose names end in ".dtx". This is a recursive search, meaning it looks in all directories inside the provided directory, no matter how deeply nested.

For each ".dtx" file the program finds, it will write a new WIF file in the same directory, with the same name and the ".wif" extension. If such a WIF file already exists, the program will warn you and not replace it. However, if you specify option --overwrite the program will overwrite (replace) existing WIF files.

Specify --help (or -h) to print help.

Terminal Applications

The standard terminal applications are "Terminal" for macOS, and "cmd.exe" for Windows. Other terminal applications are available, but the standard ones are fine.

Use in Other Software

To read a weaving pattern of any supported type, call read_pattern_file (for a file on disk) or read_pattern_data (for data as a string).

To write wif pattern files call write_wif.

WIF Details

Known differences from the WIF files that FiberWorks writes:

  • The default colors and separations for warp and weft may not match (this is just an internal detail; the resulting pattern is the same). This is because I have not figured out the algorithm FiberWorks uses to choose default colors and separations.
  • The date the dtx file was created is not written to the WIF file, since WIF has no standard location for this information. FiberWorks saves it as a comment in the [TEXT] section ("; Creation ...").

Limitations

The WeavePoint .wpo reading code cannot read per-thread thickness or separation data. Due to this limitation I consider wpo_to_wif only marginally useful. The main use case for reading WeavePoint files is to support loom control software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dtx_to_wif-4.1.1.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dtx_to_wif-4.1.1-py3-none-any.whl (82.0 kB view details)

Uploaded Python 3

File details

Details for the file dtx_to_wif-4.1.1.tar.gz.

File metadata

  • Download URL: dtx_to_wif-4.1.1.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for dtx_to_wif-4.1.1.tar.gz
Algorithm Hash digest
SHA256 8bb2186050f42373c3f429fe97a5ea9313fb842d801e8e79973c4d1cf69dddd0
MD5 d2a1586cd1d169cfc93fa251b5aba633
BLAKE2b-256 236fbdaa15538f0b47fd6217da6de9863a6f08b350fe4793c6a7d0cbbdd9d668

See more details on using hashes here.

File details

Details for the file dtx_to_wif-4.1.1-py3-none-any.whl.

File metadata

  • Download URL: dtx_to_wif-4.1.1-py3-none-any.whl
  • Upload date:
  • Size: 82.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for dtx_to_wif-4.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd76ac3d84a60c41b86f49516ba1f075bbb736a659167f27aa30094473e3bead
MD5 4e8b7b2535200ef381bcebf8141ab7ae
BLAKE2b-256 8836d3633deff3d3ebc5938691d4799e26286f0e182353aa7300784f809be56a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page