Skip to main content

freeagent

freeagent is a python library for using the freeagent API.

Initial setup

Create an API app entry at the Freeagent Dev Portal

Exmple

from os import environ
import json

from freeagent import FreeAgent

def _load_token():
    with open("token.json", "r") as f:
        token = json.load(f)
    except (FileNotFoundError, json.JSONDecodeError):
        token = None
    return token

def _save_token(token_data):
    # save the token
    with open("token.json", "w") as f:
        json.dump(token_data, f)

client_id = environ["FREEAGENT_ID"]
client_secret = environ["FREEAGENT_SECRET"]

token = _load_token()

freeagent_client = FreeAgent()
freeagent_client.authenticate(client_id, client_secret ,_save_token, token)

main_response = freeagent_client.get_api("users/me")
print(
f"✅ Authenticated! User info: {main_response['user']['first_name']} {main_response['user']['last_name']}"
)

paypal_id = freeagent_client.bank.get_first_paypal_id()
paypal_data = freeagent_client.bank.get_unexplained_transactions(paypal_id)

Documentation

Full documentation is available at
👉 https://a16bitsysop.github.io/freeagentPY/


Running Tests

Run tests:

pytest

Contributing

Contributions are welcome! Please:

  1. Fork the repo
  2. Create your feature branch git checkout -b my-feature
  3. Edit the source code to add and test your changes
  4. Commit your changes git commit -m 'Add some feature'
  5. Push to your branch git push origin my-feature
  6. Open a Pull Request

Please follow the existing code style and write tests for new features.


License

This project is licensed under the MIT MIT License.


Contact

Created and maintained by Duncan Bellamy. Feel free to open issues or reach out on GitHub.


Metadata

Release files for freeagent 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for freeagent 0.3.1
File Size Uploaded Provenance
freeagent-0.3.1.tar.gz 14.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for freeagent 0.3.1
File Interpreter ABI Platform
freeagent-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.7 kB

Release files / freeagent-0.3.1.tar.gz

Download URL freeagent-0.3.1.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d2296eab4f35216498f9cfaf16ddcba4131c731e2edb784c80bc95ab0a044f35
BLAKE2b-256 checksum
How to use checksums
d82cff7283661fabf03a65c0ee6faa3e370fd77bfcbb7338c5350ebfbd371f16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2026.

Transparency log

Release files / freeagent-0.3.1-py3-none-any.whl

Download URL freeagent-0.3.1-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0bbc0acc51f7f79e12a3eb9893b0fe595e0f9ea54d5ed94772ed9b194141631
BLAKE2b-256 checksum
How to use checksums
4a1183a32ea303ae5e6ebde73f7204ab7ed2059997f61c0427e7a85762e25fa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2026.

Transparency log

Security for freeagent 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for freeagent-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page