A Python package providing common functions for workflow operations.
Project description
AT Common Functions
A Python package providing common asynchronous task definitions and utilities for workflow operations.
Installation
pip install at_common_functions
Usage
Database Storage Initialization
from at_common_functions import init_storage
# Initialize storage connection
storage = init_storage(
host="localhost",
port=3306,
user="user",
password="password",
database="dbname"
)
Stock Data Operations
from at_common_functions.stock import (
stock_get_overview,
stock_get_quotation,
stock_get_candlesticks,
stock_get_indicators,
stock_get_financials
)
async def main():
# Get stock overview
overview = await stock_get_overview("AAPL")
print(overview) # Contains symbol, name, sector, etc.
# Get current quotation
quotation = await stock_get_quotation("AAPL")
print(quotation) # Contains price, volume, timestamp
# Get daily candlesticks
candlesticks = await stock_get_candlesticks("AAPL", "daily", limit=5)
print(candlesticks) # List of candlesticks with OHLCV data
# Get technical indicators
indicators = await stock_get_indicators("AAPL", "daily", limit=5)
print(indicators) # List of indicators (SMA, RSI, etc.)
# Get financial statements
financials = await stock_get_financials(
symbol="AAPL",
period="annual", # or "quarterly"
statement="income", # or "balance_sheet", "cash_flow"
limit=3
)
print(financials)
Development
- Clone the repository
- Create a virtual environment:
python -m venv venv - Activate the virtual environment
- Install development dependencies:
pip install -e ".[dev]" - Run tests:
pytest
Dependencies
- Python >= 3.11
- at_common_workflow >= 1.1.15
- SQLAlchemy >= 2.0.36
- at-common-models >= 0.1.3
- aiomysql >= 0.2.0
- greenlet >= 3.0.3
Development Dependencies
- pytest >= 8.3.4
- pytest-asyncio >= 0.24.0
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file at_common_functions-1.0.26.tar.gz.
File metadata
- Download URL: at_common_functions-1.0.26.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c544eca6f9c0d8d4c57e96ab5801fb6074d0f8167a8a4910bbf40357170e5670
|
|
| MD5 |
a5749388d05f72e117dba59f8d3c25b6
|
|
| BLAKE2b-256 |
a7f58829ba96c34252ffa82dfadb2e083fef1d108681decc19b8046726d9c62c
|
File details
Details for the file at_common_functions-1.0.26-py3-none-any.whl.
File metadata
- Download URL: at_common_functions-1.0.26-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
591f1f7dbce314a43523c40c1a4932c5932b97eb6a2b740a8f6f5f880d34508e
|
|
| MD5 |
c2829248853511584ac0cc17bad670ed
|
|
| BLAKE2b-256 |
0a940487117b5e6e797fc802391561c9513d2634dce3e3c4881e3f3914b218ff
|