Skip to main content

No project description provided

Project description

JPX Data Retriever

The JPX Data Retriever is a Python module designed to obtain and process the Japanese stock list from the Japan Exchange Group (JPX) website. It efficiently downloads, caches, and parses the stock data into a pandas DataFrame, making it easy for analysts and developers to integrate JPX stock information into their applications.

Features

  • Downloads the latest JPX stock list directly from the JPX website.
  • Caches the downloaded data locally and checks for updates every 30 days.
  • Processes the downloaded Excel file into a pandas DataFrame.
  • Filters the data to provide only stocks listed on the Prime Market.

Installation

To use the JPX Data Retriever, ensure you have the following prerequisites:

  • Python 3.x
  • Required Python packages: pandas, urllib3, beautifulsoup4, platformdirs

Install the necessary packages using pip:

pip install pandas urllib3 beautifulsoup4 platformdirs

Usage

To retrieve and display the JPX Prime Market stock list, run the following script:

from myhappydays.investment.jpx_code import JPXDataRetriever

retriever = JPXDataRetriever()
try:
    stock_list_df = retriever.get_prime_market_list()
    print("Successfully retrieved data.")
    print(f"Cache file location: {retriever.cache_file}")
    print("\nFirst 5 entries:")
    print(stock_list_df.head())
except (JPXDataDownloadError, JPXDataAccessError, FileNotFoundError) as e:
    print(f"Error: {e}")

Classes

JPXDataRetriever

  • Purpose: Handles the retrieval, caching, and processing of JPX stock data.
  • Key Methods:
    • get_prime_market_list(): Returns the JPX Prime Market stock list as a pandas DataFrame.

JPXDataDownloadError

  • Purpose: Raised when a network-level error occurs during data download.

JPXDataAccessError

  • Purpose: Raised when the data cannot be accessed due to page structure changes, missing files, or unreadable content.

License

This project is open-sourced and available for use under the MIT License. See the LICENSE file for details.

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

myhappydays_investment_jpx_code-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for myhappydays_investment_jpx_code-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed5563fd1b549a7b028d5e3e369a6c18706f80c82cde4d775cddc893a8fb23fe
MD5 52ed4a74c0cf24b3819a1e7b481039cd
BLAKE2b-256 ec6ea5259430f0874ec4f8a8471634002482f5b8922728cf69c3144ce32e522f

See more details on using hashes here.

Provenance

The following attestation bundles were made for myhappydays_investment_jpx_code-0.1.0.tar.gz:

Publisher: test.yml on takushi1969/myhappydays-investment-jpx_code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for myhappydays_investment_jpx_code-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1777c128a732c0bb3f1c9641293df85b6d78ee3d58e976d6ff538f28aae60a15
MD5 56cab7b5e44b2ba32972134e291cf276
BLAKE2b-256 f5d3e1c0db1971060ee2fbd6c6c1a2b4ca104a2d1684f9230c68fc8de25efa85

See more details on using hashes here.

Provenance

The following attestation bundles were made for myhappydays_investment_jpx_code-0.1.0-py3-none-any.whl:

Publisher: test.yml on takushi1969/myhappydays-investment-jpx_code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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