tinyshare


Nametinyshare JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/yourusername/tinyshare
SummaryA lightweight wrapper for tushare financial data API
upload_time2025-07-08 14:44:06
maintainerNone
docs_urlNone
authorYour Name
requires_python>=3.7
licenseMIT
keywords finance stock data tushare api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TinyShare

A lightweight wrapper for tushare financial data API that provides the exact same interface as tushare but with additional features and optimizations.

## Installation

```bash
pip install tinyshare
```

## Usage

TinyShare provides the exact same API as tushare, so you can simply replace your import statement:

```python
# Instead of: import tushare as ts
import tinyshare as ts

# Set your token
ts.set_token('your_tushare_token_here')
pro = ts.pro_api()

# Get index daily data
df = pro.index_daily(
    ts_code='000001.SH',
    start_date='20250621',
    end_date='20250628'
)

print(df)
```

## New Features

### Free Minute Data with stk_mins_tiny

TinyShare now provides a free alternative to tushare's `stk_mins` interface using baostock data:

```python
import tinyshare as ts

# Get minute data for free (no tushare credits needed)
df = ts.stk_mins_tiny(
    ts_code='600000.SH',
    freq='5min',
    start_date='2023-08-25',
    end_date='2023-08-25'
)

print(df.head())
```

**Key Features:**
- 🆓 **Free**: No tushare credits required
- 📊 **Multiple frequencies**: 1min, 5min, 15min, 30min, 60min
- 🔄 **Format compatibility**: Returns tushare-compatible format by default
- 📈 **Rich history**: Access to years of historical minute data
- 🎯 **Dual format**: Support both tushare format and raw baostock format

**Supported Parameters:**
- `ts_code`: Stock code (e.g., '600000.SH', '000001.SZ')
- `freq`: Frequency ('1min', '5min', '15min', '30min', '60min')
- `start_date`: Start date (optional)
- `end_date`: End date (optional)
- `origin`: Return raw baostock format when True (default: False)

## Features

- **100% API Compatible**: Drop-in replacement for tushare
- **Enhanced Token Management**: Support for both tokens and extract codes
- **Free Minute Data**: Get minute-level data without tushare credits
- **Enhanced Error Handling**: Better error messages and debugging
- **Performance Optimizations**: Caching and request optimization
- **Easy Migration**: Simply change your import statement

## Requirements

- Python 3.7+
- tushare>=1.2.0
- pandas>=1.0.0
- baostock>=0.8.0

## Examples

### Basic Usage
```python
import tinyshare as ts

# Set token (supports both regular tokens and extract codes)
ts.set_token('your_token_here')
pro = ts.pro_api()

# Get stock data
df = pro.daily(ts_code='000001.SZ', start_date='20240101', end_date='20240131')
```

### Free Minute Data
```python
import tinyshare as ts

# Get 5-minute data for the last week
df = ts.stk_mins_tiny('600000.SH', '5min')

# Get 1-minute data for specific date range
df = ts.stk_mins_tiny('000001.SZ', '1min', '2023-08-25', '2023-08-25')

# Get raw baostock format
df_raw = ts.stk_mins_tiny('600000.SH', '5min', origin=True)
```

## License

