Skip to main content

Wikirate for Python!

Project description

Wikirate4py: Wikirate for Python!

PyPI Python ReadTheDocs

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 easy 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
print(company.name)  # 'Adidas AG'
print(company.headquarters)  # 'Germany'

DataFrames

From version 1.2.0, the wikirate4py library allows users to transform WikirateEntity objects to DataFrames. Here is a usage example:

from wikirate4py import API
from wikirate4py.utils import to_dataframe

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())

Company Identifiers

From version 1.2.8, the wikirate4py library allows users to search companies by identifier. For example, if you know their Legal Entity Identifier (LEI) or one of their ISINs, you can search using the companies endpoint as shown below:

from wikirate4py import API
api = API('your_api_token')
companies = api.get_companies(company_identifier=["213800EJP14A79ZG1X44", "VGG1890L1076"]) # get companies that match any of the two given company identifiers
print(companies)

Example output:

[
    {
        "australian_business_number": null,
        "headquarters": "United Kingdom",
        "id": 9269,
        "isin": ["GB0031274896"],
        "lei": "213800EJP14A79ZG1X44",
        "name": "Marks and Spencer Group plc",
        "open_corporates": "00214436",
        "os_id": null,
        "sec_cik": null,
        "uk_company_number": null
    },
    {
        "australian_business_number": null,
        "headquarters": "United Kingdom",
        "id": 3152073,
        "isin": ["VGG1890L1076"],
        "lei": "549300LPG8W0H1OX3A26",
        "name": "Capri Holdings Ltd (formerly Michael Kors)",
        "open_corporates": "11308598",
        "os_id": null,
        "sec_cik": "1530721",
        "uk_company_number": null
    }
]

Contributing

Bug reports and feature suggestions 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).

🎉 Acknowledgements

This project was supported by NLnet foundation.

Image

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-2.0.7.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wikirate4py-2.0.7-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wikirate4py-2.0.7.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.2

File hashes

Hashes for wikirate4py-2.0.7.tar.gz
Algorithm Hash digest
SHA256 c7ed2991d1c1b7d8f6418e68cbfdfc8b9d137fb2e8cede847e3914392215b8bc
MD5 e39a4ec4d1b398cd5c54861f6db3840d
BLAKE2b-256 a64ef4ebf287c1dd966e7def7e0808aabbe71478e64d4d88f0f878a7d56468c9

See more details on using hashes here.

File details

Details for the file wikirate4py-2.0.7-py3-none-any.whl.

File metadata

  • Download URL: wikirate4py-2.0.7-py3-none-any.whl
  • Upload date:
  • Size: 33.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.2

File hashes

Hashes for wikirate4py-2.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 538095322b28f100ee632605b7422382569184555ba241b4e0dc2bbe6848bd90
MD5 6cdfa16834f01ad4b7f084bce3aac05f
BLAKE2b-256 585705cf4ad0cf33b84fcf55561bf6570182330d679966b00b6862b9aef9e63d

See more details on using hashes here.

Supported by

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