Name | at-common-functions JSON |
Version |
1.0.2
JSON |
| download |
home_page | None |
Summary | A Python package providing common functions for workflow operations. |
upload_time | 2024-12-21 16:21:44 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# AT Common Functions
A Python package providing common asynchronous task definitions and utilities for workflow operations.
## Installation
```bash
pip install at_common_functions
```
## Usage
### Database Storage Initialization
```python
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
```python
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
1. Clone the repository
2. Create a virtual environment: `python -m venv venv`
3. Activate the virtual environment
4. Install development dependencies: `pip install -e ".[dev]"`
5. 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.
Raw data
{
"_id": null,
"home_page": null,
"name": "at-common-functions",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Rui Chen <apextrader.ai@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ed/85/d0abba434c9de2b6acefe8742171a89297976cea076b94806b0a2053999e/at_common_functions-1.0.2.tar.gz",
"platform": null,
"description": "# AT Common Functions\n\nA Python package providing common asynchronous task definitions and utilities for workflow operations.\n\n## Installation\n```bash\npip install at_common_functions\n```\n\n## Usage\n### Database Storage Initialization\n```python\nfrom at_common_functions import init_storage\n\n# Initialize storage connection\nstorage = init_storage(\n host=\"localhost\",\n port=3306,\n user=\"user\",\n password=\"password\",\n database=\"dbname\"\n)\n```\n\n### Stock Data Operations\n```python\nfrom at_common_functions.stock import (\n stock_get_overview,\n stock_get_quotation,\n stock_get_candlesticks,\n stock_get_indicators,\n stock_get_financials\n)\n\nasync def main():\n # Get stock overview\n overview = await stock_get_overview(\"AAPL\")\n print(overview) # Contains symbol, name, sector, etc.\n\n # Get current quotation\n quotation = await stock_get_quotation(\"AAPL\")\n print(quotation) # Contains price, volume, timestamp\n \n # Get daily candlesticks\n candlesticks = await stock_get_candlesticks(\"AAPL\", \"daily\", limit=5)\n print(candlesticks) # List of candlesticks with OHLCV data\n \n # Get technical indicators\n indicators = await stock_get_indicators(\"AAPL\", \"daily\", limit=5)\n print(indicators) # List of indicators (SMA, RSI, etc.)\n \n # Get financial statements\n financials = await stock_get_financials(\n symbol=\"AAPL\",\n period=\"annual\", # or \"quarterly\"\n statement=\"income\", # or \"balance_sheet\", \"cash_flow\"\n limit=3\n )\n print(financials)\n```\n\n## Development\n\n1. Clone the repository\n2. Create a virtual environment: `python -m venv venv`\n3. Activate the virtual environment\n4. Install development dependencies: `pip install -e \".[dev]\"`\n5. Run tests: `pytest`\n\n## Dependencies\n\n- Python >= 3.11\n- at_common_workflow >= 1.1.15\n- SQLAlchemy >= 2.0.36\n- at-common-models >= 0.1.3\n- aiomysql >= 0.2.0\n- greenlet >= 3.0.3\n\n### Development Dependencies\n- pytest >= 8.3.4\n- pytest-asyncio >= 0.24.0\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python package providing common functions for workflow operations.",
"version": "1.0.2",
"project_urls": {
"Bug Tracker": "https://github.com/apex-trader/at-common-functions/issues",
"Homepage": "https://github.com/apex-trader/at-common-functions"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "36d8030e2818d234cbc9eb790088fb90d3588b1bda7f231a9a819987c5bc9317",
"md5": "ff11c3542e2f508d27c55c58899a7ad0",
"sha256": "b84580be401e24984c51c488daa505619567e416117de9d6d9721b8a486891f2"
},
"downloads": -1,
"filename": "at_common_functions-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ff11c3542e2f508d27c55c58899a7ad0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 5057,
"upload_time": "2024-12-21T16:21:43",
"upload_time_iso_8601": "2024-12-21T16:21:43.515065Z",
"url": "https://files.pythonhosted.org/packages/36/d8/030e2818d234cbc9eb790088fb90d3588b1bda7f231a9a819987c5bc9317/at_common_functions-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ed85d0abba434c9de2b6acefe8742171a89297976cea076b94806b0a2053999e",
"md5": "105d3218c244f8b25def770862f196bb",
"sha256": "3b582cfbb5fd642e6135e986494e1ba443b2bdb632b92f63e7d4a4f6a9c5111d"
},
"downloads": -1,
"filename": "at_common_functions-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "105d3218c244f8b25def770862f196bb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 5990,
"upload_time": "2024-12-21T16:21:44",
"upload_time_iso_8601": "2024-12-21T16:21:44.784709Z",
"url": "https://files.pythonhosted.org/packages/ed/85/d0abba434c9de2b6acefe8742171a89297976cea076b94806b0a2053999e/at_common_functions-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-21 16:21:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "apex-trader",
"github_project": "at-common-functions",
"github_not_found": true,
"lcname": "at-common-functions"
}