{"id":38600756,"url":"https://github.com/mercoa-finance/python","last_synced_at":"2026-01-17T08:33:26.815Z","repository":{"id":152776290,"uuid":"626074282","full_name":"mercoa-finance/python","owner":"mercoa-finance","description":"Mercoa Python Library","archived":false,"fork":false,"pushed_at":"2025-08-27T20:45:16.000Z","size":2305,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-28T05:19:00.042Z","etag":null,"topics":["asyncio","pip","poetry","python","python3"],"latest_commit_sha":null,"homepage":"https://mercoa.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mercoa-finance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-10T18:37:23.000Z","updated_at":"2025-08-27T20:45:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"8daef2cf-c4b6-4200-8409-df2d8d76edd3","html_url":"https://github.com/mercoa-finance/python","commit_stats":null,"previous_names":[],"tags_count":128,"template":false,"template_full_name":null,"purl":"pkg:github/mercoa-finance/python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mercoa-finance%2Fpython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mercoa-finance%2Fpython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mercoa-finance%2Fpython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mercoa-finance%2Fpython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mercoa-finance","download_url":"https://codeload.github.com/mercoa-finance/python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mercoa-finance%2Fpython/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"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":["asyncio","pip","poetry","python","python3"],"created_at":"2026-01-17T08:33:26.224Z","updated_at":"2026-01-17T08:33:26.804Z","avatar_url":"https://github.com/mercoa-finance.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mercoa 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%2Fmercoa-finance%2Fpython)\n[![pypi](https://img.shields.io/pypi/v/mercoa)](https://pypi.python.org/pypi/mercoa)\n\nThe Mercoa Python library provides convenient access to the Mercoa APIs from Python.\n\n## Installation\n\n```sh\npip install mercoa\n```\n\n## Reference\n\nA full reference for this library is available [here](https://github.com/mercoa-finance/python/blob/HEAD/./reference.md).\n\n## Usage\n\nInstantiate and use the client with the following:\n\n```python\nfrom mercoa import Mercoa\nfrom mercoa.entity_group_types import EntityGroupCreateRequest\n\nclient = Mercoa(\n    token=\"YOUR_TOKEN\",\n)\nclient.entity_group.create(\n    request=EntityGroupCreateRequest(\n        foreign_id=\"your-group-id\",\n        name=\"Coastal Corporation\",\n        email_to_name=\"coastalcorp\",\n        entity_ids=[\n            \"ent_e8c2af94-61cd-4036-a765-80341209167b\",\n            \"ent_1176dd0c-12e1-41c7-85a5-ae9b4746e64b\",\n            \"ent_3dbb4ede-2d1d-49be-a996-a5dfad3641be\",\n        ],\n    ),\n)\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 mercoa import AsyncMercoa\nfrom mercoa.entity_group_types import EntityGroupCreateRequest\n\nclient = AsyncMercoa(\n    token=\"YOUR_TOKEN\",\n)\n\n\nasync def main() -\u003e None:\n    await client.entity_group.create(\n        request=EntityGroupCreateRequest(\n            foreign_id=\"your-group-id\",\n            name=\"Coastal Corporation\",\n            email_to_name=\"coastalcorp\",\n            entity_ids=[\n                \"ent_e8c2af94-61cd-4036-a765-80341209167b\",\n                \"ent_1176dd0c-12e1-41c7-85a5-ae9b4746e64b\",\n                \"ent_3dbb4ede-2d1d-49be-a996-a5dfad3641be\",\n            ],\n        ),\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 mercoa.core.api_error import ApiError\n\ntry:\n    client.entity_group.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 mercoa import Mercoa\n\nclient = Mercoa(\n    ...,\n)\nresponse = client.entity_group.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.entity_group.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 mercoa import Mercoa\n\nclient = Mercoa(\n    ...,\n    timeout=20.0,\n)\n\n\n# Override timeout for a specific method\nclient.entity_group.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 mercoa import Mercoa\n\nclient = Mercoa(\n    ...,\n    httpx_client=httpx.Client(\n        proxies=\"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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmercoa-finance%2Fpython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmercoa-finance%2Fpython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmercoa-finance%2Fpython/lists"}