pygieons documentation#

What is pygieons?#

The name (you would anyway ask πŸ˜‰): Python GIS and Earch Observation Networks

As described elsewhere, this website is largely generated automatically by using a Python tool called pygieons. This tool auto-generates content regarding the listed packages and adds them to the website either as tables or interactive Network visualizations. pygieons is currently focused on parsing information about Python GIS and Earth Observation libraries, but it is a rather generic tool, with modest modifications it would be possible to parse and visualize information from any collection of libraries available on PyPi.

pygieons is largely based on pandas which is used for data manipulation, while pyvis library is used to visualize the connections between libraries as an interactive network of links. In addition, under the hood libraries such as requests, beautifulsoup4 and pypistats are used to extract relevant information about the listed libraries from the PyPi web pages.

Below, we demonstrate some basic functionalities that can be used to auto-generate content using pygieons.

Basic usage#

Initializing the tool#

To generate content with pygieons, you need to first initialize the tool with Ecosystem() object which accepts a parameter plot_type that can be used to define which category of libraries we want to plot, and parameter log which can be used to disable logging to the screen. Below is the slightly modified output from help(Ecosystem) command showing information about how the tool can be initialized:

class Ecosystem(builtins.object)
 |  Ecosystem(plot_type='all', keep_all=False, log=True)
 |        
 |      Parameters
 |      ==========
 |      
 |      plot_type : str
 |          This can be used to specify if you want to plot all packages in same figure, or only vector or raster.
 |          Possible values are: "all", "vector", "raster", "generic", "vector+generic", "raster+generic".
 |      keep_all : bool
 |          If True, also packages that are not available from PyPi or which are not maintained will be kept.
 |      log: bool
 |          If True, will print messages during process.
  • Let’s initialize the tool and configure it for plotting raster libraries.

from pygieons import Ecosystem

# Initialize the tool 
e = Ecosystem(plot_type="raster", log=True)

Generating tables#

To generate a table showing various information about the libraries, you can use method prepare_table(), which autogenerates the table contents based on the packages listed in ecosystem_connections.py and ecosystem_pkgs.py files. The tool will print out information about the progress if log was specified as True:

# Generate the content
tbl = e.prepare_table()
Find out the number of monthly downloads from PyPi for the libraries ..
Extract project URLs ..
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 2
      1 # Generate the content
----> 2 tbl = e.prepare_table()

File ~/checkouts/readthedocs.org/user_builds/pythongis-ecosystem/envs/stable/lib/python3.10/site-packages/pygieons/pygieons.py:496, in Ecosystem.prepare_table(self, cols)
    493 self.nodes = prepare_html_links_and_badges(self.nodes)
    495 # Prepare table
--> 496 return Table(prepare_table_plot(self.nodes, cols))

File ~/checkouts/readthedocs.org/user_builds/pythongis-ecosystem/envs/stable/lib/python3.10/site-packages/pygieons/pygieons.py:300, in prepare_table_plot(nodes, cols)
    296 if "Documentation" in cols:
    297     align_center_cols.append("Documentation")
    299 return HTML(nodes[cols].style.set_properties(subset=align_center_cols, **{"text-align": "center"})
--> 300             .hide_index()
    301             .to_html()
    302             )

AttributeError: 'Styler' object has no attribute 'hide_index'
  • You can visualize the table by calling .show() of the returned Table object:

