Metadata-Version: 2.5
Name: sysml2py
Version: 1.0.0
Summary: Autogenerated SysML v2 builder library (generated by sysml2py-lab).
Project-URL: Homepage, https://github.com/Westfall-io/sysml2py
Project-URL: Bug Tracker, https://github.com/Westfall-io/sysml2py/issues
Author: Westfall-io
License: MIT License
        
        Copyright (c) 2023 Westfall-io
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: astropy>=5.3; extra == 'dev'
Requires-Dist: pytest>=7.4; extra == 'dev'
Description-Content-Type: text/markdown

# sysml2py (generated)

Version **1.0.0** — generated by **sysml2py-lab** from the SysML v2
grammar + relationship model + corpus (issues #6/#7/#8/#9/#13).

Capabilities:
- Generated AST node classes per grammar rule
- Membership-dispatch table from children.json
- `dump()` / `get_definition()` on every node (loss-minimizing)
- `Unsupported` nodes carry raw text (zero NotImplementedError)
- Provenance stamp in `sysml2py.provenance`

## Building a model (friendly builder API)

Friendly names drop the `Builder`/`Usage`/`Definition` suffixes —
`Part`, `Attribute`, `Item`, ... are builders; usage vs definition is
chosen at creation via `kind=`; `add()` appends children so a full
package dumps from nested composition:

```python
from sysml2py import PackageBuilder, Part, Attribute

pkg = PackageBuilder('MyModel')
stage = Part('Stage_1')
stage.add(Attribute('mass'))
stage.add(Attribute('thrust'))
pkg.add(stage)
print(pkg.dump())
```

```
package MyModel
{
   part Stage_1
   {
      attribute mass;
      attribute thrust;
   }
}
```

Definitions are the same class with `kind=` at creation:
`Part('Stage_1', kind='definition')` -> `part def Stage_1;`

Kinds without a definition form (`Package`, `Comment`, `Actor`,
`Reference`, `Transition`, `Import`, `Message`, `Succession`,
`AliasMember`, `Subject`, `ObjectiveRequirement`) reject
`kind='definition'` with a `ValueError` — the generator never
emits a definition it cannot cast back (and a class-name kind
like `'PartDefinition'` raises
too, since that would print invalid SysML).

`Package`/`Comment`/`Import`/`Message`/`Succession`/`AliasMember`
keep the `*Builder` suffix
(their friendly names are the AST node classes). The classic `*Builder`
names (`PartUsageBuilder`, ...) remain available.

Value-bearing attributes are supported: `Attribute('mass', value=1000,
unit='kg')` renders `attribute mass = 1000[kg];`, with the unit imported
automatically as `public import SI::kg;` (issue #26, lab repo). You may also
pass an astropy `Quantity` and the unit is derived from it (`value=1000*u.kg`)
— add `import astropy.units as u` yourself, since the runtime stays
pure-stdlib (astropy is not bundled; see the migration note).

Compatibility: this is the **1.x** line. Moving from 0.5.x? see
the migration note:
https://github.com/Westfall-io/sysml2py-lab/blob/main/docs/migration-0.5-to-1.0.md
