{"id":43009904,"url":"https://github.com/merge-api/merge-python-client","last_synced_at":"2026-01-31T05:08:46.155Z","repository":{"id":182848673,"uuid":"629061511","full_name":"merge-api/merge-python-client","owner":"merge-api","description":"The Python SDK for accessing various Merge Unified APIs","archived":false,"fork":false,"pushed_at":"2025-12-18T16:32:07.000Z","size":7623,"stargazers_count":11,"open_issues_count":8,"forks_count":13,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-12-21T19:59:45.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/merge-api.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-17T14:37:18.000Z","updated_at":"2025-12-18T16:15:59.000Z","dependencies_parsed_at":"2023-07-21T21:09:33.536Z","dependency_job_id":"aa88120d-6ec3-4772-b8fe-44f91b2342ce","html_url":"https://github.com/merge-api/merge-python-client","commit_stats":null,"previous_names":["merge-api/merge-python-client"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/merge-api/merge-python-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merge-api%2Fmerge-python-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merge-api%2Fmerge-python-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merge-api%2Fmerge-python-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merge-api%2Fmerge-python-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/merge-api","download_url":"https://codeload.github.com/merge-api/merge-python-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merge-api%2Fmerge-python-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28929865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T04:05:25.756Z","status":"ssl_error","status_checked_at":"2026-01-31T04:02:35.005Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-31T05:08:44.644Z","updated_at":"2026-01-31T05:08:46.136Z","avatar_url":"https://github.com/merge-api.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Merge Python Library\n\n[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github\u0026utm_medium=github\u0026utm_campaign=readme\u0026utm_source=https%3A%2F%2Fgithub.com%2Fmerge-api%2Fmerge-python-client)\n[![pypi](https://img.shields.io/pypi/v/MergePythonClient)](https://pypi.python.org/pypi/MergePythonClient)\n\nThe Merge Python library provides convenient access to the Merge APIs from Python.\n\n## Table of Contents\n\n- [Documentation](#documentation)\n- [Installation](#installation)\n- [Reference](#reference)\n- [Usage](#usage)\n- [Instantiation](#instantiation)\n- [Categories](#categories)\n- [Async Client](#async-client)\n- [Exception Handling](#exception-handling)\n- [Advanced](#advanced)\n  - [Access Raw Response Data](#access-raw-response-data)\n  - [Retries](#retries)\n  - [Timeouts](#timeouts)\n  - [Custom Client](#custom-client)\n- [Contributing](#contributing)\n- [File Download](#file-download)\n- [Pagination](#pagination)\n\n## Documentation\n\nAPI reference documentation is available [here](https://docs.merge.dev/).\n\n## Installation\n\n```sh\npip install MergePythonClient\n```\n\n## Reference\n\nA full reference for this library is available [here](https://github.com/merge-api/merge-python-client/blob/HEAD/./reference.md).\n\n## Usage\n\nInstantiate and use the client with the following:\n\n```python\nfrom merge import Merge\nfrom merge.resources.ats import ActivityRequest\n\nclient = Merge(\n    account_token=\"YOUR_ACCOUNT_TOKEN\",\n    api_key=\"YOUR_API_KEY\",\n)\nclient.ats.activities.create(\n    is_debug_mode=True,\n    run_async=True,\n    model=ActivityRequest(),\n    remote_user_id=\"remote_user_id\",\n)\n```\n\n## Instantiation\n\n```python\nimport merge\nfrom merge.client import Merge\n\nclient = Merge(api_key=\"YOUR_API_KEY\", account_token=\"YOUR_ACCOUNT_TOKEN\")\n```\n\n## Categories\n\nThis SDK contains the ATS, HRIS, CRM, Ticketing, Accounting, and File Storage categories. Even if you do not plan on using more than one Merge API category right now, the SDK provides upgrade-flexibility in case you find new Merge API categories useful in the future.\n\nEach category is namespaced:\n\n```python\nclient = Merge(api_key=\"YOUR_API_KEY\")\n\nclient.ats. # APIs specific to the ATS Category\n\nclient.hris. # APIs specific to the HRIS Category\n```\n\n## Async Client\n\nThe SDK also exports an `async` client so that you can make non-blocking calls to our API.\n\n```python\nimport asyncio\n\nfrom merge import AsyncMerge\nfrom merge.resources.ats import ActivityRequest\n\nclient = AsyncMerge(\n    account_token=\"YOUR_ACCOUNT_TOKEN\",\n    api_key=\"YOUR_API_KEY\",\n)\n\n\nasync def main() -\u003e None:\n    await client.ats.activities.create(\n        is_debug_mode=True,\n        run_async=True,\n        model=ActivityRequest(),\n        remote_user_id=\"remote_user_id\",\n    )\n\n\nasyncio.run(main())\n```\n\n## Exception Handling\n\nWhen the API returns a non-success status code (4xx or 5xx response), a subclass of the following error\nwill be thrown.\n\n```python\nfrom merge.core.api_error import ApiError\n\ntry:\n    client.ats.activities.create(...)\nexcept ApiError as e:\n    print(e.status_code)\n    print(e.body)\n```\n\n## Advanced\n\n### Access Raw Response Data\n\nThe SDK provides access to raw response data, including headers, through the `.with_raw_response` property.\nThe `.with_raw_response` property returns a \"raw\" client that can be used to access the `.headers` and `.data` attributes.\n\n```python\nfrom merge import Merge\n\nclient = Merge(\n    ...,\n)\nresponse = client.ats.activities.with_raw_response.create(...)\nprint(response.headers)  # access the response headers\nprint(response.data)  # access the underlying object\n```\n\n### Retries\n\nThe SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long\nas the request is deemed retryable and the number of retry attempts has not grown larger than the configured\nretry limit (default: 2).\n\nA request is deemed retryable when any of the following HTTP status codes is returned:\n\n- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)\n- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)\n- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)\n\nUse the `max_retries` request option to configure this behavior.\n\n```python\nclient.ats.activities.create(..., request_options={\n    \"max_retries\": 1\n})\n```\n\n### Timeouts\n\nThe SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.\n\n```python\n\nfrom merge import Merge\n\nclient = Merge(\n    ...,\n    timeout=20.0,\n)\n\n\n# Override timeout for a specific method\nclient.ats.activities.create(..., request_options={\n    \"timeout_in_seconds\": 1\n})\n```\n\n### Custom Client\n\nYou can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies\nand transports.\n\n```python\nimport httpx\nfrom merge import Merge\n\nclient = Merge(\n    ...,\n    httpx_client=httpx.Client(\n        proxy=\"http://my.test.proxy.example.com\",\n        transport=httpx.HTTPTransport(local_address=\"0.0.0.0\"),\n    ),\n)\n```\n\n## Contributing\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nAdditions made directly to this library would have to be moved over to our generation code,\notherwise they would be overwritten upon the next generated release. Feel free to open a PR as\na proof of concept, but know that we will not be able to merge it as-is. We suggest opening\nan issue first to discuss with us!\n\nOn the other hand, contributions to the README are always very welcome!\n## File Download\n\n```python\nimport merge\nfrom merge.client import Merge\n\nmerge_client = Merge(\n    api_key=\"\u003cYOUR_API_KEY\u003e\", \n    account_token=\"\u003cYOUR_ACCOUNT_TOKEN\u003e\")\n\nfiles = merge_client.filestorage.files.list(name=\"\u003cFILE_NAME\u003e\").results\n\nid = files[0].id\nname = files[0].name\nlocal_filename = f\"\u003cLOCAL_FILE_PATH\u003e/{name}\"\n\nresponse = merge_client.filestorage.files.download_retrieve(id=id)\nwith open(local_filename, \"wb\") as f:\n    for chunk in response:\n        f.write(chunk)\n```\n\n## Pagination\n\nThe SDK may return paginated results. Endpoints that return paginated results will \ninclude a `next` and `prev` property on the response. To get the next page, you can \npass in the value of `next` to the cursor property on the request. Similarly, to \nget the previous page, you can pass in the value of `prev` to the cursor property on \nthe request. \n\nBelow is an example of iterating over all pages:\n```python\n\n# response contains the first page\nresponse = merge_client.hris.employees.list(created_after=\"2030-01-01\")\n\n# if there is a next page, load it by passing `next` to the cursor argument\nwhile response.next is not None:\n    response = hris_client.employees.list(\n        cursor=response.next, \n        created_after=\"2030-01-01\")\n```\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmerge-api%2Fmerge-python-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmerge-api%2Fmerge-python-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmerge-api%2Fmerge-python-client/lists"}