Skip to main content

Python library for automated DXF file marking and manipulation

Project description

SnapMark

SnapMark is a Python-based tool designed to apply customizable markings to DXF files using a flexible sequence logic. It leverages the ezdxf library to manipulate DXF files and supports operations like adding counters, alignment, character scaling, and more.

Features

Automatic DXF file scanning and processing

Flexible character sequencing (e.g., counters, file-based naming, custom patterns)

Text scaling, alignment, and positioning

Modular structure for extending operations

Easy integration into existing workflows

Quick Start

1. Clone the repository:

git clone https://github.com/serg-you-lin/snapmark.git

2. Install the dependencies:

pip install -r requirements.txt

3.Run the example:

python examples/run_example.py

The script will process the sample DXF files located in examples/input/ and save the marked versions to a new folder (e.g., examples/input_Marked/).

Parameters:

Object:

suffix: adding suffix on both new file and new folder.

AddMark operation:

sequence: text put on file. layer: choose layer where put the text min_char/max_char: minimum/maximum heigth of text align: part f file where mark is located ('r'->right, 'l'->left, 'c'->center) start_y: minimum place for text on y axis down to: allowing text toi be smaller if does not fit while min_char.

Sequence:

You can built a fix sequence or concatenate your sequence by file name, folder name, etc.

Other features

CountHoles

ToMark.add_operation(CountHoles(find_circle_by_radius(max_diam=5.2, min_diam=4.8)))

In this example, you can count all holes between 4.8 and 5.2 mm diameter in all files on a folder. Total and partial result.

AddX

ToMark.add_operation(AddX(find_circle_by_radius(min_diam=2, max_diam=15), size=15, delete_hole=True, layer='Marcatura'))

In this example, all holes between 2 and 15 mm will be substituite from a 'X' sign of 15mm, on 'Marcatura' layer. Holes will been deleted.

Project Structure

SnapMark/
│
├── snapmark/                # Main package   ├── snapmark.py          # Main module combining logic   ├── operations/          # Marking operations   ├── sequence/            # Sequence logic   ├── checking/            # Input validation   └── __init__.

License

MIT License — feel free to use, modify, and share with attribution.

Contributions

Pull requests are welcome! If you find issues or have suggestions, please open an issue in the repository.

Author

Federico Sidraschi https://www.linkedin.com/in/federico-sidraschi-059a961b9/

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

snapmark-2.0.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

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

snapmark-2.0.0-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file snapmark-2.0.0.tar.gz.

File metadata

  • Download URL: snapmark-2.0.0.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for snapmark-2.0.0.tar.gz
Algorithm Hash digest
SHA256 711879c4023fdb7d142aaaa8bd935317d13b13665130b5c4405bb59a75f615be
MD5 4f47a0ea2302ef4e84495d3b42b47ea9
BLAKE2b-256 8c5d839fa7fe7463f070bfe811e225d653ba589725ca5525edfa1c115facd371

See more details on using hashes here.

File details

Details for the file snapmark-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: snapmark-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for snapmark-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abe7db1c637f6ca1b2150d83fde245fa60ccd63b592fab85098f0440ce12999c
MD5 b23f05fbee0a757ce7f2ac4209e1dbd2
BLAKE2b-256 12e8e400c565bdef9cba4351546b4927b7d60ad665a0c701817c7686a0c3b6a5

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