tbl.show()
Analysis / modelling (count=9)
Name Homepage Info License PyPi version PyPi downloads (monthly) Conda-forge version Conda-forge downloads Conda-forge latest release
gstools 🏠 β“˜ License PyPI version 2,063 Conda version Conda downloads Conda latest release
pykrige 🏠 β“˜ License PyPI version 18,550 Conda version Conda downloads Conda latest release
pysheds 🏠 β“˜ License PyPI version 921 Conda version Conda downloads Conda latest release
pyspatialml 🏠 β“˜ NA PyPI version 95 NA NA NA
rasterstats 🏠 β“˜ License PyPI version 61,296 Conda version Conda downloads Conda latest release
richdem 🏠 β“˜ License PyPI version 2,129 Conda version Conda downloads Conda latest release
scikit-learn 🏠 β“˜ License PyPI version 33,204,319 Conda version Conda downloads Conda latest release
spyndex 🏠 β“˜ License PyPI version 356 Conda version Conda downloads Conda latest release
xarray-spatial 🏠 β“˜ License PyPI version 2,074 Conda version Conda downloads Conda latest release
Core / data structures (count=8)
Name Homepage Info License PyPi version PyPi downloads (monthly) Conda-forge version Conda-forge downloads Conda-forge latest release
affine 🏠 β“˜ License PyPI version 673,504 Conda version Conda downloads Conda latest release
iris 🏠 β“˜ License PyPI version 951 Conda version Conda downloads Conda latest release
rasterio 🏠 β“˜ License PyPI version 755,843 Conda version Conda downloads Conda latest release
rio-cogeo 🏠 β“˜ License PyPI version 12,869 Conda version Conda downloads Conda latest release
rioxarray 🏠 β“˜ License PyPI version 36,151 Conda version Conda downloads Conda latest release
sarpy 🏠 β“˜ License PyPI version 943 Conda version Conda downloads Conda latest release
sarsen 🏠 β“˜ License PyPI version 54 Conda version Conda downloads Conda latest release
xarray 🏠 β“˜ License PyPI version 1,705,385 Conda version Conda downloads Conda latest release
Data extraction / processing (count=21)
Name Homepage Info License PyPi version PyPi downloads (monthly) Conda-forge version Conda-forge downloads Conda-forge latest release
earthengine-api 🏠 β“˜ License PyPI version 36,212 Conda version Conda downloads Conda latest release
easystac 🏠 β“˜ License PyPI version 110 Conda version Conda downloads Conda latest release
eemont 🏠 β“˜ License PyPI version 700 Conda version Conda downloads Conda latest release
lidar 🏠 β“˜ License PyPI version 283 Conda version Conda downloads Conda latest release
odc-stac 🏠 β“˜ License PyPI version 986 Conda version Conda downloads Conda latest release
planetary-computer 🏠 β“˜ License PyPI version 2,795 Conda version Conda downloads Conda latest release
pymap3d 🏠 β“˜ License PyPI version 41,451 Conda version Conda downloads Conda latest release
pyrosar 🏠 β“˜ License PyPI version 491 Conda version Conda downloads Conda latest release
pystac 🏠 β“˜ License PyPI version 32,119 Conda version Conda downloads Conda latest release
pystac-client 🏠 β“˜ License PyPI version 9,842 Conda version Conda downloads Conda latest release
radiant-mlhub 🏠 β“˜ License PyPI version 5,836 Conda version Conda downloads Conda latest release
rio-hist 🏠 β“˜ NA PyPI version 364 NA NA NA
rio-mucho 🏠 β“˜ License PyPI version 8,847 Conda version Conda downloads Conda latest release
rio-tiler 🏠 β“˜ License PyPI version 8,237 Conda version Conda downloads Conda latest release
salem 🏠 β“˜ License PyPI version 5,834 Conda version Conda downloads Conda latest release
satpy 🏠 β“˜ License PyPI version 3,498 Conda version Conda downloads Conda latest release
sentinelsat 🏠 β“˜ License PyPI version 12,394 Conda version Conda downloads Conda latest release
stackstac 🏠 β“˜ License PyPI version 1,235 Conda version Conda downloads Conda latest release
verde 🏠 β“˜ License PyPI version 731 Conda version Conda downloads Conda latest release
xarray-sentinel 🏠 β“˜ License PyPI version 79 Conda version Conda downloads Conda latest release
xyzservices 🏠 β“˜ License PyPI version 165,745 Conda version Conda downloads Conda latest release
Visualization (count=3)
Name Homepage Info License PyPi version PyPi downloads (monthly) Conda-forge version Conda-forge downloads Conda-forge latest release
contextily 🏠 β“˜ License PyPI version 71,077 Conda version Conda downloads Conda latest release
rio-color 🏠 β“˜ License PyPI version 8,170 Conda version Conda downloads Conda latest release
xarray_leaflet 🏠 β“˜ License PyPI version 1,026 Conda version Conda downloads Conda latest release

Generating Network visualization#

To generate an interactive network visualization showing the connections between libraries, you can use method prepare_net(), which autogenerates the Network based on the packages listed in ecosystem_connections.py file. The tool will print out information about the progress if log was specified as True:

# Generate the content
net = e.prepare_net()
  • You can visualize the network by calling .show() of the returned Network object

net.show()

  • In addition, you can also save the Network visualization as a HTML file to your own computer by calling .save() method:

net.save("test.html")