Provides user-friendly micro HTTP client with nothing but clean objects. Inspired by Elegant Object (EO) - https://www.elegantobjects.org.
Basically, it is a wrapper over requests python library. For asynchronous version please check aiorequest package.
- python 3.6, 3.7, 3.8
- requests library
- travis CI
- pytest framework
- black code formatter
- mypy static tyler
- pylint code style
- flake8 code formatter
- bats framework
Please run following script to obtain latest package from PYPI:
pip install urequest
β¨ π° β¨>>> from urequest.session import Session, HttpSession
>>> from urequest.response import Response
>>> from urequest.url import HttpUrl
>>>
>>> session: Session
>>> with HttpSession() as session:
... response: Response = session.get(
... HttpUrl(host="xkcd.com", path="info.0.json")
... )
... response.status()
... response.as_json()
...
<HTTPStatus.OK: 200>
{
"month": "3",
"num": 2284,
"link": "",
"year": "2020",
"news": "",
"safe_title": "Sabotage",
"transcript": "",
"alt": "So excited to see everyone after my cruise home from the World Handshake Championships!",
"img": "https://imgs.xkcd.com/comics/sabotage.png",
"title": "Sabotage",
"day": "23",
}git clone [email protected]:vyahello/urequest.git
python setup.py installOr using specific release:
pip install git+https://github.com/vyahello/[email protected]git clone [email protected]:aiopymake/aiorequest.git>>> import urequest
>>> urequest.__doc__
'Provides user-friendly HTTP client with clean objects.'Please move
analyse-source-code.shscript into.git/hooks/pre-commitfile to be able to check your code on every next commit.
mv analyse-source-code.sh .git/hooks/pre-commitProject has Travis CI integration using .travis.yml file thus code analysis (black, pylint, flake8, mypy, pydocstyle) and unittests (pytest) will be run automatically after every made change to the repository.
To be able to run code analysis, please execute command below:
./analyse-source-code.shIn addition, a project uses bats framework to test package workability.
Please run the following command to launch package tests:
bats test-package.batsPlease check changelog file to get more details about actual versions and it's release notes.
Author β Volodymyr Yahello. Please check AUTHORS file for all contributors.
Distributed under the MIT license. See LICENSE for more information.
You can reach out me at:
- [email protected]
- https://twitter.com/vyahello
- https://www.linkedin.com/in/volodymyr-yahello-821746127
I would highly appreciate any contribution and support. If you are interested to add your ideas into project please follow next simple steps:
- Clone the repository
- Configure
gitfor the first time after cloning with yournameandemail pip install -r requirements.txtto install all project dependenciespip install -r requirements-dev.txtto install all development project dependencies- Create your feature branch (
git checkout -b feature/fooBar) - Commit your changes (
git commit -am 'Add some fooBar') - Push to the branch (
git push origin feature/fooBar) - Create a new Pull Request
All recent activities and ideas are described at project issues. If you have ideas you want to change/implement please do not hesitate and create an issue.
