Metadata-Version: 2.4
Name: pysimplefin
Version: 0.2
Summary: A python library for accessing simplefin servers
Project-URL: Homepage, https://github.com/seesteins/pysimplefin
Project-URL: Repository, https://github.com/seesteins/pysimplefin
Project-URL: Issues, https://github.com/seesteins/pysimplefin/issues
License: MIT License
        
        Copyright (c) 2025 seesteins
        
        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
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.13
Requires-Dist: niquests>=3.15.2
Requires-Dist: pydantic>=2.11.9
Requires-Dist: sqlmodel>=0.0.25
Provides-Extra: dev
Requires-Dist: pytest>=8.4.1; extra == 'dev'
Requires-Dist: python-dotenv; extra == 'dev'
Description-Content-Type: text/markdown

# Pysimplefin

A library to simplify the interaction with a simplefin server in python. It is built to allow for the syncing of a local database with a remote simplefin server. This project has no affiliation with the SimpleFin project.

## Usage

You'll need to create a simplefin account. The cost is currently $1.50 per month. This can be done here <https://beta-bridge.simplefin.org/>.

### Access simplefin with a claim token

Go to your simplefin user page and generate a new claim token

```python
from pysimplefin import DefaultAuth, SimpleFinClient

auth = DefaultAuth.claim_token("your_token") # This returns a auth object that can be used to generate a client
print(auth.url) # make sure to save this url. A claim token can only be used once.
# Get a client to access data.
client = SimpleFinClient(auth)
# Get your transaction data. Will return a list of pydantic account models.
client.get_data(start_date=datetime.now()-timedelta(days=90), end_date=datetime.now(), pending=True)
```

### Example Usage with a URL

Prior to doing this you'll need to setup connections to a bank or credit card.

```python
from pysimplefin import DefaultAuth, SimpleFinclient, DatabaseManager

# pass the url generated from your claim token to the DefaultAuth
auth = DefaultAuth.from_url("https://user:pass@example_simpfin.tld/path")

# get client and data same as above
client = SimpleFinClient(auth)
data = client.get_data(start_date=datetime.now()-timedelta(days=90), end_date=datetime.now(), pending=True)

# Sync data with a database
database = DatabaseManager() # Initialize a Database Manager
database.sync(data) # Sync the data with the database.
```
