# 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
Metadata
Release files for oresapi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oresapi-0.1.0.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oresapi-0.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 14.1 kB
Release files / oresapi-0.1.0.tar.gz
| Download URL | oresapi-0.1.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2cfad8ca6a2bfa66f8ce2b8e64cbaa36542ff15857467ed5c0053a922977adf4
|
|
BLAKE2b-256 checksum How to use checksums |
1ecda8c3042c08abcf23ae9e2b4fe5b252ff65ea09def9a629d2c1a69acefa84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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+
|
Release files / oresapi-0.1.0-py2.py3-none-any.whl
| Download URL | oresapi-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
fb16914854f7782555da8b71c2fbfac8634a455ff34def44bfdfe0200a6c932e
|
|
BLAKE2b-256 checksum How to use checksums |
5fb4cdb5455fd765cdc2802438d15f1d9577c372c87ba2a33685e22066bf705a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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+
|