Metadata-Version: 2.4
Name: emta
Version: 0.0.3
Summary: Easy Money Trading Agent
Author-email: zhou bo <wokspc@gmail.com>
License: MIT License
        
        Copyright (c) 2025 wokspc
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: cryptography>=45.0.6
Requires-Dist: ddddocr>=1.5.6
Requires-Dist: httpx>=0.28.1
Requires-Dist: loguru>=0.7.3
Description-Content-Type: text/markdown

# 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
├── trading.py         # Trading agent implementation
└── py.typed           # Type hints marker
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).
