This is first stable version of worldometer module 🎉
Features
- **Now the old attribute `metrics` of `Worldometer` class is a method:**
python
>>> from worldometer import Worldometer
>>> w = Worldometer()
>>> w.metrics()
[
7845087963,
15741371,
5676,
6608605,
2383,
9132766,
...
]
- **Return dict structure in all functions of `worldometer.api` submodule:**
python
>>> from worldometer import api
>>> api.get_metric_of(label='computers_produced_this_year')
{'computers_produced_this_year': 27760858}
>>> api.current_world_population()
{'current_world_population': 7845085923}
- **Refactor all docstring in the module to make it more explicit and explanatory.**
Before in `worldometer.api` module:
python
"""
worldometer.api
---------------
Implement a simplified api of worldometer.Worldometer Class.
API usage:
>>> from worldometer import api
>>> api.current_world_population()
7845085923
>>> api.tweets_sent_today()
4539558
>>> api.get_metric_of(label='computers_produced_this_year')
27760858
More info in: github.com/matheusfelipeog/worldometer
"""
Now in `worldometer.api` module:
python
"""
worldometer.api
---------------
Implementation of a simplified API of the worldometer module.
Here you will find all the functions available to obtain the metrics separately.
Examples
--------
>>> from worldometer import api
All worldometer.api functions use the ``get_metric_of`` function at their core.
To use it, just enter the corresponding label:
>>> api.get_metric_of(label='computers_produced_this_year')
{'computers_produced_this_year': 27760858}
There is also a simplified and self-explanatory API that provides
functions corresponding to the labels.
Autocomplete tools from the editors/IDE will help you use these
functions without having to decorate all labels:
>>> api.current_world_population()
{'current_world_population': 7845085923}
>>> api.tweets_sent_today()
{'tweets_sent_today': 4539558}
"""
- **Created documentation with sphinx and hosting in [readthedocs.org](https://readthedocs.org):**
![image](https://user-images.githubusercontent.com/50463866/108547358-233b1680-72c9-11eb-8079-e5b948963084.png)