Metadata-Version: 2.1
Name: swedish-market-insights
Version: 0.3.0
Summary: Package to scrape the Finansinspektion's registers
Home-page: https://github.com/fritjof-b/swedish-market-insights
License: MIT
Author: Fritjof Bengtsson
Author-email: fritjof.folkeson@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: beautifulsoup4 (>=4.12.2,<5.0.0)
Requires-Dist: odfpy (>=1.4.1,<2.0.0)
Requires-Dist: pandas (>=2.0.1,<3.0.0)
Requires-Dist: requests (==2.28.2)
Project-URL: Repository, https://github.com/fritjof-b/swedish-market-insights
Description-Content-Type: text/markdown

# Swedish Market Insights

SMI is a small package for fetching inside trades made in Sweden.
The data is collected with `requests` and parsed with `BeautifulSoup4`
and returned as a `pandas.DataFrame`.

All data is publicly available on Finansinspektionen's [website](https://fi.se/).

## Installation

```
pip install swedish-market-insights
```

## Usage

```python3
from swedish_market_insights.inside_trades import InsideTradesAPI
from swedish_market_insights.short_positions import ShortPositionsAPI

recent_inside_trades = InsideTradesAPI.get_trades_by_transaction_date()
current_short_positions = ShortPositionsAPI.get_current_short_positions()
```

## Features

### Inside Trades
- Fetch inside trades by transaction date
- Fetch inside trades by publication date

### Short Positions
- Fetch current short positions
- Fetch historical short positions
- Fetch aggregated short positions

## Examples

### Fetch inside trades by transaction date

```python3
from swedish_market_insights.inside_trades import InsideTradesAPI
from datetime import date

trades = InsideTradesAPI.get_trades_by_transaction_date(
    from_date=date(2020, 1, 1),
    to_date=date(2020, 1, 31))
```

### Fetch inside trades by publication date

```python3
from swedish_market_insights.inside_trades import InsideTradesAPI
from datetime import date

trades = InsideTradesAPI.get_trades_by_publish_date(
    from_date=date(2022, 10, 8),
    to_date=date(2022, 10, 10))
```

### Fetch current short positions

```python3
from swedish_market_insights.short_positions import ShortPositionsAPI

current_short_positions = ShortPositionsAPI.get_current_short_positions()
```

## Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub if you have any suggestions or
improvements.

## License

This project is licensed under the MIT License.
