A simple API client for connecting to remote services.
Project description
Api Client
A simple API client for connecting to remote services.
Installation
Install and update using pipenv
pip install -U simple-api-client
Simple usage
from api_client import ApiClient
from logging import Logger
logger = Logger("simple-logger", level="DEBUG")
client = ApiClient("http://www.example.com", logger)
response = client.get("/example/endpoint")
if response.status_code == 200:
print(response.data)
Development
The build pipeline require your tests to pass and code to be formatted
Make sure you have Python 3.x installed on your machine (use pyenv).
Install the dependencies with pipenv (making sure to include dev and pre-release packages):
pipenv install --dev --pre
Configure your environment:
pipenv shell && export PYTHONPATH="$PWD"
Run the tests:
pytest
Or with logging:
pytest -s
Or tests with coverage:
pytest --cov=./
Format the code with Black:
black $PWD
Releases
Cleanup the (.gitignored) dist
folder (if you have one):
rm -rf dist
Notch up the version number in setup.py
and build:
python3 setup.py sdist bdist_wheel
Push to PyPi (using the ScholarPack credentials when prompted)
python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
Links
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
Hashes for simple_api_client-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3de34f205fdc0d5d101b72cfd1c46c6b556912605e3112f2130fb1ca116871a1 |
|
MD5 | 300806771a1aa7b8ac22431dad2cc136 |
|
BLAKE2b-256 | 57561f8327b1a44036557b9bcd2e65b5af82e22804a75e19ed9249ca13817172 |