at-common-functions


Nameat-common-functions JSON
Version 1.0.24 PyPI version JSON
download
home_pageNone
SummaryA Python package providing common functions for workflow operations.
upload_time2025-01-31 14:21:54
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
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/2f/9b/123e1de2bae681fdd7bd368e6fddb36c57ff9e2f557f702781661c1f915b/at_common_functions-1.0.24.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.24",
    "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": null,
            "digests": {
                "blake2b_256": "c4eccedd08c4e3bf4b112a96f1669389402ef6c48675780a22ea8744fffd79fd",
                "md5": "243591d2ccbd1c4619ae75f0ed74f784",
                "sha256": "455d2bf9147bdc3583282a4ade1a362a74c72bbc9ec47f781849ba8fb549dd42"
            },
            "downloads": -1,
            "filename": "at_common_functions-1.0.24-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "243591d2ccbd1c4619ae75f0ed74f784",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 16362,
            "upload_time": "2025-01-31T14:21:53",
            "upload_time_iso_8601": "2025-01-31T14:21:53.089701Z",
            "url": "https://files.pythonhosted.org/packages/c4/ec/cedd08c4e3bf4b112a96f1669389402ef6c48675780a22ea8744fffd79fd/at_common_functions-1.0.24-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2f9b123e1de2bae681fdd7bd368e6fddb36c57ff9e2f557f702781661c1f915b",
                "md5": "fbb762b94746828873805aa515344920",
                "sha256": "b065b83aaa83eabe34be3b41bcf1942ae4a4d77d64039b8f55fccb1827ce6d63"
            },
            "downloads": -1,
            "filename": "at_common_functions-1.0.24.tar.gz",
            "has_sig": false,
            "md5_digest": "fbb762b94746828873805aa515344920",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 18788,
            "upload_time": "2025-01-31T14:21:54",
            "upload_time_iso_8601": "2025-01-31T14:21:54.155640Z",
            "url": "https://files.pythonhosted.org/packages/2f/9b/123e1de2bae681fdd7bd368e6fddb36c57ff9e2f557f702781661c1f915b/at_common_functions-1.0.24.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-31 14:21:54",
    "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"
}
        
Elapsed time: 6.26909s