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
  • pandas

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>

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.1.tar.gz (3.4 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.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for vntickers-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0edd4a3d68927bf83b4108a7d845dfb79217a7ed41cc82af834b697d2adbe10d
MD5 2e342aa8cd0564570350a42db26ae05a
BLAKE2b-256 db7b030f366f58ffc76ef1caf1ba3c4f662a178394cd70b157e7b56481895f8d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vntickers-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c71c6bcb759193bd0c1981547384da927c3cf8444bd428035b2ad070576421d
MD5 4542ac3f8eba3c1ec41dca52aecc4685
BLAKE2b-256 587a5164477c4a2761ede083ec73198737dbc7505c2c81b0776395bd003913e5

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