Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat PreAlphaVersion #2

Merged
merged 8 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish to PyPI

on:
release:
types: [published]

workflow_dispatch:

jobs:
build_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install Poetry
run: |
pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python3 -
poetry config virtualenvs.create false
poetry install

- name: Build package
run: poetry build

- name: Publish package to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --username __token__ --password $POETRY_PYPI_TOKEN_PYPI
41 changes: 0 additions & 41 deletions .github/workflows/CI-CD.yaml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Tests and Pre-build

on:
pull_request:
branches:
- main

# For manual triggers
workflow_dispatch:

jobs:
test:
if: github.actor != 'actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Setup tests
run: |
pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python3 -
poetry config virtualenvs.create false
poetry install

- name: Run tests & CodeCov
run: |
coverage run -m pytest
coverage report
coverage xml

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml

pre_build:
if: github.actor != 'actions[bot]'
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Poetry Setup
run: |
pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python3 -
poetry config virtualenvs.create false
poetry install

- name: Generate and push Tag
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git push
git tag -f $(poetry version -s)
git push -f origin --tags
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,7 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.

*.DS_Store
*.DS_Store

*.http
.idea/httpRequests*
6 changes: 4 additions & 2 deletions .idea/currency-quote-wrapper.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/poetry.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/runConfigurations/Python_tests_in_tests.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Firstly, thank you very much for your interest in contributing to ETL-awesome-ap
Clone the forked repository to your local machine using the command:

```sh
git clone https://github.com/seu-usuario/ETL-awesome-api.git
git clone https://github.com/your-username/currency-quote-wrapper.git
```

### 3. Create a Branch
Expand Down
51 changes: 32 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
# currency-quote-wrapper: Complete solution for extracting currency pair quotes data

![Project Status](https://img.shields.io/badge/status-done-brightgreen)
![License](https://img.shields.io/badge/license-MIT-blue)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/IvanildoBarauna/currency-quote-wrapper)
![Python Version](https://img.shields.io/badge/python-3.9-blue)
![GitHub Workflow Status](https://github.com/IvanildoBarauna/currency-quote-wrapper/actions/workflows/CI-CD.yaml/badge.svg)
[![codecov](https://codecov.io/gh/IvanildoBarauna/currency-quote-wrapper/branch/main/graph/badge.svg?token=GEGNHFM6P)](https://codecov.io/gh/IvanildoBarauna/currency-quote-wrapper)
[![PyPI - Status](https://img.shields.io/pypi/status/currency-quote-wrapper?style=for-the-badge&logo=pypi)](https://pypi.org/project/currency-quote-wrapper/)

[![PyPI - Downloads](https://img.shields.io/pypi/dm/currency-quote-wrapper?style=for-the-badge&logo=pypi)](https://pypi.org/project/currency-quote-wrapper/)

[![PyPI - Version](https://img.shields.io/pypi/v/currency-quote-wrapper?style=for-the-badge&logo=pypi)](https://pypi.org/project/currency-quote-wrapper/#history)

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/currency-quote-wrapper?style=for-the-badge&logo=python)

[![CI](https://img.shields.io/github/actions/workflow/status/IvanildoBarauna/currency-quote-wrapper/CI.yaml?&style=for-the-badge&logo=githubactions&cacheSeconds=60&label=Tests+and+pre+build)](https://github.com/IvanildoBarauna/currency-quote-wrapper/actions/workflows/CI.yaml)
[![CD](https://img.shields.io/github/actions/workflow/status/IvanildoBarauna/currency-quote-wrapper/CD.yaml?&style=for-the-badge&logo=githubactions&cacheSeconds=60&event=release&label=Package+publication)](https://github.com/IvanildoBarauna/currency-quote-wrapper/actions/workflows/CD.yaml)

[![Codecov](https://img.shields.io/codecov/c/github/IvanildoBarauna/currency-quote-wrapper?style=for-the-badge&logo=codecov)](https://app.codecov.io/gh/IvanildoBarauna/currency-quote-wrapper)
## Project Stack

<img src="https://github.com/devicons/devicon/blob/master/icons/python/python-original.svg" Alt="Python" width="50" height="50"> <img src="https://github.com/devicons/devicon/blob/master/icons/docker/docker-original.svg" Alt="Docker" width="50" height="50"> <img src="https://github.com/devicons/devicon/blob/master/icons/poetry/poetry-original.svg" Alt="Poetry" width="50" height="50"> <img src="https://github.com/devicons/devicon/blob/master/icons/pandas/pandas-original.svg" Alt="Pandas" width="50" height="50"> <img src="https://github.com/devicons/devicon/blob/master/icons/jupyter/jupyter-original.svg" Alt="Jupyter" width="50" height="50"> <img src="https://github.com/devicons/devicon/blob/master/icons/matplotlib/matplotlib-original.svg" Alt="Matplotlib" width="50" height="50"> <img src="https://github.com/devicons/devicon/blob/master/icons/githubactions/githubactions-original.svg" Alt="GitHub Actions" width="50" height="50">
![Python](https://img.shields.io/badge/-Python-05122A?style=flat&logo=python)&nbsp;
![Docker](https://img.shields.io/badge/-Docker-05122A?style=flat&logo=docker)&nbsp;
![Poetry](https://img.shields.io/badge/-Poetry-05122A?style=flat&logo=poetry)&nbsp;
![GitHub Actions](https://img.shields.io/badge/-GitHub_Actions-05122A?style=flat&logo=githubactions)&nbsp;
![CodeCov](https://img.shields.io/badge/-CodeCov-05122A?style=flat&logo=codecov)&nbsp;
![pypi](https://img.shields.io/badge/-pypi-05122A?style=flat&logo=pypi)&nbsp;
![pandas](https://img.shields.io/badge/-pandas-05122A?style=flat&logo=pandas)&nbsp;
![pytest](https://img.shields.io/badge/-pytest-05122A?style=flat&logo=pytest)&nbsp;


## Project description

* ADD DESCRIPTION
* Complete solution for extracting currency pair quotes data

## Contributing

Expand All @@ -24,11 +37,7 @@ See the following docs:

## Project Highlights:

- Comprehensive Testing: Development of tests to ensure the quality and robustness of the code at various stages of the ETL process

- Parallelism in Models: Use of parallelism in the data transformation and loading stages, increasing efficiency and reducing processing time.

- Fire-Forget Messaging: Use of messaging (queue.queue) in the fire-forget model to manage files generated between the transformation and loading stages, ensuring a continuous and efficient data flow.
- Comprehensive Testing: Development of tests to ensure the quality and robustness of the code

- Parameter Validation: Sending valid parameters based on the request data source itself, ensuring the integrity and accuracy of the information processed.

Expand All @@ -38,11 +47,15 @@ See the following docs:

``` python
## Importing library
from currency_quote import GetData, GetDataTypes
from currency_quote CurrencyQuote

# For get the last quote of one currency
client = CurrencyQuote(['USD-BRL'])
# or get quotes of multiple currencies
client = CurrencyQuote(['USD-BRL', 'EUR-BRL'])

last_quote = GetData("USD-BRL", GetDataTypes.LastCotation)
# Get the last quote
last_quote = client.get_last_quote()
# Get history quote of currency
history_quote = client.get_history_quote(reference_date=20240626)

x = 2024-01-01
y = 2024-02-02

quote_by_period = GetData("USD-BRL", GetDataTypes.Period, start_date=x, end_date=y)
Loading
Loading