move-coop / parsons

A python library of connectors for the progressive community.
https://www.parsonsproject.org/
Other
259 stars 131 forks source link

feat: add Nation Builder Connector #837

Closed gcollazo closed 1 year ago

gcollazo commented 1 year ago

This PR adds a new Nation Builder connector.

The connector implements the following public methods:

Examples

The following examples help illustrate the API usage.

from dotenv import load_dotenv

from parsons.nation_builder.nation_builder import NationBuilder

load_dotenv()

nb = NationBuilder()

# get all people and return a Table
people_table = nb.get_people()
people_table.to_csv("nbexport.csv")

# update person by id
data = {"email": "foo@example.com", "tags": ["foo", "bar"]}
updated_person_1 = nb.update_person("123456789", data)

# update or create a person
data = {"email": "foo@example.com", "tags": ["dogs", "cats"]}
created, person = nb.upsert_person(data)

if created:
    print("Person created:", person)
else:
    print("Person updated:", person)
gcollazo commented 1 year ago

Just added the necessary docs using the ActBlue page as a template. I think it's complete and clear but let me know if something else is needed.

We can schedule a quick call and I can run a few test scenarios using our live NB account. I'm on Slack so you can contact me there to coordinate.

We have not explored becoming certified developers since what we are building is for our own internal use. I have a weekly meeting with NB I will bring that up and let you know.

The CI failure looks unrelated to this PR.

gcollazo commented 1 year ago

@shaunagm just added the additional tests using fixtures. Please do let me know if you need additional changes.