inkplot


Nameinkplot JSON
Version 0.2.1 PyPI version JSON
download
home_page
Summarya simple presentation utility that turns inkscape SVGs into images and multi-page pdfs with configurable layer visibility and zoom definitions
upload_time2022-12-08 05:00:33
maintainer
docs_urlNone
author
requires_python>=3.6
licenseLicense :: OSI Approved :: GNU General Public License v3 (GPLv3)
keywords inkscape pdf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Inkplot
Inkplot makes [PDFs](https://gitlab.com/frameworklabs/inkplot/-/raw/master/docs/examples/sample-output.pdf?inline=false)
and PNGs out of [Inkscape](https://inkscape.org/) SVG documents
using a [simple YAML file](https://gitlab.com/frameworklabs/inkplot/-/blob/master/docs/examples/render.yml)
that describes for each image or pdf page page:

* the [source SVG]()
* visibiilty for each of the SVG's layers
* the page's zoom extents

It's purpose is to make it easy to produce PDFs from SVGs where the workflow
includes turning layers on and off and zooming around to different spots
in the document space.

The project's original aim is to enable the creation of a set of planning
documents with title blocks, page numbers, compass rose and scale, etc.
with pages that include various systems like water, septic, and electrical
with labels and line weights appropriate to the scale.

I've often wanted a tool like this to exist, but only just embarked
on the project that's involved enough to justify the effort.

I hope other folks find it useful. Enjoy!

## Pages
To keep things brief, inkplot pages can use shared layersets and zoom
rectangles:
```yaml
shared:
  layersets:
    - name: hide-all
      source: farm.svg
      hidden:
        - '**'
    - name: basemap-imagery
      source: farm.svg
      visible: True
      layers:
        - "site>>basemap>>**"
    - name: titleblock-frontpage
      source: farm.svg
      visible:
        - "titleblock>>full extent frame>>boxes"
        - "titleblock>>full extent frame>>mask"
        - "scale>>full extent scale"
  zoom-rectangles:
    - name: whole-site-frame
      id: residences-site-frame-lg
    - name: both-residences-frame
      id: residences-site-frame-sm
```

To define the PDFs that can be generated using inkplot and the render definition
YAML file, A page definition can reference layersets and simply define any additional
layers that need to be turned on or off above and beyond the shared layersets
listed in `include-layersets`:
```yaml
pdfs:
  - name: example_pdf
    pages:
      - name: frontpage
        source: farm.svg
        include-layersets:
          - "hide-all"
          - "basemap-imagery"
          - "titleblock-frontpage"
        layersets:
          - visible: True
            layers:
              - "titleblock>>full extent frame>>title>>overview-basemap"
        include-zoom-rectangle: whole-site-frame
```

And, because it's a [YAML](https://yaml.org/) file, we can gain a bit more
brevity yet using YAML aliases:
```yaml
pdfs:
  - name: example_pdf
    pages:
      # this one defines the front page but also makes a template of sorts named
      # pg-imagery-with-titleblock that can be used later
      - &pg-imagery-with-titleblock
        name: frontpage
        source: farm.svg
        include-layersets:
          - "hide-all"
          - "basemap-imagery"
          - "titleblock-frontpage"
        layersets:
          - visible: True
            layers:
              - "titleblock>>full extent frame>>title>>overview-basemap"
        include-zoom-rectangle: whole-site-frame
        
      # this defines a page that includes everything in the frontpage def, but
      # redefines the layersets (keeping the layersets referenced in
      # include-layersets)
      - *pg-imagery-with-titleblock
        name: siteplan
        layersets:
            visible:
              - "titleblock>>full extent frame>>title>>site-plan"
              - "bldgs>>**"
              - "site/infrastructure/fences/**"
```

To define images, that, like pages, can be generated at the command line, we can include
an images section that is very similar to the pages section:
```yaml
images:
  - name: site-range-hill
    source: farm.svg
    include-layersets:
      - "hide-all"
      - "titleblock-brewery-site"
      - "shared-brewery-site"
    layersets:
      - visible:
          - "proposed>>brewery>>sites 1>>range hill"
      - hidden: []
    include-zoom-rectangle: brewery-site-plan-frame
```

## Using the CLI
To create all defined PDFs and images, use the simple CLI:
```bash
inkplot example.yml
```

and to create individual PDFs and images use:
```bash
# produce a single PDF
inkplot example.yml --pdf example_pdf

# produce an individual image
inkplot example.yml --image site-range-hill
```

And that should do it.

## Installing
Installing is as simple as:
```bash
pip install inkplot
```
and you'll need to have [Inkscape](https://inkscape.org) installed.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "inkplot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "inkscape,pdf",
    "author": "",
    "author_email": "Fred McDavid <fred@frameworklabs.us>",
    "download_url": "https://files.pythonhosted.org/packages/22/27/2a181ecc5bfc336a196df277b36fab0aaa3535ade4227649b325f3a9c8df/inkplot-0.2.1.tar.gz",
    "platform": null,
    "description": "# Inkplot\nInkplot makes [PDFs](https://gitlab.com/frameworklabs/inkplot/-/raw/master/docs/examples/sample-output.pdf?inline=false)\nand PNGs out of [Inkscape](https://inkscape.org/) SVG documents\nusing a [simple YAML file](https://gitlab.com/frameworklabs/inkplot/-/blob/master/docs/examples/render.yml)\nthat describes for each image or pdf page page:\n\n* the [source SVG]()\n* visibiilty for each of the SVG's layers\n* the page's zoom extents\n\nIt's purpose is to make it easy to produce PDFs from SVGs where the workflow\nincludes turning layers on and off and zooming around to different spots\nin the document space.\n\nThe project's original aim is to enable the creation of a set of planning\ndocuments with title blocks, page numbers, compass rose and scale, etc.\nwith pages that include various systems like water, septic, and electrical\nwith labels and line weights appropriate to the scale.\n\nI've often wanted a tool like this to exist, but only just embarked\non the project that's involved enough to justify the effort.\n\nI hope other folks find it useful. Enjoy!\n\n## Pages\nTo keep things brief, inkplot pages can use shared layersets and zoom\nrectangles:\n```yaml\nshared:\n  layersets:\n    - name: hide-all\n      source: farm.svg\n      hidden:\n        - '**'\n    - name: basemap-imagery\n      source: farm.svg\n      visible: True\n      layers:\n        - \"site>>basemap>>**\"\n    - name: titleblock-frontpage\n      source: farm.svg\n      visible:\n        - \"titleblock>>full extent frame>>boxes\"\n        - \"titleblock>>full extent frame>>mask\"\n        - \"scale>>full extent scale\"\n  zoom-rectangles:\n    - name: whole-site-frame\n      id: residences-site-frame-lg\n    - name: both-residences-frame\n      id: residences-site-frame-sm\n```\n\nTo define the PDFs that can be generated using inkplot and the render definition\nYAML file, A page definition can reference layersets and simply define any additional\nlayers that need to be turned on or off above and beyond the shared layersets\nlisted in `include-layersets`:\n```yaml\npdfs:\n  - name: example_pdf\n    pages:\n      - name: frontpage\n        source: farm.svg\n        include-layersets:\n          - \"hide-all\"\n          - \"basemap-imagery\"\n          - \"titleblock-frontpage\"\n        layersets:\n          - visible: True\n            layers:\n              - \"titleblock>>full extent frame>>title>>overview-basemap\"\n        include-zoom-rectangle: whole-site-frame\n```\n\nAnd, because it's a [YAML](https://yaml.org/) file, we can gain a bit more\nbrevity yet using YAML aliases:\n```yaml\npdfs:\n  - name: example_pdf\n    pages:\n      # this one defines the front page but also makes a template of sorts named\n      # pg-imagery-with-titleblock that can be used later\n      - &pg-imagery-with-titleblock\n        name: frontpage\n        source: farm.svg\n        include-layersets:\n          - \"hide-all\"\n          - \"basemap-imagery\"\n          - \"titleblock-frontpage\"\n        layersets:\n          - visible: True\n            layers:\n              - \"titleblock>>full extent frame>>title>>overview-basemap\"\n        include-zoom-rectangle: whole-site-frame\n        \n      # this defines a page that includes everything in the frontpage def, but\n      # redefines the layersets (keeping the layersets referenced in\n      # include-layersets)\n      - *pg-imagery-with-titleblock\n        name: siteplan\n        layersets:\n            visible:\n              - \"titleblock>>full extent frame>>title>>site-plan\"\n              - \"bldgs>>**\"\n              - \"site/infrastructure/fences/**\"\n```\n\nTo define images, that, like pages, can be generated at the command line, we can include\nan images section that is very similar to the pages section:\n```yaml\nimages:\n  - name: site-range-hill\n    source: farm.svg\n    include-layersets:\n      - \"hide-all\"\n      - \"titleblock-brewery-site\"\n      - \"shared-brewery-site\"\n    layersets:\n      - visible:\n          - \"proposed>>brewery>>sites 1>>range hill\"\n      - hidden: []\n    include-zoom-rectangle: brewery-site-plan-frame\n```\n\n## Using the CLI\nTo create all defined PDFs and images, use the simple CLI:\n```bash\ninkplot example.yml\n```\n\nand to create individual PDFs and images use:\n```bash\n# produce a single PDF\ninkplot example.yml --pdf example_pdf\n\n# produce an individual image\ninkplot example.yml --image site-range-hill\n```\n\nAnd that should do it.\n\n## Installing\nInstalling is as simple as:\n```bash\npip install inkplot\n```\nand you'll need to have [Inkscape](https://inkscape.org) installed.\n",
    "bugtrack_url": null,
    "license": "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
    "summary": "a simple presentation utility that turns inkscape SVGs into images and multi-page pdfs with configurable layer visibility and zoom definitions",
    "version": "0.2.1",
    "split_keywords": [
        "inkscape",
        "pdf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "4269424c50e6120ed3e6dcf3a610c72e",
                "sha256": "cf9a684227b137c6571d377d2a3495946fffebfaa27c5c20cc2ded209d2f4db9"
            },
            "downloads": -1,
            "filename": "inkplot-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4269424c50e6120ed3e6dcf3a610c72e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 13856,
            "upload_time": "2022-12-08T05:00:32",
            "upload_time_iso_8601": "2022-12-08T05:00:32.323747Z",
            "url": "https://files.pythonhosted.org/packages/4d/28/1099dd1f99c1fb3859861b2f4b2759244ff41240890f91cf6a2fead609fa/inkplot-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "73f13207533954697c7d03c4e8c3df97",
                "sha256": "5f49b52499f580af4a2d4131343511de38b9ed15529d362759723fa7a94f9c4d"
            },
            "downloads": -1,
            "filename": "inkplot-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "73f13207533954697c7d03c4e8c3df97",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 13953,
            "upload_time": "2022-12-08T05:00:33",
            "upload_time_iso_8601": "2022-12-08T05:00:33.707905Z",
            "url": "https://files.pythonhosted.org/packages/22/27/2a181ecc5bfc336a196df277b36fab0aaa3535ade4227649b325f3a9c8df/inkplot-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-08 05:00:33",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "inkplot"
}
        
Elapsed time: 0.01872s