Skip to main content

Exchange rates service

Yandex last homework task. Realization of exchange rates service

Getting project from gitlab

Firstly you must download source code of project from gitlab repository

$ git clone https://gitlab.com/ExampleUserForYandex/last

and go inside project's folder

$ cd /path/to/cloned/project

Run project's tests

For run tests firstly activate virtual environment by:

$ source venv/bin/activate

and after that install requirements by:

$ (venv) pip3 install -r requirements.txt
$ (venv) pip3 install -r requirements.tests.txt

Now we can run tests

$ (venv) pytest test

If all is ok you'll get

=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.7.3, pytest-5.2.2, py-1.8.0, pluggy-0.13.0
rootdir: /path/to/cloned/project
plugins: aiohttp-0.3.0, aiomisc-9.4.1
collected 5 items                                                                                                                                                                                                 

test/test_rest.py ..                                                                                                                                                                                        [ 40%]
test/test_services.py .                                                                                                                                                                                     [ 60%]
test/test_updater.py ..                                                                                                                                                                                     [100%]

================================================================================================ 5 passed in 1.28s ================================================================================================

Collect python package

Firstly check setup.py file for may be some config changes (e.g. package name, version and etc).

To collect python package run:

$ python3 setup.py sdist bdist_wheel

Note: Be sure that you are in project root folder

Next step is install utility for uploading to Python Package index

$ pip3 install --user --upgrade twine

Finally, we can upload out project to Python Package index

$ python3 -m twine upload dist/*

And it will be available on your project lists

Note: that you must have account for uploading your package

Create docker image run

To create docker image run:

$ sudo docker build -t any_name .

Note: any_name will be name of created image. So may be you want change it

Run docker image

To run docker image write:

$ sudo docker run -d -p 8082:8082 image_name

Note: image_name must be a name of created image in previous step.

Now our service is available. Check it

Metadata

Release files for exchange-rates-last-hm-alex 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exchange-rates-last-hm-alex 0.0.2
File Size Uploaded
exchange_rates_last_hm_alex-0.0.2.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for exchange-rates-last-hm-alex 0.0.2
File Interpreter ABI Platform
exchange_rates_last_hm_alex-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / exchange_rates_last_hm_alex-0.0.2.tar.gz

Download URL exchange_rates_last_hm_alex-0.0.2.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
25e7d2c9b2fb33d2e4135ebd30abb375382a86f0131fc977bd9a7dd5acfd9bbe
BLAKE2b-256 checksum
How to use checksums
75d4879774556c64ec84441a699edc8371cdff967e11ab6a690b9f8e21946ed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.3

Release files / exchange_rates_last_hm_alex-0.0.2-py3-none-any.whl

Download URL exchange_rates_last_hm_alex-0.0.2-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d22a7fefd236376ed3e2a9a6f4181b49277769d3c1ce772ad51a56cca8e879bb
BLAKE2b-256 checksum
How to use checksums
928a8282c99ea883ad08378c6c8fc8cb8677bb49d9f0595ea15ba2ab72d29d3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page