Skip to main content

The service of NeuroStats website

Project description

neurostats_API

檔案架構

./neurostats_API
├── async_mode
│   ├── db
│   ├── db_extractors
│   │   ├── daily
│   │   ├── month_revenue
│   │   └── seasonal
│   ├── factory
│   └── fetchers
├── config
│   ├── company_list
│   ├── tej_db
│   └── twse
├── fetchers
├── transformers
│   ├── balance_sheet
│   ├── cash_flow
│   ├── daily_chip
│   │   └── utils
│   ├── daily_tech
│   │   └── utils
│   ├── finance_overview
│   ├── month_revenue
│   ├── profit_lose
│   ├── tej
│   └── value
└── utils
  • neurostats_API: 主要的package運行內容
    • async_mode: [新版新增]以非同步方式進行DB資料的取得以及回傳資料
      • /db: 連接到伺服器下的特定db
      • /db_extractor: 決定取得db下的哪個collection的檔案,以及取得檔案內容 /factory`: 使extractor的初始化變得通用
      • /fetchers: 開發者將此套件用於其他專案的接口
    • fetchers: (舊版)回傳service內容的fetcher檔案夾
    • transformers: [新版新增] 處理從DB取出的資料,以dictionary的方式回傳需要的資料
    • config: 【新舊通用】存放各種設定檔的dictionary,例如公司名單、各項指標對應的計算欄位、每個項目屬於哪份財報等設定
    • utils: 【新舊通用】class之間通用的函式,例如讀取檔案、計算成長率函式、轉換格式與進位等

下載

pip install neurostats-API

確認下載成功

>>> import neurostats_API
>>> print(neurostats_API.__version__)
1.0.0rc4

下載舊版

pip install neurostats-API==0.0.25

使用方式 (以Balance_Sheet為例)

Async Mode

from neurostats_API.async_mode.fetchers import AsyncBalanceSheetFetcher
from pymongo import AsyncMongoClient

db_client = AsyncMongoClient("<伺服器的MONGO_URI>")
ticker = "2330"

fetcher = AsyncBalanceSheetFetcher(ticker, db_client)

data = await fetcher.query_data()

print(data)

詳細各個fetcher的使用法請到async_mode的fetchers資料夾下觀看

Sync Mode

(#TODO)

舊版使用方法請到fetchers資料夾下觀看

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

neurostats_api-1.0.0rc4.tar.gz (394.1 kB view details)

Uploaded Source

Built Distribution

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

neurostats_API-1.0.0rc4-py3-none-any.whl (438.4 kB view details)

Uploaded Python 3

File details

Details for the file neurostats_api-1.0.0rc4.tar.gz.

File metadata

  • Download URL: neurostats_api-1.0.0rc4.tar.gz
  • Upload date:
  • Size: 394.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for neurostats_api-1.0.0rc4.tar.gz
Algorithm Hash digest
SHA256 7a4f9837f33bdefb35fbfb267cd6c60d7fc9654a735a7cb09ca411001a6cdebf
MD5 25865611c71463a67e8ddcce5a9df51b
BLAKE2b-256 b9bc00894227c81ac03cff298245adfbf66ea045b1b7601822d6621a467867f6

See more details on using hashes here.

File details

Details for the file neurostats_API-1.0.0rc4-py3-none-any.whl.

File metadata

File hashes

Hashes for neurostats_API-1.0.0rc4-py3-none-any.whl
Algorithm Hash digest
SHA256 dbcfc7842c52ccebc9231c71e1da29551a9f2ae02c44832f66ba447cedb913e5
MD5 6e16fcfd523d8a7af7d0466de5fe7e52
BLAKE2b-256 c342fbbeefda3d57cc32ffb18e045c6613ded99c4d6fcf815150662a1609bbef

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