Provides user-friendly unified resource locator (URL) client with nothing but clean objects.
- python 3.6, 3.7, 3.8
To obtain the latest package from PYPI, please run the following script:
pip install uurl
✨ 🍰 ✨
>>> from uurl import Host, HttpsUrl, UrlPath
>>> url = HttpsUrl(Host('example.com'), UrlPath('shelter', 'index.html'))
>>> url.matcher()
'shelter/index.html'
>>> url.host()
'example.com'
>>> url.host(with_port=True)
'example.com:443'
>>> str(url)
'https://example.com:443/shelter/index.html'
>>> from uurl import Host, NetworkProtocol, NetworkPort, Url, UrlPath
>>> url = Url(
... Host('0.0.0.0'),
... NetworkProtocol('http', NetworkPort(8080, has_upd=True, has_tcp=True)),
... UrlPath('api', 'rest', '1001')
... )
>>> url.matcher()
'api/rest/1001'
>>> url.host()
'0.0.0.0'
>>> url.host(with_port=True)
'0.0.0.0:8080'
>>> str(url)
'http://0.0.0.0:8080/api/rest/1001'
Generally, pytest
tool is used to organize testing procedure.
Please follow next command to run unittests:
pytest
Project has Travis CI integration using .travis.yml file thus code analysis (black
, pylint
, flake8
, mypy
, pydocstyle
and interrogate
) 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.sh
Please check changelog file to get more details about actual versions and it's release notes.
Author – Volodymyr Yahello. Please check authors file for more details.
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
git
for the first time after cloning with yourname
andemail
pip install -r requirements.txt
to install all project dependenciespip install -r requirements-dev.txt
to 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.