Skip to main content

The most up-to-date version of this README is on GitHub.

pygal_maps_world_neo

This is a fork of the seemingly unmaintained pygal_maps_world (last commit in July 2015), initially updated with the fixes Antoine Dusséaux (@a455bcd9) proposed in the original's PR #5 (early 2021) + some additional fixes and improvements (see CHANGELOG).

In the spirit of respecting the preferences of pygal's authors, this repository has no type hints or type stubs. You can get those by installing pygal_maps_world_neo-stubs alongside pygal-stubs for the rest of pygal. Both of those packages will be published very soon.

Installation and usage

To install, simply do pip install pygal_maps_world_neo (or however you install packages from PyPI. This will also install pygal.)

After that, we recommend using it like this instead of how pygal's docs suggest:

from pygal_maps_world import World
worldmap_chart = World()
worldmap_chart.title = 'Some countries'
worldmap_chart.add('F countries', ['fr', 'fi'])
worldmap_chart.add('M countries', ['ma', 'mc', 'md', 'me', 'mg',
                                   'mk', 'ml', 'mm', 'mn', 'mo',
                                   'mr', 'mt', 'mu', 'mv', 'mw',
                                   'mx', 'my', 'mz'])
worldmap_chart.add('U countries', ['ua', 'ug', 'us', 'uy', 'uz'])
worldmap_chart.render()

While you can still use it how the docs suggest (importing World from pygal.maps.world) and it will work fine at runtime, this will break type checking when using the stubs. Static type checkers cannot tell that pygal imports all installed maps dynamically at runtime, so everything will be Unknown. If you do not type-check your code, do whatever approach you prefer, but if you want type-checking you must use this as shown above.

Contributing

PRs are welcome. Please follow the rules:

  • Do not break the existing API in any way. If you want to add new features, please do so in a backward-compatible way. This fork should be a drop-in replacement for the original.
  • Type checking-related changes will soon be/are welcome in pygal_maps_world_neo-stubs, but not here (see above).
  • Review all AI-generated code.

To work on this project:

  1. Install Hatch if you don't have it already. This fork has migrated from setup.py to Hatchling.
  2. Fork this repository and clone it.
  3. Make a new branch for your changes.
  4. Run hatch shell. This will create a virtual environment, activate it, and install all of the dependencies (pygal itself + dev dependencies pytest, pyquery and black). Use that shell exclusively while working
  5. Make your changes. Once you're done, run hatch run check:all to test your code with pytest and autoformat with black.
  6. Commit, push and open a PR asking to merge your fork's branch into this repository's master branch.
  7. Leave your hatch shell by using exit (not deactivate!)

To-do list

I'll add these fixes myself once I find the time. If you want to help, please open a PR with your changes. Thanks!

High-ish priority

  • Make it so that the 1 value does not appear in maps where it is not needed, e.g. in maps like this one incorrect1.png
  • Fix the label that appears on hover, which after updating the SVG seems to be completely broken and I've haven't been able to fix it yet. The label instead of appearing on top of the country, it sometimes appears very far away from it, like in this example malawi.png

Low priority

  • Add more constants to the i18n module, e.g. ASEAN, MERCOSUR, EU, etc.
  • (veery low priority as I know it'll be a mess to implement) add the ability for maps to have both countries and supranational groups, e.g. a map that shows the entire EU in one color while showing every other country as separate.
  • Any other improvements you can think of. If you want to help, please open a PR with your changes. Thanks!

Metadata

Release files for pygal_maps_world_neo 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygal_maps_world_neo 1.1.2
File Size Uploaded
pygal_maps_world_neo-1.1.2.tar.gz 132.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygal_maps_world_neo 1.1.2
File Interpreter ABI Platform
pygal_maps_world_neo-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 263.3 kB

Release files / pygal_maps_world_neo-1.1.2.tar.gz

Download URL pygal_maps_world_neo-1.1.2.tar.gz
Size 132.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0da9f6ce640c6524b6811dda6b3ec3b23bfe8ec387783ea030abba93167e76bc
BLAKE2b-256 checksum
How to use checksums
f3addb67009aa544e5caeaa3437df3a9c8781266e3f38ecfb4c9911de6393675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.0 {"ci":null,"cpu":"x86_64","distro":{"id":"zena","libc":{"lib":"glibc","version":"2.39"},"name":"Linux Mint","version":"22.3"},"implementation":{"name":"CPython","version":"3.12.3"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.12.3","system":{"name":"Linux","release":"7.0.0-31-generic"}} HTTPX2/2.12.0

Release files / pygal_maps_world_neo-1.1.2-py3-none-any.whl

Download URL pygal_maps_world_neo-1.1.2-py3-none-any.whl
Size 131.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91583fc792b023667290bcd4dc5168e4b2eb7982ba51ba86e37c02823381b8de
BLAKE2b-256 checksum
How to use checksums
107a2ade70858ea0807e853929c72cee4dc3cf81ff23beda48406ffdb45f113f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.0 {"ci":null,"cpu":"x86_64","distro":{"id":"zena","libc":{"lib":"glibc","version":"2.39"},"name":"Linux Mint","version":"22.3"},"implementation":{"name":"CPython","version":"3.12.3"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.12.3","system":{"name":"Linux","release":"7.0.0-31-generic"}} HTTPX2/2.12.0

Release history Release notifications | RSS feed

1.1.3

2 release files

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page