svgdigitizer

(x,y) Data Points from SVG files

https://github.com/echemdb/svgdigitizer

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary

Keywords

data-mining python svg vector-graphics
Last synced: 6 months ago · JSON representation

Repository

(x,y) Data Points from SVG files

Basic Info
Statistics
  • Stars: 19
  • Watchers: 3
  • Forks: 8
  • Open Issues: 20
  • Releases: 22
Topics
data-mining python svg vector-graphics
Created over 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Zenodo

README.md

logo

svgdigitizer

License: GPL 3.0 or later DOI

Extract (x,y) data points from SVG files


The svgdigitizer allows recovering data from a curve in a figure, plotted in a 2D coordinate system, which is usually found in scientific publications. The data is accessible either with a command line interface or the API from a specifically prepared scaled vector graphics (SVG) file. The data can be stored as a frictionless datapackage (CSV and JSON) which can be used with unitpackage to access the plots metadata or create a database of such datapackages.

Features

The svgdigitizer has additional features compared to other plot digitizers, such as:

  • supports multiple y (x) values per x (y) value
  • usage of splines allows for very precise retracing of distinct features
  • splines can be digitized with specific sampling intervals
  • supports plots with distorted/skewed axis
  • extracts units from axis labels
  • reconstruct time series with a given scan rate
  • supports scale bars
  • supports scaling factors
  • extracts metadata associated with the plot in the SVG
  • saves data as frictionless datapackage (CSV + JSON) allowing for FAIR data usage
  • inclusion of metadata in the datapackage
  • Python API to interact with the retraced data

Refer to our documentation for more details.

Installation

This package is available on PyPI and can be installed with pip:

sh .noeval pip install svgdigitizer

The package is also available on conda-forge and can be installed with conda

sh .noeval conda install -c conda-forge svgdigitizer

or mamba

sh .noeval mamba install -c conda-forge svgdigitizer

Please consult our documentation for more detailed installation instructions.

Command Line Interface

The CLI allows creating SVG files from PDFs and allows digitizing the processed SVG files. Certain plot types have specific commands to recover different kinds of metadata. Refer to the CLI documentation for more information.

```sh $ svgdigitizer Usage: svgdigitizer [OPTIONS] COMMAND [ARGS]...

The svgdigitizer suite.

Options: --help Show this message and exit.

Commands: cv Digitize a cylic voltammogram and create a frictionless datapackage. digitize Digitize a 2D plot. figure Digitize a figure with units on the axis and create a frictionless datapackage. paginate Render PDF pages as individual SVG files with linked PNG images. plot Display a plot of the data traced in an SVG.

$ svgdigitizer figure doc/files/others/loopingscanrate.svg --sampling-interval 0.01 ```

API

You can also use the svgdigitizer package directly from Python, to access properties of the SVG or additional properties associated with the figure.

```python

from svgdigitizer.svg import SVG from svgdigitizer.svgplot import SVGPlot from svgdigitizer.svgfigure import SVGFigure

figure = SVGFigure(SVGPlot(SVG(open('doc/files/others/looping.svg', 'rb')), sampling_interval=0.01)) ```

Examples: figure.df provides a dataframe of the digitized curve. figure.plot() shows a plot of the digitized curve. figure.metadadata provides a dict with metadata of the original plot, such as original units of the axis.

The svgdigitizer can be enhanced with submodules, which are designed to digitize specific plot types, such as the submodule electrochemistry.cv.

This submodule allows digitizing cyclic voltammograms commonly found in the field of electrochemistry.

```python

from svgdigitizer.svg import SVG from svgdigitizer.svgplot import SVGPlot from svgdigitizer.electrochemistry.cv import CV

cvsvg = 'doc/files/mustermann2021svgdigitizer1/mustermann2021svgdigitizer1f2ablue.svg' cv = CV(SVGPlot(SVG(open(cvsvg, 'rb')), sampling_interval=0.01)) ```

The resulting cv object has the same properties as the figure object above.

Owner

  • Name: echemdb
  • Login: echemdb
  • Kind: organization

GitHub Events

Total
  • Create event: 6
  • Release event: 5
  • Issues event: 21
  • Watch event: 6
  • Delete event: 1
  • Issue comment event: 46
  • Push event: 57
  • Pull request review event: 75
  • Pull request review comment event: 59
  • Pull request event: 60
