Metadata-Version: 2.4
Name: emta
Version: 0.0.1
Summary: Easy Money Trading Agent
Author-email: zhou bo <wokspc@gmail.com>
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).
