Skip to main content

A Python package for fetching Vietnamese stock market data from multiple sources

Project description

vntickers

A Python package for fetching Vietnamese stock market data from multiple sources.

Installation

From source (development)

git clone https://github.com/gahoccode/vntickers.git
cd vntickers
uv sync

Add to your project

uv add vntickers

Usage

Using vnstock (VCI source)

from vntickers.loader import VNStockData

stocks = ["VNM", "VCB", "HPG"]
start_date = "2024-01-01"
end_date = "2024-12-31"

df = VNStockData.get_close_prices_vns(
    symbols=stocks,
    start_date=start_date,
    end_date=end_date,
    interval="1D"
)
print(df.head())

Using vnquant

from vntickers.loader import VNStockData

stocks = ["VNM", "VCB", "HPG"]
start_date = "2024-01-01"
end_date = "2024-12-31"

df = VNStockData.get_close_prices_vnq(
    symbols=stocks,
    start_date=start_date,
    end_date=end_date
)
print(df.head())

Both methods return a pandas DataFrame with:

  • Index: time (datetime)
  • Columns: ticker symbols
  • Values: close prices (adjusted close for vnquant)

Requirements

  • Python >=3.10
  • vnstock >=3.2.6
  • vnquant (from git source)

Publishing to PyPI

Prerequisites

  1. Create a PyPI account at https://pypi.org
  2. Create an API token at https://pypi.org/manage/account/token/

Build and Publish

# Build the package
uv build

# Publish to PyPI (you'll be prompted for your API token)
uv publish

# Or use token directly
uv publish --token <your-pypi-token>

Installing vnquant (optional dependency)

Since vnquant is not on PyPI, install it separately if needed:

uv pip install git+https://github.com/phamdinhkhanh/vnquant.git

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vntickers-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vntickers-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file vntickers-0.1.0.tar.gz.

File metadata

  • Download URL: vntickers-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for vntickers-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0701418eba8614a2c58646091f8514b38828a887dc3ed7f6bc6391a59d71f75b
MD5 3a3029d22f62869283d529efb9baceda
BLAKE2b-256 e199515219538aec5de77ee1e65925e108e80b386562ebf3849069ded4361029

See more details on using hashes here.

File details

Details for the file vntickers-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vntickers-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for vntickers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e08e0d67a947b278ede90fb8b77b329b57b40e9328d677d06ecfd235ce0b59b
MD5 438bee2f031ce5982ffe756f1f5557be
BLAKE2b-256 b56a79dc91932c930632fd09a10f7b551cbcf941bfdd493f0394d8d0e61c9e77

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page