Last Year
  • Create event: 6
  • Release event: 5
  • Issues event: 21
  • Watch event: 6
  • Delete event: 1
  • Issue comment event: 46
  • Push event: 57
  • Pull request review event: 75
  • Pull request review comment event: 59
  • Pull request event: 60

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 1,077
  • Total Committers: 4
  • Avg Commits per committer: 269.25
  • Development Distribution Score (DDS): 0.337
Past Year
  • Commits: 35
  • Committers: 3
  • Avg Commits per committer: 11.667
  • Development Distribution Score (DDS): 0.571
Top Committers
Name Email Commits
Albert Engstfeld a****d@g****m 714
Julian Rüth j****h@f****g 257
Johannes Hermann l****r@w****e 105
GoldyTobi 9****i 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 60
  • Total pull requests: 132
  • Average time to close issues: 6 months
  • Average time to close pull requests: 20 days
  • Total issue authors: 9
  • Total pull request authors: 5
  • Average comments per issue: 1.48
  • Average comments per pull request: 1.02
  • Merged pull requests: 111
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 12
  • Pull requests: 55
  • Average time to close issues: 26 days
  • Average time to close pull requests: 9 days
  • Issue authors: 5
  • Pull request authors: 4
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.55
  • Merged pull requests: 42
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • DunklesArchipel (37)
  • saraedum (14)
  • FMMechem (2)
  • linuxrider (2)
  • doronbehar (1)
  • GDufenshuoo (1)
  • eyalk11 (1)
  • BenBE (1)
  • TheOpenBIts (1)
Pull Request Authors
  • DunklesArchipel (66)
  • linuxrider (44)
  • saraedum (30)
  • dependabot[bot] (2)
  • TheOpenBIts (1)
Top Labels
Issue Labels
enhancement (6) bug (2) we wontfix (1) documentation (1)
Pull Request Labels
needs work (3) dependencies (2) github_actions (2) bug (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 237 last-month
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 25
  • Total maintainers: 2
pypi.org: svgdigitizer

svgdigitizer is a Python library and command line tool to recover the measured data underlying plots in scientific publications.

  • Versions: 21
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 237 Last month
Rankings
Dependent packages count: 3.2%
Average: 17.9%
Dependent repos count: 21.5%
Downloads: 28.8%
Maintainers (2)
Last synced: 6 months ago
conda-forge.org: svgdigitizer
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.3%
Average: 46.9%
Dependent packages count: 51.6%
Forks count: 52.2%
Stargazers count: 59.6%
Last synced: 6 months ago

Dependencies

.github/workflows/doc.yml actions
  • JamesIves/github-pages-deploy-action 3.7.1 composite
  • actions/checkout v2 composite
  • conda-incubator/setup-miniconda v2 composite
.github/workflows/lint.yml actions
  • actions/checkout v2 composite
  • conda-incubator/setup-miniconda v2 composite
.github/workflows/test.yml actions
  • actions/checkout v2 composite
  • conda-incubator/setup-miniconda v2 composite
pyproject.toml pypi
  • astropy >=5,<6
  • click >=8,<9
  • frictionless >=5.8.3,<6
  • matplotlib >=3.5,<4
  • mergedeep >=1.3.4,<2
  • pandas >=1.3,<2
  • pdf2image >=1.16,<2
  • pillow >=10.0.1,<11
  • pybtex >=0.24,<0.25
  • pyyaml >=6,<7
  • svgpathtools >=1.4,<2
  • svgwrite >=1.4,<2
environment.yml conda
  • astropy >=5,<6
  • black >=23,<24
  • click >=8,<9
  • frictionless >=5.8.3,<6
  • isort
  • jupytext
  • matplotlib-base >=3.5,<4
  • mergedeep >=1.3.4,<2
  • myst-nb
  • myst-parser
  • pandas >=1.3,<2
  • pdf2image >=1.16,<2
  • pillow >=10.0.1,<11
  • pip
  • poppler
  • pybtex >=0.24,<0.25
  • pylint >=3,<3.1
  • pytest
  • python
  • pyyaml >=6,<7
  • scipy >=1.7,<2
  • sphinx
  • svg.path >=4.1,<5
  • svgpathtools >=1.4,<2
  • svgwrite >=1.4,<2
  • twine