Skip to main content

WikiRate for Python!

Project description

https://img.shields.io/pypi/v/wikirate4py?label=PyPI https://img.shields.io/pypi/pyversions/wikirate4py?label=Python https://readthedocs.org/projects/wikirate4py/badge/?version=latest

Installation

The easiest way to install the latest version from PyPI is by using pip:

$ pip install wikirate4py

You can also use Git to clone the repository from GitHub to install the latest development version:

$ git clone https://github.com/wikirate/wikirate4py.git
$ cd wikirate4py
$ pip install .

Alternatively, install directly from the GitHub repository:

$ pip install git+https://github.com/wikirate/wikirate4py.git

Python 3.6 - 3.9 are supported.

Usage

wikirate4py makes it trivial to interact with WikiRate’s API:

>>> from wikirate4py import API
>>> api = API('your_api_token')
>>> company = api.get_company(7217) # returns company given company's numeric identifier
>>> company.name
'Adidas AG'
>>> company.headquarters
'Germany'

DataFrames

The 1.0.5 version of wikirate4py library allows users to transform WikiRateEntity objects to DataFrames. A usage example can be found below:

from wikirate4py import API
api = API('your_api_token')
cursor = wikirate4py.Cursor(api.get_answers,
                            metric_name="Revenue EUR",
                            metric_designer="Clean Clothes Campaign",
                            year=2020)
answers = []
while cursor.has_next():
    answers += cursor.next()

print(to_dataframe(answers).to_string())

Contributing

Bug reports, feature suggestions requests are welcome on GitHub at https://github.com/wikirate/wikirate4py/issues.

License

The library is available as Open Source under the terms of the GNU General Public License v3 (GPLv3).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wikirate4py-1.1.0.tar.gz (28.0 kB view details)

Uploaded Source

File details

Details for the file wikirate4py-1.1.0.tar.gz.

File metadata

  • Download URL: wikirate4py-1.1.0.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.2

File hashes

Hashes for wikirate4py-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ed50ff52d264cdee1305580e4a66b9f9346cb36ba997ae6d19aa50df764ae769
MD5 0f2e9da8c1dd3fbb20d3172dad6f85ef
BLAKE2b-256 29096236f9395f77ad6a84b5b82f75abad9f8460a34da108ede4bda177ec434b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page