Package: cartocss-doc-parser
cartocss-doc-parserCartoCSS documentationPython parser.Installpipinstallcartocss-doc-parserQuickstartThe main functioncartocss_docreturns a dictionary with
almost every section of the documentation. All the properties are wrapped in
generators.>>>frompprintimportpprint>>>fromcartocss_doc_parserimportcartocss_doc>>>>>>doc=cartocss_doc()>>>pprint(doc){'building':<generatorobject...>,'common_elements':<generatorobject...>,'line':<generatorobject...>,'line_pattern':<generatorobject...>,'map_background_and_string_elements':<generatorobject...>,'markers':<generatorobject...>,'other_parameters':<generatorobject...>,'point':<generatorobject...>,'polygon':<generatorobject...>,'polygon_pattern':<generatorobject...>,'raster':<generatorobject...>,'shield':<generatorobject...>,'symbolizers':<generatorobject...>,'text':<generatorobject...>,'torque_properties':<generatorobject...>,'values':<generatorobject...>}All properties contains the attributesdefaultDefault value.descriptionDescription.idIdentificator.linkLink to the property on documentation.nameName of the property.sampleExample of use.typeValue data type. For a complete list seecartocss_data_types.and if the data type iskeywordcontains an additional attributevariantsPossible values for the property.>>>pprint(list(doc["polygon"]))[{'default':'gray','description':'The fill color assigned to a polygon.','id':'polygon-fill-color','link':'https://carto.com/developers/styling/cartocss/#polygon-fill-color','name':'polygon-fill','sample':'polygon-fill: rgba(128, 128, 128, 1);','type':'color'},{'default':'1','description':'The opacity of the polygon.','id':'polygon-opacity-float','link':'https://carto.com/developers/styling/cartocss/#polygon-opacity-float','name':'polygon-opacity','sample':'polygon-opacity: 1;','type':'float'},...,{'default':'power','description':'An anti-grain geometry method that represents a 2D rendering ''library, specific to controlling the quality of antialiasing ''and used to calculate pixel gamma (pow(x,gamma), which ''produces slightly smoother line and polygon antialiasing '"than the 'linear' method.",'id':'polygon-gamma-method-keyword','link':'https://carto.com/developers/styling/cartocss/#polygon-gamma-method-keyword','name':'polygon-gamma-method','sample':'polygon-gamma-method: power;','type':'keyword','variants':['power','linear','none','threshold','multiply']},...]All data types can be requested withcartocss_data_typesfunction:>>>fromcartocss_doc_parserimportcartocss_data_types>>>pprint(list(cartocss_data_types()))['color','float','uri','string','boolean','expression','numbers','number','percentages','percentage','functions','function','keyword','unsigned','tags']Documentation#cartocss_doc(url="https://carto.com/developers/styling/cartocss/",user_agent="cartocss_doc_parser vX.Y.Z") ⇒dictProvides information for almost every section of CartoCSS documentation.url(str) URL to the documentation page. Can be a local file, in which
case any HTTP request would be performed, instead the file would be read.user_agent(str) User agent performing the HTTP request to documentation
page. As default iscartocss_doc_parser (v%(version)s).#cartocss_data_types(url="https://carto.com/developers/styling/cartocss/",user_agent="cartocss_doc_parser vX.Y.Z") ⇒genLists all available data types for properties for CartoCSS.url(str) URL to the documentation page. Can be a local file, in which
case any HTTP request would be performed, instead the file would be read.user_agent(str) User agent performing the HTTP request to documentation
page. As default iscartocss_doc_parser (v%(version)s).