A set of utilities for efficiently querying the ORES api.
Project description
# ORES API
This repo contains a python package called “oresapi”. This package makes it straightforward to query the ORES API in a performant way.
# Examples
## CLI ` $ echo -e '{"rev_id": 123456}\n{"rev_id": 234567}' | ./utility score_revisions https://ores.wikimedia.org "example@email.org" enwiki damaging goodfaith 2020-04-23 09:58:18,547 INFO:oresapi.utilities.score_revisions -- Reading input from <stdin> 2020-04-23 09:58:18,547 INFO:oresapi.utilities.score_revisions -- Writing output to from <stdout> {"score": {"damaging": {"score": {"probability": {"false": 0.8895027179951033, "true": 0.11049728200489672}, "prediction": false}}, "goodfaith": {"score": {"probability": {"false": 0.0379063620644855, "true": 0.9620936379355145}, "prediction": true}}}, "rev_id": 123456} {"score": {"damaging": {"score": {"probability": {"false": 0.980325356782424, "true": 0.01967464321757594}, "prediction": false}}, "goodfaith": {"score": {"probability": {"false": 0.011545340309922048, "true": 0.988454659690078}, "prediction": true}}}, "rev_id": 234567} `
## Python ` >>> from oresapi import Session >>> >>> my_session = Session( ... "https://ores.wikimedia.org", ... user_agent="Demonstrating how to use Session - my_address@email.com") >>> >>> rev_ids = [12345, 678910] >>> results = my_session.score("enwiki", ["damaging", "goodfaith"], rev_ids) >>> >>> for rev_id, result in zip(rev_ids, results): ... print(rev_id, result) ... 12345 {'goodfaith': {'score': {'prediction': True, 'probability': {'true': 0.9454305247958957, 'false': 0.05456947520410427}}}, 'damaging': {'score': {'prediction': False, 'probability': {'true': 0.1774477630070302, 'false': 0.8225522369929699}}}} 678910 {'goodfaith': {'score': {'prediction': True, 'probability': {'true': 0.9971569940025945, 'false': 0.002843005997405501}}}, 'damaging': {'score': {'prediction': False, 'probability': {'true': 0.008388045944843079, 'false': 0.9916119540551569}}}} `
# Author * Aaron Halfaker - https://github.com/halfak
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file oresapi-0.1.0.tar.gz
.
File metadata
- Download URL: oresapi-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.15.0 CPython/3.5.1+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cfad8ca6a2bfa66f8ce2b8e64cbaa36542ff15857467ed5c0053a922977adf4 |
|
MD5 | 250c8a53d6652ef83ca649fe7c8eb16b |
|
BLAKE2b-256 | 1ecda8c3042c08abcf23ae9e2b4fe5b252ff65ea09def9a629d2c1a69acefa84 |
File details
Details for the file oresapi-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: oresapi-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.15.0 CPython/3.5.1+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb16914854f7782555da8b71c2fbfac8634a455ff34def44bfdfe0200a6c932e |
|
MD5 | c2f85461afc0fe15988e12f30cd2e1d0 |
|
BLAKE2b-256 | 5fb4cdb5455fd765cdc2802438d15f1d9577c372c87ba2a33685e22066bf705a |