Skip to content

Commit

Permalink
examples: add hello world and list accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Nov 11, 2024
1 parent fa918ae commit ffd0cb8
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Build SDK
run: |
poetry build
- name: Install SDK
run: |
pip install dist/moov-*.whl
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV

- name: Run examples
run: |
for script in examples/*.py; do
python3 "$script"
done
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ __pycache__/
.DS_Store
pyrightconfig.json
README-PYPI.md

poetry.lock
/myenv
/dist/
1 change: 1 addition & 0 deletions .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ python:
description: Python Client SDK Generated by Speakeasy.
enumFormat: enum
envVarPrefix: MOOV
homepage: https://github.com/moovfinancial/moov-python
fixFlags:
responseRequiredSep2024: true
flattenGlobalSecurity: true
Expand Down
20 changes: 20 additions & 0 deletions examples/accounts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import moov
from moov import Moov
import os

s = Moov(
gateway_auth=os.getenv("MOOV_GATEWAY_AUTH", ""),
)

res = s.accounts.list_accounts(request={
"name": "Lincoln National Corporation",
# "email": "someone@moov.io",
# "type": moov.AccountType.BUSINESS,
# "foreign_id": "4528aba-b9a1-11eb-8529-0242ac13003",
# "include_disconnected": True,
# "count": 10,
# "skip": 10,
})

if res is not None:
print(res)
8 changes: 8 additions & 0 deletions examples/hello_world.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from moov import some_module

def main():
# Example code using the library
print(some_module.some_function())

if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ typing-inspect = "^0.9.0"
mypy = "==1.10.1"
pylint = "==3.2.3"
types-python-dateutil = "^2.9.0.20240316"
pytest = "^8.3.3"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit ffd0cb8

Please sign in to comment.