Skip to main content

Very simple package for parsing .nsippt files to json

Project description

Latest PyPI version Latest Travis CI build status

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

Usage

pygments_style = 'sphinx'
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.

Installation

pip install nsipptparser

Requirements

Compatibility

Licence

MIT

Authors

nsipptparser was written by Russell Tran.

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

nsipptparser-0.1.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

nsipptparser-0.1.1-py3-none-any.whl (3.9 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