{ "info": { "author": "V7", "author_email": "info@v7labs.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3" ], "description": "# Darwin\nOfficial library to manage datasets along with v7 Darwin annotation platform [https://darwin.v7labs.com](https://darwin.v7labs.com).\n\nSupport tested for python3.7.\n\n## Installation\n\n### Standard\n\n```\npip install darwin-py\n```\nYou can now type `darwin` in your terminal and access the command line interface.\n\n### Development\nAfter cloning the repository:\n\n```\npip install --editable .\n```\n\n## Usage\n\nDarwin can be used as a python library or as a command line tool.\nMain functions are:\n\n- Authentication\n- Listing local and remote a dataset\n- Creating and removing a dataset \n- Uploading data to a remote dataset\n- Download data locally from a remote dataset\n\n### As a library\n\nDarwin can be used as a python library to download / upload and list datasets.\n\nTo access darwin you first need to authenticate, this can be done once through the cli (see the `Authentication`) or directly in python, see the example below.\n\n#### Authentication \nAuthenticate without ~/.darwin/config.yaml file (which gets generated with CLI)\n\n```python\nfrom darwin.client import Client\n\nclient = Client.login(email=\"simon@v7labs.com\", password=\"*********\")\n```\n\n#### Local projects\nPrint a list of local existing projects\n\n```python\nfrom darwin.client import Client\n\nclient = Client.default()\nfor dataset in client.list_local_datasets():\n print(dataset.slug, dataset.image_count)\n```\n\n#### Remote projects\nPrint a list of remote projects accessible by the current user.\n\n```python\nfrom darwin.client import Client\n\nclient = Client.default()\nfor dataset in client.list_remote_datasets():\n print(dataset.slug, dataset.image_count)\n```\n\n#### Upload data to a [remote] project (images/videos)\n\nUploads data to an existing remote project.\nIt takes the dataset slug and a list of file names of images/videos to upload as parameters.\n\n```python\nfrom darwin.client import Client\n\nclient = Client.default()\ndataset = client.get_remote_dataset(slug=\"example-dataset\")\nprogress = dataset.upload_files([\"test.png\", \"test.mp4\"])\nfor _ in progress():\n print(\"file uploaded\")\n```\n\n#### Pull a [remote] project\n\nDownloads a remote project, images and annotations, in the projects directory (specified in the authentication process [default: ~/.darwin/projects]).\n```python\nfrom darwin.client import Client\n\nclient = Client.default()\ndataset = client.get_remote_dataset(slug=\"example-dataset\")\nprogress, _count = dataset.pull()\nfor _ in progress():\n print(\"file synced\")\n```\n\n### Command line\n\n`darwin` is also accessible as a command line tool.\n\n\n#### Authentication\nA username (email address) and password is required to authenticate. If you do not already have a Darwin account, register for free at [https://darwin.v7labs.com](https://darwin.v7labs.com).\n```\n$ darwin authenticate\nUsername (email address): simon@v7labs.com\nPassword: *******\nProject directory [~/.darwin/projects]: \nProjects directory created /Users/simon/.darwin/projects\nAuthentication succeeded.\n```\n\n#### Create a new dataset (from images/videos)\nCreates an empty dataset remotely.\n\n```\n$ darwin create example-dataset\nDataset 'example-project' has been created.\nAccess at https://darwin.v7labs.com/datasets/example-project\n```\n\n#### Upload data to a [remote] project (images/videos)\nUploads data to an existing remote project. It takes the project name and a single image (or directory) with images/videos to upload as parameters. \n\nThe `-e/--exclude` argument allows to indicate file extension/s to be ignored from the data_dir.\n\nFor videos, the frame rate extraction rate can be specified by adding `--fps `\n\nTo recursively upload all files in a directory tree add the `-r` flag.\n\nSupported extensions:\n- Video files: [`.mp4`, `.bpm`, `.mov` formats].\n- Image files [`.jpg`, `.jpeg`, `.png` formats].\n\n```\n$ darwin upload example-dataset -r path/to/images\nUploading: 100%|########################################################| 3/3 [00:01<00:00, 2.29it/s]\n```\n\n#### Remote projects\nLists a summary of remote projects accessible by the current user.\n\n```\n$ darwin remote\nNAME IMAGES PROGRESS ID\nexample-project 3 0.0% 89\n```\n\n#### Pull a [remote] project\nDownloads a remote project, images and annotations, in the projects directory (specified in the authentication process [default: `~/.darwin/projects`]).\n\n```\n$ darwin pull example-project\nPulling project example-project:latest\nDownloading: 100%|########################################################| 3/3 [00:03<00:00, 4.11it/s]\n```\n\n#### Local projects\nLists a summary of local existing projects\n```\n$ darwin local\nNAME IMAGES SYNC DATE SIZE\nexample-project 3 today 800.2 kB\n```\n\n#### Remove projects\nRemoves a local project, located under the projects directory.\n\n```\n$ darwin remove example-project\nAbout to deleting example-project locally.\nDo you want to continue? [y/N] y\n```\n\nTo delete the project on the server add the `-r` /`--remote` flag\n```\n$ darwin remove example-project --remote\nAbout to deleting example-project on darwin.\nDo you want to continue? [y/N] y\n```\n\n## Table of Arguments\n\n| parser | parameter | type | required |\n| --------------- | ------------------------ | ----------------- | --------- |\n| `authenticate` | | | |\n| `team` | | | |\n| | `team_name` | str | False |\n| | `-l`, `--list` | | False |\n| `create` | `project_name` | str | True |\n| `local` | | | |\n| `path` | `project_name` | str/int | True |\n| `pull` | `project_name` | str/int | True |\n| `remote` | | str | |\n| `remove` | `project_name` | str | True |\n| | `-r` `--remote` | str | True |\n| `url` | `project_name` | str | |\n| `upload` | `project_name` | str | True |\n| | `data_dir` | str | True |\n| | `-e`, `--exclude` | str | |\n| | `--fps` | int | |\n| | `-r`, `--recursive` | | |\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/v7labs/darwin-py", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "darwin-py", "package_url": "https://pypi.org/project/darwin-py/", "platform": "", "project_url": "https://pypi.org/project/darwin-py/", "project_urls": { "Homepage": "https://github.com/v7labs/darwin-py" }, "release_url": "https://pypi.org/project/darwin-py/0.0.2/", "requires_dist": [ "argcomplete", "docutils", "humanize", "pyyaml (>=5.1)", "requests", "sh", "tqdm", "factory-boy" ], "requires_python": "", "summary": "Library and command line interface for darwin.v7labs.com", "version": "0.0.2" }, "last_serial": 5862867, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "6ae5ea40237f991b4636cabe4ce5d426", "sha256": "a73828c06b542f78499dd466da21c62855bfcac779f74204d5d1d2fd1fea2767" }, "downloads": -1, "filename": "darwin_py-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "6ae5ea40237f991b4636cabe4ce5d426", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16415, "upload_time": "2019-09-20T15:11:07", "url": "https://files.pythonhosted.org/packages/ce/6e/70b2380df74407ae05d05cae6b9898aff2d7f5d6ee13f72102c5fc5e677b/darwin_py-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "39807a7367b48320aaccbd263ab8be23", "sha256": "698df7c10f8bb1474705e0773867d70437184291b6b9135d6c1dcb6025ba5271" }, "downloads": -1, "filename": "darwin-py-0.0.2.tar.gz", "has_sig": false, "md5_digest": "39807a7367b48320aaccbd263ab8be23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15033, "upload_time": "2019-09-20T15:11:10", "url": "https://files.pythonhosted.org/packages/b0/56/a890eaf72de7cd0090dc99c387b603992bc0b5bc54eb6795e1a20352b04d/darwin-py-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6ae5ea40237f991b4636cabe4ce5d426", "sha256": "a73828c06b542f78499dd466da21c62855bfcac779f74204d5d1d2fd1fea2767" }, "downloads": -1, "filename": "darwin_py-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "6ae5ea40237f991b4636cabe4ce5d426", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16415, "upload_time": "2019-09-20T15:11:07", "url": "https://files.pythonhosted.org/packages/ce/6e/70b2380df74407ae05d05cae6b9898aff2d7f5d6ee13f72102c5fc5e677b/darwin_py-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "39807a7367b48320aaccbd263ab8be23", "sha256": "698df7c10f8bb1474705e0773867d70437184291b6b9135d6c1dcb6025ba5271" }, "downloads": -1, "filename": "darwin-py-0.0.2.tar.gz", "has_sig": false, "md5_digest": "39807a7367b48320aaccbd263ab8be23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15033, "upload_time": "2019-09-20T15:11:10", "url": "https://files.pythonhosted.org/packages/b0/56/a890eaf72de7cd0090dc99c387b603992bc0b5bc54eb6795e1a20352b04d/darwin-py-0.0.2.tar.gz" } ] }