Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

darkf/py-js-object-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Simple JavaScript/ECMAScript object literal reader

Only supports object literals wrapped in var x = ...; statements, so you might want to do read_js_object('var x = %s;' % literal) if it's in another format.

If you pass in the keyword argument use_unicode it will decode utf8 as well as unicode code points into python unicode strings

Basic constant folding on strings and numbers is done, e.g. "hi " + "there!" reduces to "hi there!", and 1+1 reduces to 2.

** Dependencies **

Requires the slimit library for parsing.

** License **

Copyright (c) 2013 darkf

Licensed under the terms of the WTFPL:

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
	Version 2, December 2004 

Everyone is permitted to copy and distribute verbatim or modified 
copies of this license document, and changing it is allowed as long 
as the name is changed. 

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 

  0. You just DO WHAT THE FUCK YOU WANT TO.

About

Simple JavaScript object literal parser for Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages