Skip to content

Commit 27cf28b

Browse files
author
BD103
committed
feat: framework
1 parent 85cd35d commit 27cf28b

7 files changed

Lines changed: 46 additions & 0 deletions

File tree

.flake8

Whitespace-only changes.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
> **Notice:** Currently this project is just a framework. It does not work yet.
2+
> If you wan't to get updated when 1.0.0 is released, then click Watch -> Custom -> Releases -> Apply
3+
14
[![Contributors][contributors-shield]][contributors-url]
25
[![Forks][forks-shield]][forks-url]
36
[![Stargazers][stars-shield]][stars-url]

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ black = "^21.5b1"
1818
[build-system]
1919
requires = ["poetry>=0.12"]
2020
build-backend = "poetry.masonry.api"
21+
22+
[tool.isort]
23+
profile = "black"
24+
multi_line_output = 3

replapi_it/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""ReplAPI-it is a project originally started in Node.js by RayhanADev.
2+
This is a Python flavor which intends to mimic the same functions and classes.
3+
"""
4+
5+
from .core import ReplAPI # noqa: F401

replapi_it/core.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from .post import _Post
2+
from .user import _User
3+
4+
defaultInitVars = {"username": None}
5+
6+
7+
class ReplAPI(object):
8+
"""Base class for all ReplAPI-it features.
9+
Everything should be accessed through this class.
10+
Do not import anything else unless you know what you are doing."""
11+
12+
def __init__(self, initVars: dict = {}):
13+
self.vars = {**defaultInitVars, **initVars}
14+
15+
self.User = _User
16+
self.Post = _Post

replapi_it/post.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class _Post(object):
2+
def __init__(self, num: int):
3+
"""Get post data."""
4+
self.num = num
5+
6+
def postDataFull(self) -> dict:
7+
# Grab post data, return dict
8+
example = {"title": "Some title here"}
9+
return example

replapi_it/user.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class _User(object):
2+
def __init__(self, username: str):
3+
"""Get user data."""
4+
self.username = username
5+
6+
def userGraphQLDataFull(self) -> dict:
7+
# Grab data, return info
8+
example = {"karma": 102}
9+
return example

0 commit comments

Comments
 (0)