{"id":18606099,"url":"https://github.com/phistrom/basecampy3","last_synced_at":"2025-04-10T20:31:28.699Z","repository":{"id":55501863,"uuid":"129980838","full_name":"phistrom/basecampy3","owner":"phistrom","description":"A Python API for Basecamp 3","archived":false,"fork":false,"pushed_at":"2022-12-09T05:16:43.000Z","size":319,"stargazers_count":36,"open_issues_count":6,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-09-19T02:39:19.219Z","etag":null,"topics":["api-client","basecamp","basecamp3","cli","forhumans"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phistrom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-18T00:31:56.000Z","updated_at":"2024-02-23T06:51:12.000Z","dependencies_parsed_at":"2023-01-25T11:01:55.821Z","dependency_job_id":null,"html_url":"https://github.com/phistrom/basecampy3","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phistrom%2Fbasecampy3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phistrom%2Fbasecampy3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phistrom%2Fbasecampy3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phistrom%2Fbasecampy3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phistrom","download_url":"https://codeload.github.com/phistrom/basecampy3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223445686,"owners_count":17146330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","basecamp","basecamp3","cli","forhumans"],"created_at":"2024-11-07T02:24:16.976Z","updated_at":"2024-11-07T02:24:17.575Z","avatar_url":"https://github.com/phistrom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BasecamPY3\n\nAn easy-to-use Python interface to\nthe [Basecamp 3 API](https://github.com/basecamp/bc3-api).\n\n*BasecamPY3 will drop Python 2.7 and 3.5 support in the 1.0.0 release.*\n\n## Features\n\n- Easy, AWS CLI-like configuration and installation\n- Object-oriented API\n- Handles rate-limiting, caching, and authentication for you!\n\n## Install\n\n```shell\npip install basecampy3\nbc3 configure\n```\n\nFollow the prompts to obtain an access and refresh token which is then saved\nto `~/.config/basecamp.conf`, allowing you to call `Basecamp3()` without any\nparameters. You will need to make your own\n[Basecamp 3 app integration](https://launchpad.37signals.com/integrations)\nfirst.\n\n### Storing in environment variables\n\nOnce you have the credentials you can store them in environment variables:\n\n* `BASECAMP_CLIENT_ID`\n* `BASECAMP_CLIENT_SECRET`\n* `BASECAMP_REDIRECT_URL`\n* `BASECAMP_ACCESS_TOKEN`\n* `BASECAMP_REFRESH_TOKEN`\n\nThis will allow for easier deploys using CI, initializing with:\n\n```py\nfrom basecampy3 import Basecamp3\n\nbc3 = Basecamp3.from_environment()\n```\n\n## Usage\n\n### Basic Example\n\n```py\nfrom basecampy3 import Basecamp3\n\nbc3 = Basecamp3()\n\nfor project in bc3.projects.list():\n    print(project.name)\n\nnew_project = bc3.projects.create(\"My New Project\",\n                                  description=\"The best project ever made.\")\nnew_project.campfire.post_message(\"Hello World!\")\nnew_message = new_project.message_board.post_message(\"Check this out\",\n                                                     content=\"This is a new message thread start.\")\nnew_message.archive()\n\ntodolist = new_project.todoset.create(\"Things to be done\")\ntodolist.create(\"Get Milk\")\ntodolist.create(\"Get Eggs\")\ngo_to_bed = todolist.create(\"Go to bed.\")\ngo_to_bed.check()  # this is marked as done\n```\n\n**Not all functionality of the API is available yet.** For anything missing, you\ncan use the [requests Session object][Session Objects] yourself directly and \nconsult the [Basecamp 3 API docs]. The benefit of using this Session object \nis you will benefit from the authentication, rate-limiting, and caching \nfeatures.\n\nThe full API _is_ implemented in the `basecampy3.urls` package, however. The \n`Basecamp3` object now has a `urls` object that implements a 1:1 mapping \nwith the Basecamp 3 API. Using this `urls` object, you can create the URL \nyou need to get the information you want, and then call `.request()` on it to \nreceive a `Response` object, from which you can use `.json()` to get the \ndata you are looking for.\n\n### Direct Session Example\n\n```python\nfrom basecampy3 import Basecamp3\nimport json\n\nbc3 = Basecamp3()\n\n# replace these with actual IDs of the Basecamp objects you wish to get\nrecording_id = 123456789\nproject_id = 1234567\n\n# Reference:\n# https://github.com/basecamp/bc3-api/blob/master/sections/comments.md#get-comments\n\nurl = bc3.urls.comments.list_by_recording(project=project_id,\n                                          recording=recording_id)\nresponse = url.request(bc3.session)\nif not response.ok:\n    print(\"Something went wrong. %s: %s\" % (\n    response.status_code, response.text))\n    exit(1)\n\ndata = response.json()\npretty_print = json.dumps(data, indent=4)\nprint(pretty_print)\n```\n\n### CLI Example\n\n**COMING SOON!**\nCommand Line interface for doing stuff with Basecamp.\n**(not working yet)**\n\n```\n  $ bc3 copy-access 12341234 87658765  # give user 87658765 access to all the projects that 12341234 does\n```\n\n## Todo\n\n- The rest of the Basecamp 3 API\n- Command line tool (beyond just the \"configure\" command)\n- Better testing coverage\n\n[Basecamp 3 API docs]: \u003chttps://github.com/basecamp/bc3-api/tree/master/sections\u003e\n[Session Objects]:  \u003chttps://requests.readthedocs.io/en/master/user/advanced/#session-objects\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphistrom%2Fbasecampy3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphistrom%2Fbasecampy3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphistrom%2Fbasecampy3/lists"}