Worldometer v1.0.0
matheusfelipeog
released this
19 Feb 18:59
·
174 commits
to master
since this release
Release 1.0.0
This is first stable version of worldometer module 🎉
Features
- Now the old attribute
metrics
ofWorldometer
class is a method:
>>> from worldometer import Worldometer
>>> w = Worldometer()
>>> w.metrics()
[
7845087963,
15741371,
5676,
6608605,
2383,
9132766,
...
]
- Return dict structure in all functions of
worldometer.api
submodule:
>>> 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:
"""
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:
"""
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: