dstvparser
dstvparser is a Python library for parsing and analyzing DSTV files commonly used in the structural steel industry.
It allows easy extraction of profile information, detection of inclined cuts, and basic automation of file classification.
Features
- Parse DSTV files and extract profile headers and geometry
- Support both
.ncand.nc1files - Detect inclined cuts on flanges and webs
- Classification and sorting of files based on detected features
- Modular structure: easy to extend or integrate into larger workflows
- Automatic parser selection via Factory (detects
.ncor.nc1)
or you can use a specific parser directly if needed
Clone the repository:
git clone https://github.com/serg-you-lin/dstvparser.git
Requirements
- Python 3.9+
Installation
You can install the package:
pip install dstvparser
Development notes
This project is under active development. Some features related to NC1 profiles are currently incomplete due to the lack of available sample files for proper development and testing. Contributions or example files are welcome to help expand support.
How to Use
Basic example
from dstvparser.parsers.nc_file_parser import NCFileParser
nc_file = "your_file.nc"
parser = NCFileParser(str(nc_file))
profile = parser.parse()
print(profile.get_header())
Example use case: Split Profiles by feature
One common use case is to split NC profiles based on profile type or specific geometric characteristics, such as the presence of holes or inclined cuts.
from dstvparser.parsers.nc_file_parser import NCFileParser
input_folder = "your_folder"
sets_by_type = {}
for file_path in input_folder.glob("*.nc"):
try:
parser = NCFileParser(str(file_path))
profile = parser.parse()
profile_type = profile.code_profile
if profile_type not in sets_by_type:
sets_by_type[profile_type] = []
sets_by_type[profile_type].append(file_path.name)
except Exception as e:
print(f"Failed to process {file_path.name}: {e}")
# Print grouped profiles
for profile_type, files in sets_by_type.items():
print(f"{profile_type}:", len(files))
This script:
- Scans a folder containing .nc files
- Parses each file using the NCFileParser
- Checks for inclined flange/web cuts
- Copies the file into either the Inclined cuts or Straights folder, accordingly,
allowing for organized separation and easier management of files based on their geometric features for further processing or review.
Inspection scripts
The examples folder contains manual inspection scripts. These can be run directly after installing the package with pip install -e ..
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/
Metadata
Release files for dstvparser 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dstvparser-0.1.2.tar.gz | 12.0 kB | Without provenance | Details for dstvparser-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dstvparser-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for dstvparser-0.1.2-py3-none-any.whl |
Total release size: 26.4 kB
Release files / dstvparser-0.1.2.tar.gz
| Download URL | dstvparser-0.1.2.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
189f1d9ed129e3ea07f5bf8f44913a8e3ed29edbf4fb89e8a4af23119cee654a
|
|
BLAKE2b-256 checksum How to use checksums |
265824641e2b29ec6fad14f59ec5fd3d9d6dc6e223a14a30130f3bcfaff3668b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / dstvparser-0.1.2-py3-none-any.whl
| Download URL | dstvparser-0.1.2-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8edaf29d4bfba1fce525197d539d239b3b3619effca1c3f6ce5ff91593c5dccc
|
|
BLAKE2b-256 checksum How to use checksums |
8e9b07f5e54b1fee8da1447113a3965a6a712af2cb40662634771f15f6dc39de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Security for dstvparser 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.