Skip to content

Commit fd5275a

Browse files
committed
Start building interface
1 parent 80cba19 commit fd5275a

File tree

6 files changed

+31
-1
lines changed

6 files changed

+31
-1
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pipfile-requirements = "*"
99
pylint = "*"
1010

1111
[packages]
12+
requests = "*"
1213

1314
[requires]
1415
python_version = "3.6"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pipenv install --dev
1717
Run tests in pipenv environment:
1818

1919
```shell
20-
pipenv run pytest
20+
pipenv run python3 -m pytest
2121
```
2222

2323
Tests require a SCUTTLE API key with full permissions. This key should be the

scuttle/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .wrapper import scuttle

scuttle/api_1.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env python3
2+
3+
"""Provides generic methods for accessing version 1 of the API."""

scuttle/wrapper.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python3
2+
3+
"""Provides methods to interface with a given API instance."""
4+
5+
import requests
6+
7+
def scuttle(wiki, api_version=None):
8+
"""Create a new API wrapper for a given wiki and API version.
9+
10+
str `wiki`: The domain of the wiki.
11+
int `api_version`: The version of the API to use. If not provided, defaults
12+
to latest.
13+
"""
14+

test/test_api.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env python3
2+
3+
import pytest
4+
import scuttle
5+
6+
TOKEN = None
7+
with open("token.secret.txt", 'r') as token_file:
8+
TOKEN = token_file.readline().strip()
9+
10+
def test_something():
11+
wiki = scuttle.scuttle('en', 1)

0 commit comments

Comments
 (0)