Name | mi-flatland JSON |
Version |
2.0.6
JSON |
| download |
home_page | None |
Summary | Model text file + layout text file -> beautiful diagram |
upload_time | 2025-01-15 14:28:24 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.12 |
license | MIT License Copyright (c) 2019-2025 Leon Starr 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. |
keywords |
2d
draw
graphics
canvas
mbse
xuml
xtuml
sysml
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Flatland Model Diagram (non) Editor
NEW Status January 13, 2025
I have recently rebuilt the entire application based on a series of modules available on GitHub and PyPI.
Will be deploying in ernest in the coming days.
Am de-commisioning the old version on GitHub and PyPI named 'flatland-model-diagram-editor'
Now it is just 'flatland' here on GitHub and 'mi-flatland' on PyPI
Ah yes, yet another tool for generating diagrams from text. But this one is different (otherwise I wouldn't have wasted all this time building it!)
I built Flatland because the following benefits are critical for productive model development:
1. Complete separation of the model semantics from the diagram layout
2. Complete separation of model semantics from model notation
3. Consistent layout of model diagrams without forcing the user to accept or hack awkard, non-sensical placements of nodes and connectors (yeah, I'm lookin at YOU PlantUML)
4. Maximum layout power with minimal specification: No more carpal tunnel pixel pushing!
5. Beautiful, readable diagram output in many output formats (pdf, svg, etc)
6. Support for industrial strength modeling (many hundreds and thousands of model elements)
7. Use your favorite text editor and all the advanced facilities of it and whatever IDE you like without having to learn yet another draw tool that makes you and your team's life difficult.
8. And since we're here on GitHub, wouldn't it be nice if all of your models were under proper configuration management where you and your team can diff and merge to your heart's content? Wouldn't it be nice to update a diagram layout without touching the underlying model (and vice versa)?
Basically, I have wasted way too many hours of my career pushing pixels around and I just couldn't take it anymore!
Flatland is a model diagram non-editor written by me [Leon Starr](mailto:leon_starr@modelint.com) that generates
beautiful PDFs (and other output formats) based on two very
human-readable input text files. The model file specifies model semantics
(state transitions, generalizations, classes etc)
while the layout file specifies (node placement and alignment, connector anchors) and lightly refers to some elements
in the model file. You can think of the layout file as a "style sheet" for your models.
Some benefits:
Follow me on BlueSky and [LinkedIn](https://linkedin.com/in/modelint) for updates.
## Models to Code
In the meantime, if you are curious about the whole MBSE thing that this tool supports, take a look at our [book](https://modelstocode.com).
Also, various resources at the [Model Integration](https://modelint.com/mbse) website.
## Installation
If you are already a pythonista, you can skim these instructions quickly. But I am writing for
those of you who might not be.
And for today (25-1-14) I have only tested this on my MacBook Pro / M2 Max / Sequoia
A minor adjustment or two may be required for success on Linux and Windows, and I am happy to help you out with that
if you contact me. If you are adept with your platform, I could use the help testing installation.
### Summary
1. Install Python 3.12 on your machine (you might be okay with an earlier version, but all bets are off)
2. Set up a virtual environment so your path variables, python version, etc are all correct for this installation
3. Activate that environment so the settings take effect
4. Install flatland
5. Check version
6. Generate a diagram from an example file
7. For future usage, be sure your environment is activated, or update your shell path environment as necessary
### Details
#### [1] Install Python
Go to https://www.python.org and follow instructions to download Python 3.12 for your machine. It's okay if you already have other versions of Python on your machine. If you have some other way of installing Python on your machine like homebrew that's fine, just get the version right.
#### [2] Set up a virtual environment (venv)
Select or create a directory somewhere as the destination of the virutal environment you are about to create. Here's what I did on my machine:
```
[841] /starr/SDEV/Environments
[842] cd User
[843] ls
[844] python -V
Python 3.12.7
[845] python -m pip install --user --upgrade pip
[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: pip3 install --upgrade pip
[846] pip3 install --upgrade pip
```
Your interaction will be different than above, but I verified that I had the right
Python and ensured that the package installer pip, was up to date and ready for action.
On to the virtual environment setup...
```
[847] python -m pip install --user virtualenv
```
You'll get a lot of diagnstic stuff, but the final line should be something like:
```
Successfully installed distlib-0.3.9 filelock-3.16.1 platformdirs-4.3.6 virtualenv-20.28.1
```
#### [3] Activate the venv
Now I have the venv module available which I can use to create my virtual environment (venv)
```
[848] pwd
/Users/starr/SDEV/Environments/User
[849] python -m venv flatland
```
Above, the name `flatland` is not actually flatland, but the name of the environment that I am creating for it. You could name it anything like `F1` or `flatland_env` if you like.
Now I activate the environment:
```
[850] source flatland/bin/activate
(flatland) [851]
```
Remember that command above, you'll need it whenever you open a terminal window and want to set your environment up to use flatland. You know you've succeeded because it prefixes your shell prompt with the name of the venv while active.
#### [4] Install flatland
Finally! We can install flatland into our environment.
```
(flatland) [851] pip install mi-flatland
```
Okay, now you can go to any directory you want, say your home directory and try it out.
I created an empty directory `Ftest` in my home directory earlier, so I go there and
check to see if flatland will show me it's version.
#### [5] Check version
```
(flatland) [852] cd ~/Ftest
(flatland) [853] flatland -V
(flatland) [914] flatland -V
Flatland version: 2.0.2
(flatland) [915]
```
#### [6] Generate a diagram
Note: I will write instructions later about how you can get the sample files I am using, but I'll just show you what happens for now.
Initially we see one executable class model (xcm) file and two
model layout sheet (mls) files.
```
(flatland) [915] ls
elevator.xcm elevator_xUML.mls elevator_Starr.mls
```
Now we choose the xUML layout and generate a class diagram.
```
(flatland) [915] flatland -m elevator.xcm -l elevator_xUML.mls -d elevator_cd.pdf
(flatland) [917] ls
elevator.xcm elevator_xUML.mls elevator_Starr.mls elevator_cd.pdf
```
What we did there was supply a model file *.xcm with the -m arg, a layout file *.mls with the -l arg, and the name of the diagram file we wanted to generate, elevator_cd.pdf with the -d arg.
#### [6a]
To get those example files, you can request them like so:
```
(flatland) [918] flatland -E
(flatland) [919] ls
examples
```
This copies the flatland examples directory into your current working directory. In there
you will find a variety of example models and layouts. Note that a given layout file
references model content, so you can only use it with a specific model file.
But you CAN define multiple layouts for the same model. They will be grouped together in subfolders in the examples directory so that you can easily tell which models and layouts can be used together.
By the way, if you are on Mac OS, you will see two directories of YAML configuration files in your $HOME/.config folder named 'flatland' and 'mi_tablet'. Graphics and text style options along with any organization specific logos and other media resources are in the mi_tablet directory and
a variety of positional, layout, titleblock and other parameters are in the flatland directory. You might want to browse through those, but careful if you edit them. If you mess up, don't worry, just delete the directories and the next time you run flatland it will refresh them. Detailed instructions will be available on the wiki eventually, but you can read the comments in each YAML file for now for guidance.
And there you have it. See the project wiki for all the various command args you can supply and how to edit layout files and the various types of supported model files.
Raw data
{
"_id": null,
"home_page": null,
"name": "mi-flatland",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "2D, draw, graphics, canvas, mbse, xuml, xtuml, sysml",
"author": null,
"author_email": "Leon Starr <leon_starr@modelint.com>",
"download_url": "https://files.pythonhosted.org/packages/9d/fd/128f05e8c6bb8e2867c98a8d614a0e0122ebbd6664128805cfae4fe655f7/mi_flatland-2.0.6.tar.gz",
"platform": null,
"description": "# Flatland Model Diagram (non) Editor\n\nNEW Status January 13, 2025\n\nI have recently rebuilt the entire application based on a series of modules available on GitHub and PyPI. \nWill be deploying in ernest in the coming days.\n\nAm de-commisioning the old version on GitHub and PyPI named 'flatland-model-diagram-editor'\nNow it is just 'flatland' here on GitHub and 'mi-flatland' on PyPI\n\nAh yes, yet another tool for generating diagrams from text. But this one is different (otherwise I wouldn't have wasted all this time building it!)\n\nI built Flatland because the following benefits are critical for productive model development:\n\n1. Complete separation of the model semantics from the diagram layout\n2. Complete separation of model semantics from model notation\n3. Consistent layout of model diagrams without forcing the user to accept or hack awkard, non-sensical placements of nodes and connectors (yeah, I'm lookin at YOU PlantUML)\n4. Maximum layout power with minimal specification: No more carpal tunnel pixel pushing!\n5. Beautiful, readable diagram output in many output formats (pdf, svg, etc)\n6. Support for industrial strength modeling (many hundreds and thousands of model elements)\n7. Use your favorite text editor and all the advanced facilities of it and whatever IDE you like without having to learn yet another draw tool that makes you and your team's life difficult.\n8. And since we're here on GitHub, wouldn't it be nice if all of your models were under proper configuration management where you and your team can diff and merge to your heart's content? Wouldn't it be nice to update a diagram layout without touching the underlying model (and vice versa)?\n\nBasically, I have wasted way too many hours of my career pushing pixels around and I just couldn't take it anymore!\n\nFlatland is a model diagram non-editor written by me [Leon Starr](mailto:leon_starr@modelint.com) that generates\nbeautiful PDFs (and other output formats) based on two very\nhuman-readable input text files. The model file specifies model semantics\n(state transitions, generalizations, classes etc)\nwhile the layout file specifies (node placement and alignment, connector anchors) and lightly refers to some elements\nin the model file. You can think of the layout file as a \"style sheet\" for your models.\nSome benefits:\n\nFollow me on BlueSky and [LinkedIn](https://linkedin.com/in/modelint) for updates.\n\n## Models to Code\n\nIn the meantime, if you are curious about the whole MBSE thing that this tool supports, take a look at our [book](https://modelstocode.com).\nAlso, various resources at the [Model Integration](https://modelint.com/mbse) website.\n\n## Installation\n\nIf you are already a pythonista, you can skim these instructions quickly. But I am writing for\nthose of you who might not be.\n\nAnd for today (25-1-14) I have only tested this on my MacBook Pro / M2 Max / Sequoia\nA minor adjustment or two may be required for success on Linux and Windows, and I am happy to help you out with that\nif you contact me. If you are adept with your platform, I could use the help testing installation.\n\n### Summary\n\n1. Install Python 3.12 on your machine (you might be okay with an earlier version, but all bets are off)\n2. Set up a virtual environment so your path variables, python version, etc are all correct for this installation\n3. Activate that environment so the settings take effect\n4. Install flatland\n5. Check version\n6. Generate a diagram from an example file\n7. For future usage, be sure your environment is activated, or update your shell path environment as necessary\n\n### Details\n\n#### [1] Install Python\nGo to https://www.python.org and follow instructions to download Python 3.12 for your machine. It's okay if you already have other versions of Python on your machine. If you have some other way of installing Python on your machine like homebrew that's fine, just get the version right.\n\n#### [2] Set up a virtual environment (venv)\nSelect or create a directory somewhere as the destination of the virutal environment you are about to create. Here's what I did on my machine:\n```\n[841] /starr/SDEV/Environments\n[842] cd User\n[843] ls\n[844] python -V\nPython 3.12.7\n[845] python -m pip install --user --upgrade pip\n[notice] A new release of pip is available: 24.2 -> 24.3.1\n[notice] To update, run: pip3 install --upgrade pip\n[846] pip3 install --upgrade pip\n```\nYour interaction will be different than above, but I verified that I had the right\nPython and ensured that the package installer pip, was up to date and ready for action.\nOn to the virtual environment setup...\n```\n[847] python -m pip install --user virtualenv\n```\nYou'll get a lot of diagnstic stuff, but the final line should be something like:\n```\nSuccessfully installed distlib-0.3.9 filelock-3.16.1 platformdirs-4.3.6 virtualenv-20.28.1\n```\n#### [3] Activate the venv\nNow I have the venv module available which I can use to create my virtual environment (venv)\n```\n[848] pwd\n/Users/starr/SDEV/Environments/User\n[849] python -m venv flatland\n```\nAbove, the name `flatland` is not actually flatland, but the name of the environment that I am creating for it. You could name it anything like `F1` or `flatland_env` if you like.\n\nNow I activate the environment:\n```\n[850] source flatland/bin/activate\n(flatland) [851]\n```\nRemember that command above, you'll need it whenever you open a terminal window and want to set your environment up to use flatland. You know you've succeeded because it prefixes your shell prompt with the name of the venv while active.\n\n#### [4] Install flatland\n\nFinally! We can install flatland into our environment.\n```\n(flatland) [851] pip install mi-flatland\n```\nOkay, now you can go to any directory you want, say your home directory and try it out.\nI created an empty directory `Ftest` in my home directory earlier, so I go there and\ncheck to see if flatland will show me it's version.\n\n#### [5] Check version\n```\n(flatland) [852] cd ~/Ftest\n(flatland) [853] flatland -V\n(flatland) [914] flatland -V\nFlatland version: 2.0.2\n(flatland) [915] \n```\n\n#### [6] Generate a diagram\nNote: I will write instructions later about how you can get the sample files I am using, but I'll just show you what happens for now.\n\nInitially we see one executable class model (xcm) file and two \nmodel layout sheet (mls) files.\n```\n(flatland) [915] ls\nelevator.xcm elevator_xUML.mls elevator_Starr.mls\n```\nNow we choose the xUML layout and generate a class diagram.\n```\n(flatland) [915] flatland -m elevator.xcm -l elevator_xUML.mls -d elevator_cd.pdf\n(flatland) [917] ls\nelevator.xcm elevator_xUML.mls elevator_Starr.mls elevator_cd.pdf\n```\nWhat we did there was supply a model file *.xcm with the -m arg, a layout file *.mls with the -l arg, and the name of the diagram file we wanted to generate, elevator_cd.pdf with the -d arg.\n\n#### [6a]\nTo get those example files, you can request them like so:\n```\n(flatland) [918] flatland -E\n(flatland) [919] ls\nexamples\n```\nThis copies the flatland examples directory into your current working directory. In there\nyou will find a variety of example models and layouts. Note that a given layout file\nreferences model content, so you can only use it with a specific model file.\n\nBut you CAN define multiple layouts for the same model. They will be grouped together in subfolders in the examples directory so that you can easily tell which models and layouts can be used together.\n\nBy the way, if you are on Mac OS, you will see two directories of YAML configuration files in your $HOME/.config folder named 'flatland' and 'mi_tablet'. Graphics and text style options along with any organization specific logos and other media resources are in the mi_tablet directory and \na variety of positional, layout, titleblock and other parameters are in the flatland directory. You might want to browse through those, but careful if you edit them. If you mess up, don't worry, just delete the directories and the next time you run flatland it will refresh them. Detailed instructions will be available on the wiki eventually, but you can read the comments in each YAML file for now for guidance.\n\nAnd there you have it. See the project wiki for all the various command args you can supply and how to edit layout files and the various types of supported model files.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2019-2025 Leon Starr 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. ",
"summary": "Model text file + layout text file -> beautiful diagram",
"version": "2.0.6",
"project_urls": {
"documentation": "https://github.com/modelint/flatland",
"repository": "https://github.com/modelint/flatland"
},
"split_keywords": [
"2d",
" draw",
" graphics",
" canvas",
" mbse",
" xuml",
" xtuml",
" sysml"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e147fcab88f9cdb79452fbb28250e31196b3d18a0dbd15b0b57b5c4881e72dc9",
"md5": "18eab5f0036c048a6d796cfe9d59df33",
"sha256": "00f6f528a2c460c1d6fd4f1b657ddcabf2301288b6870f9d395967d3fefb2c9f"
},
"downloads": -1,
"filename": "mi_flatland-2.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "18eab5f0036c048a6d796cfe9d59df33",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 11400456,
"upload_time": "2025-01-15T14:28:21",
"upload_time_iso_8601": "2025-01-15T14:28:21.615626Z",
"url": "https://files.pythonhosted.org/packages/e1/47/fcab88f9cdb79452fbb28250e31196b3d18a0dbd15b0b57b5c4881e72dc9/mi_flatland-2.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9dfd128f05e8c6bb8e2867c98a8d614a0e0122ebbd6664128805cfae4fe655f7",
"md5": "41276cb397c135cd13da324c870a2be6",
"sha256": "b9ca8cb525814d51056a9f440f504ac47282289a29fad317df3dc25f895a4541"
},
"downloads": -1,
"filename": "mi_flatland-2.0.6.tar.gz",
"has_sig": false,
"md5_digest": "41276cb397c135cd13da324c870a2be6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 11368625,
"upload_time": "2025-01-15T14:28:24",
"upload_time_iso_8601": "2025-01-15T14:28:24.863985Z",
"url": "https://files.pythonhosted.org/packages/9d/fd/128f05e8c6bb8e2867c98a8d614a0e0122ebbd6664128805cfae4fe655f7/mi_flatland-2.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-15 14:28:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "modelint",
"github_project": "flatland",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mi-flatland"
}