{ "info": { "author": "PaddyAlton", "author_email": "paddy.alton@apolitical.co", "bugtrack_url": null, "classifiers": [], "description": "# apolitical-data-viz\n\nThis module defines the Apolitical (https://apolitical.co) 'house style' for data visualisation and provides various tools for plotting data. It is intended to be compatible with Google Colab.\n\nWe build heavily upon the foundations of [matplotlib](https://matplotlib.org/) and utilities provided by [seaborn](https://seaborn.pydata.org/), and aim for compatibility with [pandas](https://pandas.pydata.org/).\n\n## Installation\n\nTo install from the command line via [pip](https://pip.pypa.io/en/stable/), do:\n\n`pip install apolitical-data-viz`\n\nTo upgrade to the latest version via `pip` do:\n\n`pip install easy-geoparsing --upgrade`\n\nTo use via [pipenv](https://docs.pipenv.org/en/latest/) put the following in your Pipfile:\n\n```\n[packages]\napolitical-data-viz = \">=1.0.0\"\n```\n\n## Development\n\nIf you've cloned the repository, the best way to make it work is using `pipenv`\n\nIf you don't yet have `pipenv`, you can use `pip` to install it from the command line:\n\n`pip install pipenv --upgrade`\n\nThen, in the top level directory of this repository, `easy-geoparsing`, do:\n\n`pipenv install --dev`\n\nThis will create the virtual environment and install the requirements (viewable in the Pipfile). The `--dev` flag will install packages needed for testing etc.\n\n## Usage\n\nTo import the module, do the following:\n\n`import apol_dataviz`\n\nor e.g.\n\n`import apol_dataviz as adv`\n\nThis provides a variety of resources (they can also be imported separately, as demonstrated in the next example).\n\n### Applying the house style\n\nThe simplest usage is to simply enforce the house style. In order to do this, do the following:\n\n```\nfrom apol_dataviz import style\nstyle.use_apol_style()\n```\n\nThis will create a number of new matplotlib colour aliases as well as some new named colourmaps. Note that if you are using Google Colab, we anticipate that the Lato font will be missing and so we download the relevant `.ttf` files. This functionality relies on a check that `google-colab` is in the `sys.modules` list. If it is not, nothing is downloaded (you should ensure the Lato font is installed in your local `/matplotlib/mpl-data/fonts/ttf/` directory in this case, else matplotlib will fall back on the default font).\n\n### Accessing the colour definitions\n\nIf you don't want to enforce the full style, but do want to access our colour definitions, do the following:\n\n```\nfrom apol_dataviz.colours import ColourDefinitions\n\ncd = ColourDefinitions()\n\ncd.apply_definitions() # this command sets up the matplotlib aliases\n```\n\nThe `ColourDefinitions` class contains the definitions of a wide variety of colours used in our visualisations. Its `apply_definitions()` method sets up the aliases for these in matplotlib.\n\n### Using the custom plot utilities\n\nWe provide a number of different functions for plotting custom charts. These are accessible via the `plots` resource. These are intended to be compatible with pandas Series and DataFrames\n\n```\nfrom apol_dataviz.plots import doughnut, hbarplot\n\naxis = doughnut(pandas_series)\naxis = hbarplot(pandas_series)\n```\nThe above commands would make nicely formatted doughnut (donut) plots and horizontal bar plots respectively.\n\n### Formatting plots\n\nIn many cases we may want to format a plot in a particular way, and for this purpose we provide formatters that either alter the formatting of a particular plot or act as a utility for doing so.\n\nAs an example:\n\n```\nfrom apol_dataviz import formatters\n\nnew_tick_labels = formatters.get_ts_tick_labels(pandas_timeseries)\n```\n\nThis creates well-formatted tick labels for a datetime-indexed pandas time series.\n\n### Using the palette generators\n\nWe make available a number of functions for generating palettes of specific types.\n\nTo give a couple of examples:\n\n```\nfrom apol_dataviz import palette_generators as palgen\n\neasy_sequential = palgen.apol_teal_pal()\n\ncategorical_via_HuSL = palgen.spaced_hue_palette()\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/apolitical/apolitical-data-viz/archive/v1.0.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "apolitical-data-viz", "package_url": "https://pypi.org/project/apolitical-data-viz/", "platform": "", "project_url": "https://pypi.org/project/apolitical-data-viz/", "project_urls": { "Download": "https://github.com/apolitical/apolitical-data-viz/archive/v1.0.0.tar.gz" }, "release_url": "https://pypi.org/project/apolitical-data-viz/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Styleguide/utilities for plotting data in the style of apolitical.co", "version": "1.0.0" }, "last_serial": 5301903, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8ae447ae20e2b7cbb9775a90a50eb661", "sha256": "49c368b484aefe3553e92239aca9fd9a60aa9316a490da90383d874238ac47f3" }, "downloads": -1, "filename": "apolitical-data-viz-0.0.1.tar.gz", "has_sig": false, "md5_digest": "8ae447ae20e2b7cbb9775a90a50eb661", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11968, "upload_time": "2019-05-21T16:53:15", "url": "https://files.pythonhosted.org/packages/34/e2/ec2269e044b45df12268b113c3c095686c7e8f99c76a349d295fbecf162d/apolitical-data-viz-0.0.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "ee114c83dce7115f87e4b27763a18be4", "sha256": "a4a8a94c80e0837b5fccb45119cfab7eeb85fe98b6a5ddddb8350258e3cc2082" }, "downloads": -1, "filename": "apolitical-data-viz-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ee114c83dce7115f87e4b27763a18be4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11928, "upload_time": "2019-05-22T09:59:17", "url": "https://files.pythonhosted.org/packages/52/1f/a5e788da44800fc123d91ae1a81b84b78ff1d468b37d36c272495b5cef8a/apolitical-data-viz-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ee114c83dce7115f87e4b27763a18be4", "sha256": "a4a8a94c80e0837b5fccb45119cfab7eeb85fe98b6a5ddddb8350258e3cc2082" }, "downloads": -1, "filename": "apolitical-data-viz-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ee114c83dce7115f87e4b27763a18be4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11928, "upload_time": "2019-05-22T09:59:17", "url": "https://files.pythonhosted.org/packages/52/1f/a5e788da44800fc123d91ae1a81b84b78ff1d468b37d36c272495b5cef8a/apolitical-data-viz-1.0.0.tar.gz" } ] }