Skip to main content

SVG spritesheet maker

Project description

ssm

SVG spritesheet maker

CI Deployment to PyPI

ssm is a simple approach to creating and managing SVG spritesheets. It has 5 main functions:

  • create: For creating spritesheets from a list of SVG sprites (i.e. SVG icons etc.)
  • list: For listing the SVG sprites stored in a spritesheet
  • add: For adding SVG sprites to an existing spritesheet
  • remove: For removing SVG sprites from an existing spritesheet
  • export: For exporting SVG sprites from an existing spritesheet. Can be used for converting a <symbol> back into a standalone <svg> or to display a format suitable for HTML (using <use>).

For more details, run python -m ssm -h after installation.

Installation

To install the most stable version of this package, run:

$ pip install ssm-svg

Usage example

Create spritesheet icons.svg with search.svg and menu.svg as sprites:

$ python -m ssm create -f icons.svg search.svg menu.svg

Create spritesheet and overwrite existing file:

$ python -m ssm create -f icons.svg search.svg menu.svg -F

Create spritesheet with custom ID hamburger-icon instead of defaulting to its file name:

$ python -m ssm create -f icons.svg search.svg hamburger-icon=menu.svg

List IDs of SVG sprites in spritesheet:

$ python -m ssm list -f icons.svg

Add SVG sprites to spritesheet:

$ python -m ssm add -f icons.svg facebook.svg instagram.svg

Remove SVG sprites with IDs facebook and instagram from spritesheet:

$ python -m ssm remove -f icons.svg facebook instagram

NOTE: Inserting the same ID more than once would cause an error.

Add SVG sprites to spritesheet with custom ID fb-icon instead of defaulting to its file name:

$ python -m ssm add -f icons.svg fb-icon=facebook.svg

Export sprite with ID search from spritesheet:

$ python -m ssm export -f icons.svg search

Export sprite with ID search from spritesheet for use in HTML:

$ python -m ssm export -f icons.svg search --use

License

MIT

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

ssm_svg-0.0.4.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distribution

ssm_svg-0.0.4-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page