Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add list-files command #199

Merged
merged 4 commits into from
Sep 6, 2024
Merged

add list-files command #199

merged 4 commits into from
Sep 6, 2024

Conversation

kaloyan13
Copy link
Contributor

@kaloyan13 kaloyan13 commented Apr 7, 2024

Add a list-files command, with optional JSON output.

$ mergin list-files mergin/simplebees

Usage: mergin list-files [OPTIONS] PROJECT

  List files in a project.

Options:
  --json  Output in JSON format
  --help      Show this message and exit.
$ mergin list-projects
List of projects (all public):
Fetched 9 projects .
  mergin / pgv                            	   0.1 MB	v6
  mergin / databank                       	   0.7 MB	v7

$ mergin list-files mergin/databank
Fetched 8 files .
  databank.qgz                            	   0.0 MB
  Survey_points.gpkg                      	   0.1 MB
  datas/2-Survey_points.gpkg              	   0.1 MB
  datas/0-Survey_points.gpkg              	   0.1 MB
  datas/3-Survey_points.gpkg              	   0.1 MB
  datas/4-Survey_points.gpkg              	   0.1 MB
  datas/7-Survey_points.gpkg              	   0.1 MB
  datas/8-Survey_points.gpkg              	   0.1 MB

$ mergin list-files --json mergin/databank
[{'checksum': 'fc111bd14304993eb689dd76e8f0f68694a87388', 'mtime': '2024-03-21T17:56:30.061676Z', 'path': 'databank.qgz', 'size': 15391}, {'checksum': '8fc64b4ae99fa6ae2a572672b2fb38cae42604c7', 'diff': {'checksum': 'ff8a361f3d933049940e08783d1943f662fd126d', 'mtime': '2024-03-21T19:56:28.516560+02:00', 'path': 'Survey_points.gpkg-diff-a50c162b-ddcc-400a-a8c1-bd1fde7eed56', 'size': 220}, 'mtime': '2024-03-21T17:56:30.061677Z', 'path': 'Survey_points.gpkg', 'size': 98304}, {'checksum': '26bf84f140bf7df97eee8a589cc2fbe47f3a766d', 'mtime': '2024-03-21T17:45:36.624145Z', 'path': 'datas/2-Survey_points.gpkg', 'size': 98304}, {'checksum': '26bf84f140bf7df97eee8a589cc2fbe47f3a766d', 'mtime': '2024-03-21T17:47:41.844995Z', 'path': 'datas/0-Survey_points.gpkg', 'size': 98304}, {'checksum': '862b7c799f588f2aa0ddf4ef8403c194c91c91ae', 'mtime': '2024-03-21T17:49:21.581621Z', 'path': 'datas/3-Survey_points.gpkg', 'size': 98304}, {'checksum': '07b886469eb209534813d11c01b726a334d49066', 'mtime': '2024-03-21T17:50:50.668199Z', 'path': 'datas/4-Survey_points.gpkg', 'size': 98304}, {'checksum': '3709214406a591629e83d296f8c67c06c8dd4cd2', 'mtime': '2024-03-21T17:51:59.117511Z', 'path': 'datas/7-Survey_points.gpkg', 'size': 98304}, {'checksum': '1220866c3618b30c013d55a7f1cbe9be60e40e1f', 'mtime': '2024-03-21T17:56:30.061670Z', 'path': 'datas/8-Survey_points.gpkg', 'size': 98304}]

@MarcelGeo MarcelGeo requested a review from wonder-sk May 28, 2024 12:00
Copy link
Contributor

@MarcelGeo MarcelGeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @kaloyan13 . Thank you very much for your contribution. I apologize for the delayed response.
If you're still able to work on this pull request, I have a few minor suggestions:

  • could you rename fmt_json to json?
  • you can remove namespace argument (we can make unique interface with share, where namespace/project_name is passed directly to project param)
  • could you give examples of results to PR?
  • Add command to README.md

@kaloyan13 kaloyan13 requested a review from MarcelGeo September 5, 2024 12:53
@MarcelGeo
Copy link
Contributor

MarcelGeo commented Sep 6, 2024

Thanks @kaloyan13 , feel free to make any other contributions. 🔥 In the future, try to use black.

@MarcelGeo MarcelGeo merged commit 8e05f38 into MerginMaps:master Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants