Public class
Project description
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:
- Fork the repo
- Create your feature branch
git checkout -b my-feature - Edit the source code to add and test your changes
- Commit your changes
git commit -m 'Add some feature' - Push to your branch
git push origin my-feature - 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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file freeagent-0.1.tar.gz.
File metadata
- Download URL: freeagent-0.1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d0965bf052ef15ab71ba23c5e4ac4e733f0b8387c8505b1fbd79bb6fe1207f5
|
|
| MD5 |
295768c3396a3a06fbde8ae9e704032b
|
|
| BLAKE2b-256 |
99f5b41df75d8dc7751197113ed81ce236e1a24004f88f73bee34fb3b5bcfd2b
|
Provenance
The following attestation bundles were made for freeagent-0.1.tar.gz:
Publisher:
publish.yaml on a16bitsysop/freeagentPY
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
freeagent-0.1.tar.gz -
Subject digest:
9d0965bf052ef15ab71ba23c5e4ac4e733f0b8387c8505b1fbd79bb6fe1207f5 - Sigstore transparency entry: 844767827
- Sigstore integration time:
-
Permalink:
a16bitsysop/freeagentPY@4a136d763adf38f7516a71f3daea64d2b98f509d -
Branch / Tag:
refs/tags/v0.1 - Owner: https://github.com/a16bitsysop
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@4a136d763adf38f7516a71f3daea64d2b98f509d -
Trigger Event:
push
-
Statement type:
File details
Details for the file freeagent-0.1-py3-none-any.whl.
File metadata
- Download URL: freeagent-0.1-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eea21028c6ab5d6df1a04051d63723f999a8a12acbeb822f9d7a0b0f922bfb89
|
|
| MD5 |
448565f37dfb506ba8d51d591cdec592
|
|
| BLAKE2b-256 |
e5458ba967cdad7abf24db0ae08949e4eb63ec1621278b9dd54af011faa9290b
|
Provenance
The following attestation bundles were made for freeagent-0.1-py3-none-any.whl:
Publisher:
publish.yaml on a16bitsysop/freeagentPY
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
freeagent-0.1-py3-none-any.whl -
Subject digest:
eea21028c6ab5d6df1a04051d63723f999a8a12acbeb822f9d7a0b0f922bfb89 - Sigstore transparency entry: 844767829
- Sigstore integration time:
-
Permalink:
a16bitsysop/freeagentPY@4a136d763adf38f7516a71f3daea64d2b98f509d -
Branch / Tag:
refs/tags/v0.1 - Owner: https://github.com/a16bitsysop
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@4a136d763adf38f7516a71f3daea64d2b98f509d -
Trigger Event:
push
-
Statement type: