Metadata-Version: 2.2
Name: viseca
Version: 0.1.1
Summary: Fetch transactions from Viseca One
License: MIT License
        
        Copyright (c) 2025 peacefulotter
        
        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.
        
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: click>=8.1.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: matplotlib>=3.10.1
Requires-Dist: pandas>=2.2.3
Requires-Dist: pymixbox>=2.0.0
Requires-Dist: scipy>=1.15.2
Requires-Dist: seaborn>=0.13.2
Requires-Dist: pydantic>=2.10.6

<div align="center">
    <h1>💸 viseca</h2>
    <div>
        <p align="center">
          <a aria-label="MIT License" href="https://opensource.org/licenses/MIT">
            <img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge">
          </a>
          <a aria-label="pypi" href="https://img.shields.io/pypi/pyversions/viseca">
            <img src="https://img.shields.io/pypi/pyversions/viseca?style=for-the-badge">  
          </a>
          <a aria-label="GitHub last commit" href="https://www.github.com/peacefulotter/viseca">
            <img src="https://img.shields.io/github/last-commit/peacefulotter/viseca/main?style=for-the-badge">
          </a>
        </p>
    </div>
    <h3><b>Fetch transactions from Viseca One</b></h3>
</div>

```sh
>>> uv add viseca
```


## Usage

This method processes the auth flow in the CLI and will trigger a 2FA request like the login in a browser would.

1. Log in to [one.viseca.ch](https://one.viseca.ch) and navigate to "Transactions"
1. Obtain the card ID from the path (between `/v1/card/` and `/transactions`) and store it in your `.env` file. Additionaly, to avoid entering your credentials everytime, feel free to add them to the `.env` file as well. 
    ```sh
    cp .env.example .env
    >>> VISECA_USERNAME=YOUR_MAIL
    >>> VISECA_PASSWORD=YOUR_PASSWORD
    >>> VISECA_CARD_ID=YOUR_CARD_ID
    ```
1.  Fetch transactions (and save them to a file)
    - Using commands
    ```sh
    uv run viseca/transactions.py --file transactions.csv
    ```
    - Or the python package
    ```python
    from viseca import VisecaClient, format_transactions

    client = VisecaClient()
    txs = client.list_transactions()
    df = format_transactions(txs)
    df.to_csv("transactions.csv")
    ```
