tensorfi-sharpe


Nametensorfi-sharpe JSON
Version 0.1.15 PyPI version JSON
download
home_pagehttps://github.com/wang-sanity/sharpe
SummaryFinancial data access and analysis library with market data, options calculations, and database integration
upload_time2025-08-08 19:23:12
maintainerNone
docs_urlNone
authorrwang
requires_python>=3.11
licenseCC BY-NC 4.0
keywords finance markets data options database analysis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Sharpe - Financial Data & Analysis Library

A Python library for financial data access, market analysis, and options calculations.

Wrappers around Polygon and Financial Modeling Prep.

## Features

- **Market Data**: Stock prices, options data, and historical information
- **Alternative Data**: News, earnings, and company profiles
- **Options Calculations**: Black-Scholes pricing and Greeks
- **Database Integration**: PostgreSQL with async support
- **AWS Integration**: Cloud data retrieval

## Installation

```bash
# From source
git clone https://github.com/wang-sanity/sharpe.git
cd sharpe
pip install -e .

# Using conda
conda env create -f environment.yml
conda activate tensorfi-sharpe
```

## Quick Start

```python
from sharpe.data import mkt, alt
from sharpe.utils import options, time, universe

# Get market data using aggregates
data = mkt.aggregates(
    ticker="AAPL",
    multiplier=1,
    timespan="day",
    from="2024-01-01",
    to="2024-01-31"
)

# Get options chain for a ticker
options_data = mkt.options_chain("SPY")

# Work with time utilities
trading_day = time.closest_trading_day_now()
is_trading = time.is_trading_day("2024-01-15")

# Get universe of stocks
top_stocks = universe.get_top_n_traded_stock(n=50)
```

## Package Structure

- `sharpe/data/` - Market and alternative data access, database operations
- `sharpe/utils/` - Options calculations, time utilities, universe management

## Requirements

- Python 3.11+
- Core: pandas, numpy, scipy, sqlalchemy
- Optional: PostgreSQL, AWS credentials

## Development

```bash
# Setup
conda env create -f environment.yml
conda activate tensorfi-sharpe
pip install -e .[dev]

# Test
pytest
```

## Performance tuning

The data layer uses a pooled HTTP client and optional on-disk cache to reduce duplicated network calls during simulations.

- SHARPE_HTTP_CACHE_ENABLED: set to `0` to disable (default `1`)
- SHARPE_HTTP_CACHE_TTL_SECONDS: cache TTL in seconds (default `86400`)
- SHARPE_HTTP_CACHE_DIR: directory for cached responses (default `~/.cache/sharpe/http`)

These affect `sharpe.data.mkt.aggregates` and `sharpe.data.mkt.option_definition` calls extensively used by options utilities.

## License

CC BY-NC 4.0 License - see [LICENSE](LICENSE) file for details.

---

