{"id":13775162,"url":"https://github.com/gmagno/spyci","last_synced_at":"2025-12-14T02:27:24.134Z","repository":{"id":40986442,"uuid":"131432774","full_name":"gmagno/spyci","owner":"gmagno","description":"A tiny Python package to parse spice raw data files.","archived":false,"fork":false,"pushed_at":"2022-12-26T21:01:45.000Z","size":1384,"stargazers_count":50,"open_issues_count":10,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T14:47:50.434Z","etag":null,"topics":["electronics","ngspice","python","raw","simulation","spice"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmagno.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-28T18:07:26.000Z","updated_at":"2025-04-02T07:34:36.000Z","dependencies_parsed_at":"2023-01-31T01:45:50.661Z","dependency_job_id":null,"html_url":"https://github.com/gmagno/spyci","commit_stats":null,"previous_names":["goncalo-godwitlabs/spr"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmagno%2Fspyci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmagno%2Fspyci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmagno%2Fspyci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmagno%2Fspyci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmagno","download_url":"https://codeload.github.com/gmagno/spyci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248313221,"owners_count":21082818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["electronics","ngspice","python","raw","simulation","spice"],"created_at":"2024-08-03T17:01:34.704Z","updated_at":"2025-12-14T02:27:19.010Z","avatar_url":"https://github.com/gmagno.png","language":"Python","funding_links":[],"categories":["Waveform Viewers"],"sub_categories":[],"readme":"=====\nSpyci\n=====\n\nA tiny Python package to parse and plot spice raw data files.\n\n\n.. image:: https://img.shields.io/pypi/v/spyci.svg\n    :target: https://pypi.python.org/pypi/spyci\n\n.. image:: https://img.shields.io/travis/gmagno/spyci.svg\n    :target: https://travis-ci.com/gmagno/spyci\n\n.. image:: https://readthedocs.org/projects/spyci/badge/?version=latest\n    :target: https://spyci.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n\n\n* Free software: MIT license\n* Documentation: https://spyci.readthedocs.io.\n\n\nGetting Started\n---------------\n\nThese instructions will get you a copy of the package up and running on your local machine.\n\n**Note: at the moment only ascii raw spice format is supported!**\n\nInstallation\n------------\n\nFrom PyPI\n^^^^^^^^^\n\n::\n\n    $ pip install spyci  # it is recommended to this in a virtual environment\n\n\nFrom the github repo\n^^^^^^^^^^^^^^^^^^^^\n\n::\n\n    $ pip install git+https://github.com/gmagno/spyci.git\n\n\nor\n\n::\n\n    $ git clone git@github.com:gmagno/spyci.git\n    $ cd spyci/\n    $ python setup.py install\n\n\nUsage\n^^^^^\n\nFrom python run::\n\n    \u003e\u003e\u003e from spyci import spyci\n    \u003e\u003e\u003e data = spyci.load_raw(\"/path/to/rawspice.raw\")  # see 'Data structure' section below\n\n\nOr just use the CLI::\n\n    $ spyci -r /path/to/rawspice.raw vin vout\n\nfor more details use::\n\n    $ spyci -h\n    usage: spyci [-h] [-v] [-r RAW_FILE] [-l] [-f] [-o OUT_IMAGE] ...\n    \n    Spyci (spyci v0.6.1) -- parses ngspice raw data files and\n    plots the specified variables.\n    For full documentation check the repo: https://github.com/gmagno/spyci\n    \n    positional arguments:\n      VARS                  List of variables to plot\n    \n    optional arguments:\n      -h, --help            show this help message and exit\n      -v, --version         shows spyci version\n      -r RAW_FILE, --raw-file RAW_FILE\n                            path to raw file to be parsed\n      -l, --list-variables  lists variables that can be plotted\n      -f, --out-formats     lists supported output image formats\n      -o OUT_IMAGE, --out-image OUT_IMAGE\n                            path to output image file, use -f, to list supported\n                            formats\n    \n                                                     /##\n                                                    |__/\n              /#######  /######  /##   /##  /####### /##\n             /##_____/ /##__  ##| ##  | ## /##_____/| ##\n            |  ###### | ##  \\ ##| ##  | ##| ##      | ##\n             \\____  ##| ##  | ##| ##  | ##| ##      | ##\n             /#######/| #######/|  #######|  #######| ##\n            |_______/ | ##____/  \\____  ## \\_______/|__/\n                      | ##       /##  | ##\n                      | ##      |  ######/\n                      |__/       \\______/\n    \n    return:\n        The return value of spyci is 0 if the raw file is successfully\n        parsed and plotted.\n    \n    examples:\n        # Run without arguments will attempt to load rawspice.raw from cwd\n        # and plot all variables\n        $ spyci\n    \n        # List variables that can be plotted\n        $ spyci -l\n        Variables:\n    \n        idx  name        type\n        -----  ----------  -------\n            1  i(l1)       current\n            2  n1          voltage\n            3  vi          voltage\n            4  vo          voltage\n            5  i(vsource)  current\n    \n        # Load 'some/location/sim.raw' and plot variables 'i(l1)' and 'vo'\n        $ spyci -r some/location/sim.raw \"i(l1)\" vo\n    \n        # Indices can be used insted of variable names, this is equivalent\n        # to the previous example\n        $ spyci -r some/location/sim.raw 1 4\n    \n        # Save your plot to the file system\n        $ spyci -o myplot.png 1 4\n    \n        # Different image formats are supported, just use the correct\n        # extension, {.png, .svg, .pdf, ...}. For a list of supported\n        # formats run with -f flag\n        $ spyci -f\n        Supported output image file formats:\n    \n        ext    format\n        -----  -------------------------\n        raw    Raw RGBA bitmap\n        rgba   Raw RGBA bitmap\n        pgf    PGF code for LaTeX\n        svgz   Scalable Vector Graphics\n        svg    Scalable Vector Graphics\n        ps     Postscript\n        png    Portable Network Graphics\n        eps    Encapsulated Postscript\n        pdf    Portable Document Format\n    \n    copyright:\n        Copyright © 2020 Gonçalo Magno \u003cgoncalo@gmagno.dev\u003e\n        This software is licensed under the MIT License.\n\n\nData structure\n^^^^^^^^^^^^^^\n\nA properly parsed raw spice file by `load_raw()` returns a dictionary with the following structure::\n\n    {\n        \"title\": \u003cstr\u003e,\n        \"date:\": \u003cstr\u003e,\n        \"plotname:\": \u003cstr\u003e,\n        \"flags:\": \u003cstr\u003e,\n        \"no_vars:\": \u003cstr\u003e,\n        \"no_points:\": \u003cstr\u003e,\n        \"vars\": [\n            { \"idx\": \u003cint\u003e, \"name\": \u003cstr\u003e, \"type\": \u003cstr\u003e },\n            { \"idx\": \u003cint\u003e, \"name\": \u003cstr\u003e, \"type\": \u003cstr\u003e }\n            ...\n            { \"idx\": \u003cint\u003e, \"name\": \u003cstr\u003e, \"type\": \u003cstr\u003e }\n        ]\n        \"values\": {\n            \"var1\": \u003cnumpy.ndarray\u003e,\n            \"var2\": \u003cnumpy.ndarray\u003e,\n            ...\n            \"varN\": \u003cnumpy.ndarray\u003e\n        }\n    }\n\n\nWhere values `values` is a numpy structured array with the actual data.\n\nExamples\n^^^^^^^^\n\nThe following examples make use of ngspice to run the spice simulations, so please ensure it is installed.\nOn ubuntu that would be::\n\n    $ sudo apt install ngspice\n\n\nInverting amplifier with an opamp LM741\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCheck the directory `examples/amplifier/` for details on the cirtcuit and the simulation files.\n\nThe schematic:\n\n.. image:: examples/amplifier/schematic.svg\n    :width: 630px\n    :align: center\n    :height: 332px\n    :alt: amplifier\n\nRun the simulation with::\n\n    $ cd examples/amplifier\n    $ ngspice -r rawspice.raw -o output.log main.cir\n    $ spyci vout vin\n\n\nwhich will fire ngspice generating output.log and rawspice.raw files and also plots the voltages `vin` and `vout`.\n\n.. image:: examples/amplifier/plot.svg\n    :width: 630px\n    :align: center\n    :height: 496px\n    :alt: amplifier\n\n\nSecond order low pass filter with an opamp LM741\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCheck the directory `examples/lp_filter/` for details on the cirtcuit and the simulation files.\n\nThe schematic:\n\n.. image:: examples/lp_filter/schematic.svg\n    :width: 636px\n    :align: center\n    :height: 431px\n    :alt: lp_filter\n\nRun the simulation with::\n\n    $ cd examples/lp_filter\n    $ ngspice -r rawspice.raw -o output.log main.cir\n    $ spyci vout vin\n\n\nwhich will fire ngspice generating output.log and rawspice.raw files and also plots the gain `vout`/`vin` in dB.\n\n.. image:: examples/lp_filter/plot.svg\n    :width: 636px\n    :align: center\n    :height: 501px\n    :alt: lp_filter\n\nLicense\n^^^^^^^\n\nThis project is licensed under the MIT License - see the `LICENSE \u003chttps://github.com/gmagno/spyci/blob/master/LICENSE\u003e`_ file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmagno%2Fspyci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmagno%2Fspyci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmagno%2Fspyci/lists"}