-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0a90bcd
Showing
10 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.mypy_cache | ||
.pytest_cache | ||
**/**.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Rest API Client (WIP) | ||
|
||
Come back later. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[metadata] | ||
name = rest-api-client | ||
version = 0.0.1 | ||
author = Paolo Rechia | ||
author_email = paolorechia at gmail dot com | ||
description = A | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
url = https://github.com:paolorechia/rest-api-client | ||
project_urls = | ||
Bug Tracker = https://github.com:paolorechia/rest-api-client/issues | ||
classifiers = | ||
Programming Language :: Python :: 3 | ||
License :: OSI Approved :: MIT License | ||
Operating System :: OS Independent | ||
|
||
[options] | ||
package_dir = | ||
= src | ||
packages = find: | ||
python_requires = >=3.8 | ||
install_requires = | ||
httpx==0.18.2 | ||
pydantic | ||
|
||
[options.packages.find] | ||
where = src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from setuptools import setup | ||
|
||
setup() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from typing import Iterable | ||
from pydantic import BaseModel | ||
from enum import Enum | ||
|
||
|
||
class HTTPMethod(Enum): | ||
GET = "get" | ||
DELETE = "delete" | ||
POST = "post" | ||
PUT = "put" | ||
PATCH = "patch" | ||
|
||
|
||
class Endpoint(BaseModel): | ||
path: str | ||
method: HTTPMethod | ||
model: BaseModel | ||
|
||
|
||
class RestAPI: | ||
def register_endpoints(self, endpoints: Iterable[Endpoint]): | ||
pass |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from rest_api_client.lib import RestAPI | ||
|
||
|
||
def test_rest_api(): | ||
api = RestAPI() | ||
assert api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# content of: tox.ini , put in same dir as setup.py | ||
[tox] | ||
envlist = py38 | ||
|
||
[testenv] | ||
deps = | ||
-rrequirements.txt | ||
mypy | ||
black | ||
flake8 | ||
pytest | ||
pytest-cov | ||
# run the tests | ||
# ... or run any other command line tool you need to run here | ||
commands = | ||
python3 -m mypy src | ||
python3 -m black src | ||
python3 -m flake8 src | ||
python3 -m pytest -vvv |