Skip to content

surfly/srcset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

srcset

srcset attribute parser

How to use

from srcset.srcset import SRCSet

obj = SRCSet("/q_auto,f_auto/image.png?a 1w, image2.png")
obj.parse()

# [{u'h': None, u'url': '/q_auto,f_auto/image.png?a', u'w': u'1', u'x': None},
# {u'h': None, u'url': 'image2.png', u'w': None, u'x': None}]

obj.candidates[1]["w"] = 2
obj.stringify()

# u'/q_auto,f_auto/image.png?a 1w, image2.png 2w'

Releases

No releases published

Packages

No packages published

Languages