diff --git a/.gitignore b/.gitignore index 7bef278..0049299 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ build/ finam_export.egg-info/ .devcontainer .vscode +.venv \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 05ba552..3cb24d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.1.2] - 2023-03-26 +### Added +- Added new fetcher which use selenium webdriver to download meta data +### Changed +- Implement unittest module from standart library for tests + ## [5.1.1] - 2021-11-04 ### Fixed - renamed CRYPTO_CURRENCY -> CRYPTO_CURRENCIES for the sake of consistency diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7f2de29 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.11 + +# Install all requirements +RUN apt update \ + && apt install -y xvfb default-jdk dbus + +# Download chrome +RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add +RUN bash -c "echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google-chrome.list" +RUN apt -y update +RUN apt -y install google-chrome-stable + +# Install lib as module +RUN mkdir -p /usr/src/finam_export +WORKDIR /usr/src/finam_export +COPY . . +# RUN pip install -r requirements.txt +RUN pip install . + +# Run +CMD xvfb-run -a --server-args="-screen 0 1280x800x24 -ac -nolisten tcp -dpi 96 +extension RANDR" python -m unittest discover -s "./tests" -p "tests_*.py" -f \ No newline at end of file diff --git a/README.md b/README.md index 3084fe0..943c0d9 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ Python client library to download data from finam.ru ## Installation * `pip install finam-export` +## Requierements +* Google Chrome must be installed + ## Samples provided * `samples/listing.py` - simply lists some contracts from every supported market * `samples/download.py` - downloads some data and prints it out @@ -25,14 +28,24 @@ Here's the output ``` *** Current Russian ruble exchange rates *** INFO:finam.export:Fetching https://www.finam.ru/profile/moex-akcii/gazprom/export/ +INFO:finam.export:Meta data fetching started INFO:finam.export:Fetching https://www.finam.ru/cache/N72Hgd54/icharts/icharts.js -INFO:finam.export:Fetching http://export.finam.ru/table.csv?d=d&f=table&e=.csv&dtf=1&tmf=3&MSOR=0&mstime=on&mstimever=1&sep=3&sep2=1&at=1&p=8&em=182456&market=45&df=1&mf=0&yf=2007&dt=12&mt=8&yt=2020&cn=USD000000TOD&code=USD000000TOD&datf=5 -