Skip to content

Salk-Harnessing-Plants-Initiative/nsipptparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nsipptparser

Latest PyPI version

Latest Travis CI build status

Very simple package for parsing .nsippt files to json. Use Python 3.4 and up.

.nsippt files are a file type by North Star Imaging.

Installation

pip install nsipptparser

Usage

import nsipptparser
import json

with open("sneaky.nsippt") as file:
    data = nsipptparser.parse(file)
    # Get the first length measurement of the first View
    length = data["ViewPropertiesSet"]["View Properties"][0]["Actions Set"]["Length"][0]["length value"]
    print("The length is ", length)

    # Get the base64 thumbnail of the first View
    thumbnail = data["ViewPropertiesSet"]["View Properties"][0]["Thumbnail"]
    print("The thumbnail is ", thumbnail)

    # Save to json file
    with open('data.json', 'w') as f:
        json.dump(data, f, indent=4)

Note: All values are parsed as strings, so you will have to parse the strings further yourself.

You can probably use pillow to convert the base64 thumbnail to an image:

image

Compatibility

Known to work on Python 3.7

Licence

MIT

Authors

nsipptparser was written by Russell Tran.

About

Very simple Python package to parse .nsippt files to json

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages