Skip to content
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
12 changes: 0 additions & 12 deletions .flake8

This file was deleted.

18 changes: 7 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
name: Build

on:
pull_request_target:
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.9"
version: "0.7.3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
make install_dev
run: uv sync --all-extras
- name: Run tests and coverage
run: make test_cov
run: uv run pytest tests/ -k "not test_research.py"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
14 changes: 9 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: 3.x
- run: pip install mkdocs-material "mkdocstrings[python]" mike
- run: mkdocs gh-deploy --force
# Install a specific version of uv.
version: "0.7.3"
- run: uv pip install mkdocs-material "mkdocstrings[python]" mike
- run: uv run mkdocs gh-deploy --force
26 changes: 16 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Publish Yahooquery
name: Publish

on:
push:
tags:
- "v*.*.*"
release:
types: [created]

jobs:
build:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.17
with:
pypi_token: ${{ secrets.PYPI_KEY }}
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Build and publish
run: |
uv build
uv publish
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ coverage.xml
*.cover
.hypothesis/
.pytest_cache/
.ruff_cache/

# Translations
*.mo
Expand Down
15 changes: 0 additions & 15 deletions .isort.cfg

This file was deleted.

23 changes: 5 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,11 @@ default_language_version:
repos:
- repo: local
hooks:
- id: isort
stages: [commit,push]
name: isort
entry: poetry run isort -rc
language: system
types: [python]
- id: black
stages: [commit,push]
name: black
entry: poetry run black -S .
language: system
types: [python]
- id: mypy
stages: [commit,push]
name: mypy
entry: poetry run mypy --ignore-missing-imports
language: system
types: [python]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.9
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Change Log
==========

2.4.0
-----
## Update
- Update to use uv for packaging and publishing
- Folder, file structure
- `validate_symbols` method now returns a tuple of valid and invalid symbols

## Add
- `curl_cffi` to dependencies instead of `requests` for session management
- Ability to input verification code for login when selenium is used

2.3.7
-----
## Add
Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
PYTEST=poetry run pytest
PYTEST=uv run pytest

install_dev:
poetry install
uv sync --all-extras

install:
poetry install --no-dev
uv sync

lint:
poetry run black -S --check --diff .
poetry run isort --check-only --diff .
poetry run flake8 .
poetry run mypy . --ignore-missing-imports
ruff check

test: lint
$(PYTEST)
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
<em>Python wrapper for an unofficial Yahoo Finance API</em>
</p>
<p align="center">
<a href="https://travis-ci.com/dpguthrie/yahooquery" target="_blank">
<img src="https://travis-ci.com/dpguthrie/yahooquery.svg?branch=master" alt="Build Status">
</a>
<a href="https://codecov.io/gh/dpguthrie/yahooquery" target="_blank">
<img src="https://img.shields.io/codecov/c/github/dpguthrie/yahooquery" alt="Coverage">
</a>
Expand Down Expand Up @@ -44,7 +41,7 @@ Some features of yahooquery:

## Requirements

Python 2.7, 3.5+
Python 3.9+ - **Versions on or after 2.4.0 require python 3.9+**

- [Pandas](https://pandas.pydata.org) - Fast, powerful, flexible and easy to use open source data analysis and manipulation tool
- [Requests](https://requests.readthedocs.io/en/master/) - The elegant and simple HTTP library for Python, built for human beings.
Expand All @@ -70,6 +67,11 @@ Otherwise, omit the premium argument:
pip install yahooquery
```

You can also install with uv if you have that installed:
```bash
uv pip install yahooquery
```

## Example

The majority of the data available through the unofficial Yahoo Finance API is related to a company, which is represented in yahooquery as a `Ticker`. You can instantiate the `Ticker` class by passing the company's ticker symbol. For instance, to get data for Apple, Inc., pass `aapl` as the first argument to the `Ticker` class:
Expand Down
12 changes: 9 additions & 3 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
<em>Python wrapper for an unofficial Yahoo Finance API</em>
</p>
<p align="center">
<a href="https://travis-ci.com/dpguthrie/yahooquery" target="_blank">
<img src="https://travis-ci.com/dpguthrie/yahooquery.svg?branch=master" alt="Build Status">
</a>
<a href="https://codecov.io/gh/dpguthrie/yahooquery" target="_blank">
<img src="https://img.shields.io/codecov/c/github/dpguthrie/yahooquery" alt="Coverage">
</a>
Expand Down Expand Up @@ -74,6 +71,15 @@ Otherwise, omit the premium argument:
<a href="#" data-terminal-control="">restart ↻</a>
</div>

Or install with `uv`:

<div class="termynal" data-termynal data-ty-typeDelay="40" data-ty-lineDelay="200">
<span data-ty="input">uv pip install yahooquery</span>
<span data-ty="progress"></span>
<span data-ty>Successfully installed yahooquery</span>
<a href="#" data-terminal-control="">restart ↻</a>
</div>

## Example

The majority of the data available through the unofficial Yahoo Finance API is related to a company, which is represented in yahooquery as a `Ticker`. You can instantiate the `Ticker` class by passing the company's ticker symbol. For instance, to get data for :fontawesome-brands-apple:, pass `aapl` as the first argument to the `Ticker` class:
Expand Down
94 changes: 94 additions & 0 deletions docs/docs/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,99 @@
# Release Notes

2.4.0
-----
## Update
- Update to use uv for packaging and publishing
- Folder, file structure
- `validate_symbols` method now returns a tuple of valid and invalid symbols

## Add
- `curl_cffi` to dependencies instead of `requests` for session management

2.3.7
-----
## Add
- Logic for handling setting up a session when a consent screen is encountered. This is primarily seen in European countries
and should allow for the continued use of this package.
- Keyword argument, `setup_url`, to the base `_YahooFinance` class that allows a user to override the url used in setting up the session. As a default
the Yahoo Finance home page is used (https://finance.yahoo.com). You can also create an environment variable, `YF_SETUP_URL` that will be used if set.
Example usage:
```python
import yahooquery as yq

t = yq.Ticker('aapl', setup_url='https://finance.yahoo.com/quote/AAPL')
```

## Remove
- Webdriver manager is no longer used internally. Selenium Manager is now fully included with selenium `4.10.0`, so this package is no longer needed.

2.3.6
-----
## Fix
- Use the previously instantiated session within the `Ticker` class (that may also contain proxies, other important session info) to retrieve both cookies and a crumb

2.3.5
-----
## Fix
- Fix bad assignment to crumb when using username/password for premium access

2.3.4
-----
## Update
- Use a different url to try and obtain cookies (fc.yahoo.com no longer works)
- Refactor how a session is initialized
- Use the country as a way to make the request to obtain cookies be more location specific

2.3.3
-----
## Update
- Try and obtain cookies and a crumb during `Ticker` initialization so they can be used in further requests.

2.3.2
-----
## Update
- Update quote summary endpoint from v10 to v6. The v10 endpoint currently requires a crumb as a query parameter, which is not something this library does not currently support.

## Fix
- Bug related to retrieving screen IDs with a number

2.3.1
-----
## Fix
- Fixes for history method

2.3.0
-----
## Added
- `dividend_history` method that returns historical dividends paid for a given symbol(s)

## Fixed
- `history` method has been refactored pretty heavily with the help of @maread99 (Thank you!). Timezone info is now included in the `date` column. Also, a dataframe will always be returned regardless of bad symbols existing. Previously, a dictionary was returned with the json response for the bad symbol(s) and dataframes for successful responses.

2.2.15
------
- Updated the data available from the cash flow statement

2.2.14
------
- Updated the financials dataframes (cash_flow, income_statement, balance_sheet, all_financial_data,
get_financial_data) to include another column titled "currencyCode". This will identify the currency
used in the financial statement.

2.2.13
------
- Fix bug related to dividends and stock splits. The merge statement to combine the pandas dataframes
was using a left join instead of an outer join, which caused stock splits to drop.

2.2.11
------
- Fix bug with async requests and :code:`symbols` as a query parameter

2.2.9
-----
- Fix internal method :code:`_format_data` in the :code:`_YahooFinance` class to account for dates held in lists
- Use flit to publish package to pypi. Additionally, make selenium an optional package to install through :code:`pip install yahooquery[premium]`

## 2.2.8

- `Ticker`, `Screener`, and `Research` classes now accept the keyword argument `progress`. If set to `True`, a progress bar will be displayed when downloading data. The default value is `False`.
Expand Down
Loading
Loading