# emta
## Overview
Unofficial EasyMoney Trading Library
## Technology Stack
* Use UV to manage development environments and third-party dependencies.
* Use [Pytest testing](https://github.com/pytest-dev/pytest) ensures the correctness of each module and function.
## Features
* [x] login to eastmoney
* [x] Modular code structure
* [x] Error handling
* [x] Trading agent with order placement and management
* [x] Market data retrieval
## Installation
Ensure you are using Python 3.11 or later (but less than 4.0).
``` shell
pip install emta
```
## Usage
```python
from emta import TradingAgent, OrderType
# Create a trading agent
agent = TradingAgent("your_username", "your_password")
# Login to Eastmoney
if agent.login():
# Place a buy order
order_id = agent.place_order("SH600000", OrderType.BUY, 100, 12.5)
# Get market data
market_data = agent.get_market_data("SH600000")
# Logout
agent.logout()
```
See [examples/trading_example.py](examples/trading_example.py) for a complete example.
## Testing
Tests for the app are included using [pytest](https://docs.pytest.org/). To run the tests, simply execute:
```bash
uv run pytest
```
## Project Structure
```
src/emta/ # Main source code
├── __init__.py # Package initialization
├── py.typed # Type hints marker
├── core/ # Core trading agent implementation
│ └── agent.py # Main trading agent class
├── models/ # Data models and exceptions
│ ├── trading.py # Trading data models
│ └── exceptions.py # Exception classes
├── auth/ # Authentication module
│ └── client.py # Authentication client
├── api/ # API client for trading operations
│ └── client.py # API client implementation
└── utils/ # Utility functions
├── encryption.py # Password encryption utilities
└── captcha.py # Captcha recognition utilities
tests/ # Test files
examples/ # Example usage scripts
```
## Contributing
Contributions are welcome! If you have ideas for improvements, bug fixes, or additional features, feel free to open an issue or submit a pull request.
## License
This App is open-source software released under the [MIT License](./LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "emta",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "trade, trade api, \u4e1c\u65b9\u8d22\u5bcc, \u4e1c\u8d22, \u4ea4\u6613, \u4ea4\u6613API, \u4ea4\u6613\u4ee3\u7406, \u4ea4\u6613\u673a\u5668\u4eba, \u81ea\u52a8\u4ea4\u6613, \u81ea\u52a8\u5316\u4ea4\u6613",
"author": null,
"author_email": "zhou bo <wokspc@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/62/cc/c865abc32a13ef650605944be28694d18f1e4ce14d4ffce4d471469d7896/emta-0.1.3.tar.gz",
"platform": null,
"description": "# emta\n\n## Overview\n\nUnofficial EasyMoney Trading Library\n\n## Technology Stack\n * Use UV to manage development environments and third-party dependencies.\n * Use [Pytest testing](https://github.com/pytest-dev/pytest) ensures the correctness of each module and function.\n\n## Features\n\n * [x] login to eastmoney\n * [x] Modular code structure\n * [x] Error handling\n * [x] Trading agent with order placement and management\n * [x] Market data retrieval\n\n## Installation\n\nEnsure you are using Python 3.11 or later (but less than 4.0).\n\n``` shell\npip install emta\n```\n\n## Usage\n\n```python\nfrom emta import TradingAgent, OrderType\n\n# Create a trading agent\nagent = TradingAgent(\"your_username\", \"your_password\")\n\n# Login to Eastmoney\nif agent.login():\n # Place a buy order\n order_id = agent.place_order(\"SH600000\", OrderType.BUY, 100, 12.5)\n\n # Get market data\n market_data = agent.get_market_data(\"SH600000\")\n\n # Logout\n agent.logout()\n```\n\nSee [examples/trading_example.py](examples/trading_example.py) for a complete example.\n\n## Testing\n\nTests for the app are included using [pytest](https://docs.pytest.org/). To run the tests, simply execute:\n\n```bash\nuv run pytest\n```\n\n## Project Structure\n\n```\nsrc/emta/ # Main source code\n\u251c\u2500\u2500 __init__.py # Package initialization\n\u251c\u2500\u2500 py.typed # Type hints marker\n\u251c\u2500\u2500 core/ # Core trading agent implementation\n\u2502 \u2514\u2500\u2500 agent.py # Main trading agent class\n\u251c\u2500\u2500 models/ # Data models and exceptions\n\u2502 \u251c\u2500\u2500 trading.py # Trading data models\n\u2502 \u2514\u2500\u2500 exceptions.py # Exception classes\n\u251c\u2500\u2500 auth/ # Authentication module\n\u2502 \u2514\u2500\u2500 client.py # Authentication client\n\u251c\u2500\u2500 api/ # API client for trading operations\n\u2502 \u2514\u2500\u2500 client.py # API client implementation\n\u2514\u2500\u2500 utils/ # Utility functions\n \u251c\u2500\u2500 encryption.py # Password encryption utilities\n \u2514\u2500\u2500 captcha.py # Captcha recognition utilities\ntests/ # Test files\nexamples/ # Example usage scripts\n```\n\n## Contributing\n\nContributions are welcome! If you have ideas for improvements, bug fixes, or additional features, feel free to open an issue or submit a pull request.\n\n## License\n\nThis App is open-source software released under the [MIT License](./LICENSE).\n",
"bugtrack_url": null,
"license": null,
"summary": "Easy Money Trading Agent",
"version": "0.1.3",
"project_urls": null,
"split_keywords": [
"trade",
" trade api",
" \u4e1c\u65b9\u8d22\u5bcc",
" \u4e1c\u8d22",
" \u4ea4\u6613",
" \u4ea4\u6613api",
" \u4ea4\u6613\u4ee3\u7406",
" \u4ea4\u6613\u673a\u5668\u4eba",
" \u81ea\u52a8\u4ea4\u6613",
" \u81ea\u52a8\u5316\u4ea4\u6613"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "789a29521c69367d9fc24393017d5a6361f4237f2c875e906144591c32e202b1",
"md5": "d9fc9f476b8a52998a7779d9120e370d",
"sha256": "c573afe5effe19e45ad1ebf54aa69830e512145bc29571a5fd620d134ddb66d6"
},
"downloads": -1,
"filename": "emta-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d9fc9f476b8a52998a7779d9120e370d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 15821,
"upload_time": "2025-08-29T08:45:12",
"upload_time_iso_8601": "2025-08-29T08:45:12.857212Z",
"url": "https://files.pythonhosted.org/packages/78/9a/29521c69367d9fc24393017d5a6361f4237f2c875e906144591c32e202b1/emta-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "62ccc865abc32a13ef650605944be28694d18f1e4ce14d4ffce4d471469d7896",
"md5": "6de11b849a7f2fc9b8e395e037a8e0a3",
"sha256": "f115335980caec187143a19ea6af6904cc8e7772deae7ec0da4914c8f7b1aeaa"
},
"downloads": -1,
"filename": "emta-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "6de11b849a7f2fc9b8e395e037a8e0a3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 65898,
"upload_time": "2025-08-29T08:45:14",
"upload_time_iso_8601": "2025-08-29T08:45:14.035292Z",
"url": "https://files.pythonhosted.org/packages/62/cc/c865abc32a13ef650605944be28694d18f1e4ce14d4ffce4d471469d7896/emta-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-29 08:45:14",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "emta"
}