MIT License

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yourusername/tinyshare",
    "name": "tinyshare",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "finance, stock, data, tushare, api",
    "author": "Your Name",
    "author_email": "Your Name <your.email@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/a7/b9/f7af72133b1e40a64eeafc4acf24dd792cb0fbfe4742d4e2508d8a7a6a26/tinyshare-0.3.0.tar.gz",
    "platform": null,
    "description": "# TinyShare\n\nA lightweight wrapper for tushare financial data API that provides the exact same interface as tushare but with additional features and optimizations.\n\n## Installation\n\n```bash\npip install tinyshare\n```\n\n## Usage\n\nTinyShare provides the exact same API as tushare, so you can simply replace your import statement:\n\n```python\n# Instead of: import tushare as ts\nimport tinyshare as ts\n\n# Set your token\nts.set_token('your_tushare_token_here')\npro = ts.pro_api()\n\n# Get index daily data\ndf = pro.index_daily(\n    ts_code='000001.SH',\n    start_date='20250621',\n    end_date='20250628'\n)\n\nprint(df)\n```\n\n## New Features\n\n### Free Minute Data with stk_mins_tiny\n\nTinyShare now provides a free alternative to tushare's `stk_mins` interface using baostock data:\n\n```python\nimport tinyshare as ts\n\n# Get minute data for free (no tushare credits needed)\ndf = ts.stk_mins_tiny(\n    ts_code='600000.SH',\n    freq='5min',\n    start_date='2023-08-25',\n    end_date='2023-08-25'\n)\n\nprint(df.head())\n```\n\n**Key Features:**\n- \ud83c\udd93 **Free**: No tushare credits required\n- \ud83d\udcca **Multiple frequencies**: 1min, 5min, 15min, 30min, 60min\n- \ud83d\udd04 **Format compatibility**: Returns tushare-compatible format by default\n- \ud83d\udcc8 **Rich history**: Access to years of historical minute data\n- \ud83c\udfaf **Dual format**: Support both tushare format and raw baostock format\n\n**Supported Parameters:**\n- `ts_code`: Stock code (e.g., '600000.SH', '000001.SZ')\n- `freq`: Frequency ('1min', '5min', '15min', '30min', '60min')\n- `start_date`: Start date (optional)\n- `end_date`: End date (optional)\n- `origin`: Return raw baostock format when True (default: False)\n\n## Features\n\n- **100% API Compatible**: Drop-in replacement for tushare\n- **Enhanced Token Management**: Support for both tokens and extract codes\n- **Free Minute Data**: Get minute-level data without tushare credits\n- **Enhanced Error Handling**: Better error messages and debugging\n- **Performance Optimizations**: Caching and request optimization\n- **Easy Migration**: Simply change your import statement\n\n## Requirements\n\n- Python 3.7+\n- tushare>=1.2.0\n- pandas>=1.0.0\n- baostock>=0.8.0\n\n## Examples\n\n### Basic Usage\n```python\nimport tinyshare as ts\n\n# Set token (supports both regular tokens and extract codes)\nts.set_token('your_token_here')\npro = ts.pro_api()\n\n# Get stock data\ndf = pro.daily(ts_code='000001.SZ', start_date='20240101', end_date='20240131')\n```\n\n### Free Minute Data\n```python\nimport tinyshare as ts\n\n# Get 5-minute data for the last week\ndf = ts.stk_mins_tiny('600000.SH', '5min')\n\n# Get 1-minute data for specific date range\ndf = ts.stk_mins_tiny('000001.SZ', '1min', '2023-08-25', '2023-08-25')\n\n# Get raw baostock format\ndf_raw = ts.stk_mins_tiny('600000.SH', '5min', origin=True)\n```\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. \n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A lightweight wrapper for tushare financial data API",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/yourusername/tinyshare",
        "Issues": "https://github.com/yourusername/tinyshare/issues",
        "Repository": "https://github.com/yourusername/tinyshare.git"
    },
    "split_keywords": [
        "finance",
        " stock",
        " data",
        " tushare",
        " api"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6b4151762dfedb337e8bc5d38e52fce3e68df64a526709f93d12bd75fe66ffc3",
                "md5": "7587d5550fb33c0c7eeb7661e4c6d297",
                "sha256": "0b5ce7bfa597892f2d2b60b3becff529ba98b2c65945a1365151aaf276bf8b21"
            },
            "downloads": -1,
            "filename": "tinyshare-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7587d5550fb33c0c7eeb7661e4c6d297",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 11915,
            "upload_time": "2025-07-08T14:44:04",
            "upload_time_iso_8601": "2025-07-08T14:44:04.617754Z",
            "url": "https://files.pythonhosted.org/packages/6b/41/51762dfedb337e8bc5d38e52fce3e68df64a526709f93d12bd75fe66ffc3/tinyshare-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a7b9f7af72133b1e40a64eeafc4acf24dd792cb0fbfe4742d4e2508d8a7a6a26",
                "md5": "d4ba3cd76a7ccd61d0f44907dec89295",
                "sha256": "356a6ef3969625e83d68ef078ba9fd908afb7ec770905e912953a8c9888dcabc"
            },
            "downloads": -1,
            "filename": "tinyshare-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d4ba3cd76a7ccd61d0f44907dec89295",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 16094,
            "upload_time": "2025-07-08T14:44:06",
            "upload_time_iso_8601": "2025-07-08T14:44:06.880010Z",
            "url": "https://files.pythonhosted.org/packages/a7/b9/f7af72133b1e40a64eeafc4acf24dd792cb0fbfe4742d4e2508d8a7a6a26/tinyshare-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-08 14:44:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "tinyshare",
    "github_not_found": true,
    "lcname": "tinyshare"
}
        
Elapsed time: 1.74248s