CartoCSS documentation parser.
Project description
cartocss-doc-parser
CartoCSS documentation parser.
Install
pip install cartocss-doc-parser
Quickstart
The main function cartocss_doc
returns a dictionary with almost every section of the documentation. All the properties are wrapped in generators.
> from pprint import pprint
> from cartocss_doc_parser import cartocss_doc
>
> doc = cartocss_doc()
> pprint(doc)
{'building': <generator object ...>,
'common_elements': <generator object ...>,
'line': <generator object ...>,
'line_pattern': <generator object ...>,
'map_background_and_string_elements': <generator object ...>,
'markers': <generator object ...>,
'other_parameters': <generator object ...>,
'point': <generator object ...>,
'polygon': <generator object ...>,
'polygon_pattern': <generator object ...>,
'raster': <generator object ...>,
'shield': <generator object ...>,
'symbolizers': <generator object ...>,
'text': <generator object ...>,
'torque_properties': <generator object ...>,
'values': <generator object ...>}
All properties contains the attributes
default
Default value.description
Description.id
Identificator.link
Link to the property on documentation.name
Name of the property.sample
Example of use.type
Value data type. For a complete list see cartocss_data_types.
and if the data type is keyword
contains an additional attribute
variants
Possible 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']},
...
]
Documentation
# cartocss_doc(url="https://carto.com/developers/styling/cartocss/", user_agent="cartocss_doc_parser vX.Y.Z") ⇒ dict
Provides 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 is
cartocss_doc_parser (v%(version)s)
.
# cartocss_data_types(url="https://carto.com/developers/styling/cartocss/", user_agent="cartocss_doc_parser vX.Y.Z") ⇒ list
Lists 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 is
cartocss_doc_parser (v%(version)s)
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cartocss-doc-parser-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d7605c81c02ddc3a2ca2e7ef1bbfc13cb959123004e742116d161a97adfa452 |
|
MD5 | 90b8fe97aec6ce1c993f8ef6aff13091 |
|
BLAKE2b-256 | fe2d903d6340c8f54c2a8cd645bb944c1158fb1b5660faf4383b0db046f8e70e |
Hashes for cartocss_doc_parser-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28dfa6a7b44d8f78458bb5d49e1714b48c7f2b7a4e90c9af3f2e8949de3b682e |
|
MD5 | 1b76ac5f51d2653aa17b5fd21d919b0b |
|
BLAKE2b-256 | 79ecaeb58d66b1e114ce0a1d713df7d36bf03aa0fae7c569bdedbd82e88292f6 |