**Disclaimer**: For educational and research purposes only. Consult qualified professionals before making investment decisions.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wang-sanity/sharpe",
    "name": "tensorfi-sharpe",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "finance, markets, data, options, database, analysis",
    "author": "rwang",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/cf/02/d2538e3ccb7764624452a91252a7c306ff9570b984e9e3a2529162daf875/tensorfi_sharpe-0.1.15.tar.gz",
    "platform": null,
    "description": "# Sharpe - Financial Data & Analysis Library\n\nA Python library for financial data access, market analysis, and options calculations.\n\nWrappers around Polygon and Financial Modeling Prep.\n\n## Features\n\n- **Market Data**: Stock prices, options data, and historical information\n- **Alternative Data**: News, earnings, and company profiles\n- **Options Calculations**: Black-Scholes pricing and Greeks\n- **Database Integration**: PostgreSQL with async support\n- **AWS Integration**: Cloud data retrieval\n\n## Installation\n\n```bash\n# From source\ngit clone https://github.com/wang-sanity/sharpe.git\ncd sharpe\npip install -e .\n\n# Using conda\nconda env create -f environment.yml\nconda activate tensorfi-sharpe\n```\n\n## Quick Start\n\n```python\nfrom sharpe.data import mkt, alt\nfrom sharpe.utils import options, time, universe\n\n# Get market data using aggregates\ndata = mkt.aggregates(\n    ticker=\"AAPL\",\n    multiplier=1,\n    timespan=\"day\",\n    from=\"2024-01-01\",\n    to=\"2024-01-31\"\n)\n\n# Get options chain for a ticker\noptions_data = mkt.options_chain(\"SPY\")\n\n# Work with time utilities\ntrading_day = time.closest_trading_day_now()\nis_trading = time.is_trading_day(\"2024-01-15\")\n\n# Get universe of stocks\ntop_stocks = universe.get_top_n_traded_stock(n=50)\n```\n\n## Package Structure\n\n- `sharpe/data/` - Market and alternative data access, database operations\n- `sharpe/utils/` - Options calculations, time utilities, universe management\n\n## Requirements\n\n- Python 3.11+\n- Core: pandas, numpy, scipy, sqlalchemy\n- Optional: PostgreSQL, AWS credentials\n\n## Development\n\n```bash\n# Setup\nconda env create -f environment.yml\nconda activate tensorfi-sharpe\npip install -e .[dev]\n\n# Test\npytest\n```\n\n## Performance tuning\n\nThe data layer uses a pooled HTTP client and optional on-disk cache to reduce duplicated network calls during simulations.\n\n- SHARPE_HTTP_CACHE_ENABLED: set to `0` to disable (default `1`)\n- SHARPE_HTTP_CACHE_TTL_SECONDS: cache TTL in seconds (default `86400`)\n- SHARPE_HTTP_CACHE_DIR: directory for cached responses (default `~/.cache/sharpe/http`)\n\nThese affect `sharpe.data.mkt.aggregates` and `sharpe.data.mkt.option_definition` calls extensively used by options utilities.\n\n## License\n\nCC BY-NC 4.0 License - see [LICENSE](LICENSE) file for details.\n\n---\n\n**Disclaimer**: For educational and research purposes only. Consult qualified professionals before making investment decisions.\n",
    "bugtrack_url": null,
    "license": "CC BY-NC 4.0",
    "summary": "Financial data access and analysis library with market data, options calculations, and database integration",
    "version": "0.1.15",
    "project_urls": {
        "Bug Tracker": "https://github.com/wang-sanity/sharpe/issues",
        "Documentation": "https://github.com/wang-sanity/sharpe/docs",
        "Homepage": "https://github.com/wang-sanity/sharpe",
        "Repository": "https://github.com/wang-sanity/sharpe"
    },
    "split_keywords": [
        "finance",
        " markets",
        " data",
        " options",
        " database",
        " analysis"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "24d5aa4f425b4ee36ffbaedf261f87f83af89a269cb55aed0be3431b8b7c6b1d",
                "md5": "6f5460ea795c04d56cfc12143c6e9892",
                "sha256": "60284f7edd1da32617abeaf463abe34ee5830014d990491dbbcd48b50eb2d5f4"
            },
            "downloads": -1,
            "filename": "tensorfi_sharpe-0.1.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6f5460ea795c04d56cfc12143c6e9892",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 40452,
            "upload_time": "2025-08-08T19:23:10",
            "upload_time_iso_8601": "2025-08-08T19:23:10.923949Z",
            "url": "https://files.pythonhosted.org/packages/24/d5/aa4f425b4ee36ffbaedf261f87f83af89a269cb55aed0be3431b8b7c6b1d/tensorfi_sharpe-0.1.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "cf02d2538e3ccb7764624452a91252a7c306ff9570b984e9e3a2529162daf875",
                "md5": "64c9607f9dfb4a376630e03c9ecc2632",
                "sha256": "fb57cbbe49a5c49186ba68c59fd5337d5900c2647f601545c4142f0f7f82aecc"
            },
            "downloads": -1,
            "filename": "tensorfi_sharpe-0.1.15.tar.gz",
            "has_sig": false,
            "md5_digest": "64c9607f9dfb4a376630e03c9ecc2632",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 44101,
            "upload_time": "2025-08-08T19:23:12",
            "upload_time_iso_8601": "2025-08-08T19:23:12.056136Z",
            "url": "https://files.pythonhosted.org/packages/cf/02/d2538e3ccb7764624452a91252a7c306ff9570b984e9e3a2529162daf875/tensorfi_sharpe-0.1.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-08 19:23:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wang-sanity",
    "github_project": "sharpe",
    "github_not_found": true,
    "lcname": "tensorfi-sharpe"
}
        
Elapsed time: 2.54947s