Skip to content

esredson/acoes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Ações: Monthly Growth Chart

This Python app reads a list of tickers from a YAML config, fetches monthly percentage growth for the last year from Yahoo Finance, builds a dataset, computes the mean monthly growth across all shares, and produces a chart.

Setup

  1. Ensure Python 3.10+ is installed.
  2. (Optional) Create a virtual environment.
  3. Install dependencies.
  4. Run the app.
# From the repo root
python -m venv .venv; .\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python .\src\app.py

Config

Tickers are defined in config.yaml and this file is ignored by Git. Example:

Tickers:
  - POMO4
  - MELI34
  - CURY3
  - TIMS3
  - RDOR3
  - PSSA3
  - CPLE3
  - BPAC11
  - BDOM11
  - GGBR4
  - BOVB11

The app normalizes B3 tickers to Yahoo Finance by appending .SA when no suffix is present.

Provider and API Key

You can select a provider in config.yaml:

Provider: yfinance  # or brapi or twelvedata
TwelveDataApiKey: "YOUR_API_KEY"
BrapiApiKey: "YOUR_BRAPI_TOKEN"  # optional, required for full BRAPI access
  • yfinance: free, no key, but may fail due to provider limits or network.
  • brapi: Brazil-focused; uses raw B3 tickers like PSSA3 (no .SA suffix). Most tickers require authentication.
    • Without a token, only a small set of public test tickers (e.g., PETR4, VALE3, MGLU3, ITUB4) are available. For production use, set BrapiApiKey and we will send Authorization: Bearer <token>.
    • When no token is provided, the app requests only the last 3 months of historical prices (range=3mo) to respect free-plan limits and aggregates them to monthly returns. With a token, it requests 1 year (range=1y).
  • twelvedata: reliable with API key; we use the time_series endpoint with interval=1month. For B3 tickers we try TICKER:SA or exchange=B3 formats.

Optional proxies:

HTTPProxy: "http://user:pass@proxy:port"
HTTPSProxy: "http://user:pass@proxy:port"

Outputs

  • Dataset: output/monthly_growth.csv
  • Chart: output/monthly_growth.png

Notes

  • Data source: Yahoo Finance via yfinance.
  • Monthly growth is computed from adjusted close prices using percentage change per month.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages