Title: Add API call to download one file · Issue #210 · MerginMaps/python-api-client · GitHub
Open Graph Title: Add API call to download one file · Issue #210 · MerginMaps/python-api-client
X Title: Add API call to download one file · Issue #210 · MerginMaps/python-api-client
Description: Currently, there's no simple way to fetch just one file from a project. There is download_file() API call, but it needs the project to be already downloaded (it is useful just to get older versions of a file). One could either query MM s...
Open Graph Description: Currently, there's no simple way to fetch just one file from a project. There is download_file() API call, but it needs the project to be already downloaded (it is useful just to get older versions...
X Description: Currently, there's no simple way to fetch just one file from a project. There is download_file() API call, but it needs the project to be already downloaded (it is useful just to get older vers...
Opengraph URL: https://github.com/MerginMaps/python-api-client/issues/210
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add API call to download one file","articleBody":"Currently, there's no simple way to fetch just one file from a project. There is `download_file()` API call, but it needs the project to be already downloaded (it is useful just to get older versions of a file).\r\n\r\nOne could either query MM server API directly, e.g.:\r\n```\r\nhttps://app.merginmaps.com/v1/project/raw/\u003cworkspace\u003e/\u003cproject\u003e?file=myfile.gpkg\r\n```\r\n(with appropriate auth token)\r\n\r\nAlternatively, using python with a workaround like this (handles auth stuff):\r\n```python\r\nfrom mergin import MerginClient\r\nfrom mergin.utils import save_to_file\r\n\r\nmergin_client = MerginClient(...)\r\nres = mergin_client.get('/v1/project/raw/\u003cworkspace\u003e/\u003cproject\u003e', data={'file': 'myfile.gpkg'})\r\nsave_to_file(res, 'myfile.gpkg')\r\n```\r\n\r\nIf we add support for this, maybe we could just update the existing `download_file()` implementation so that it will accept as the first argument either `\u003cworkspace\u003e/\u003cproject\u003e` or it would accept an existing the local directory with a project downloaded already.","author":{"url":"https://github.com/wonder-sk","@type":"Person","name":"wonder-sk"},"datePublished":"2024-07-18T13:57:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/210/python-api-client/issues/210"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4c3b29b8-2c7c-6e65-a5c0-083405d8da23 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB48:3F2721:383188E:4AD6FEC:6981A42D |
| html-safe-nonce | da794c10e182184bd07fff19acbae3446328e92af9bf609ea7783a597a4890bc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjQ4OjNGMjcyMTozODMxODhFOjRBRDZGRUM6Njk4MUE0MkQiLCJ2aXNpdG9yX2lkIjoiMzM3MTQyODA3NzkwODM3MDQ3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 019bed8cec83daec18079e5b65e6b12a597f6da83ed70e586dcda1fd39d33b75 |
| hovercard-subject-tag | issue:2416475485 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/MerginMaps/python-api-client/210/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2c287d473dd33b4056f26ce19a39d08e480fc5473ab72d9b236becac704024b5/MerginMaps/python-api-client/issues/210 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2c287d473dd33b4056f26ce19a39d08e480fc5473ab72d9b236becac704024b5/MerginMaps/python-api-client/issues/210 |
| og:image:alt | Currently, there's no simple way to fetch just one file from a project. There is download_file() API call, but it needs the project to be already downloaded (it is useful just to get older versions... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wonder-sk |
| hostname | github.com |
| expected-hostname | github.com |
| None | e137814e266030874fd2c86863529d0622b13889eeda04148c57654b6ea84ad6 |
| turbo-cache-control | no-preview |
| go-import | github.com/MerginMaps/python-api-client git https://github.com/MerginMaps/python-api-client.git |
| octolytics-dimension-user_id | 88134486 |
| octolytics-dimension-user_login | MerginMaps |
| octolytics-dimension-repository_id | 182099139 |
| octolytics-dimension-repository_nwo | MerginMaps/python-api-client |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 182099139 |
| octolytics-dimension-repository_network_root_nwo | MerginMaps/python-api-client |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | dd58d68a7813bbec9c91422c8c35f4af33832d70 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width