pridepy


Namepridepy JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/PRIDE-Archive/pridepy
SummaryPython Client library for PRIDE Rest API
upload_time2025-01-08 18:43:37
maintainerNone
docs_urlNone
authorPRIDE Team
requires_pythonNone
licenseNone
keywords pride python client rest api
VCS
bugtrack_url
requirements requests ratelimit click pytest setuptools plotly boto3 botocore tqdm urllib3 httpx
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pridepy: A Python package to download and search data from PRIDE database

[![Python package](https://github.com/PRIDE-Archive/pridepy/actions/workflows/python-package.yml/badge.svg)](https://github.com/PRIDE-Archive/pridepy/actions/workflows/python-package.yml)
[![PyPI version](https://badge.fury.io/py/pridepy.svg)](https://badge.fury.io/py/pridepy)
![PyPI - Downloads](https://img.shields.io/pypi/dm/pridepy)

Python Client library for PRIDE Rest API

# Installation

## From PyPI

To install, simply use `pip`:

```bash
$ pip install --upgrade pridepy
```

## From Source

First, clone the repository on your local machine and then install the package using `pip`:

```bash
$ git clone https://github.com/PRIDE-Archive/pridepy
$ cd pridepy
$ pip install .
```

Install with setup.py: 

```bash
$ git clone https://github.com/PRIDE-Archive/pridepy
$ cd pridepy
$ python setup.py sdist bdist_wheel 
$ pip install dist/pridepy-{version}.tar.gz
```

# Examples

Download all the raw files from a dataset(eg: PXD012353).
Warning: Raw files are generally large in size, so it may take some time to download depending on the number of files and file sizes.

`-p`: in download specifies protocol (ftp default): 
   - **ftp**: FTP protocol
   - **aspera**: using the aspera protocol
   - **globus**: PRIDE globus endpoint (_the data is downloaded through https_)

```bash
$ pridepy download-all-public-raw-files -a PXD012353 -o /Users/yourname/Downloads/foldername/ -p aspera
```

Download single file by name:
```bash
$ pridepy download-file-by-name -a PXD022105 -o /Users/yourname/Downloads/foldername/ -f checksum.txt -p globus
```

>**NOTE**: Currently we use Globus URLs (when `-p globus` is used) via HTTPS, not the Globus protocol. For more information about Globus, see [Globus documentation](https://www.globus.org/data-transfer).

Search projects with keywords and filters
```bash
$ pridepy search-projects-by-keywords-and-filters --keyword accession:PXD012353
```

Search files with filters
```bash
$ pridepy get-files-by-filter --filter fileCategory.value==RAW
```

Stream metadata of all projects as json and write it to a file
```bash
$ pridepy stream-projects-metadata -o all_pride_projects.json
```

Stream metadata of all files as json and write it to a file. Project accession can be specified as an optional parameter
```bash
$ pridepy stream-files-metadata -o all_pride_files.json
OR
$ pridepy stream-files-metadata -o PXD005011_files.json -a PXD005011
```

This Python CLI tool, built using the Click module, 
already provides detailed usage instructions for each command. To avoid redundancy and potential clutter in this README, you can access the usage instructions directly from the CLI
Use the below command to view a list of commands available:

```bash
$ pridepy --help
Usage: pridepy [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  download-all-public-raw-files   Download all public raw files...
  download-file-by-name           Download a single file from a...
  get-files-by-filter             get paged files :return:
  get-files-by-project-accession  get files by project accession...
  get-private-files               Get private files by project...
  get-projects                    get paged projects :return:
  get-projects-by-accession       get projects by accession... 
  stream-files-metadata           Stream all files metadata in...
  stream-projects-metadata        Stream all projects metadata...
    
```
# NOTE

Please make sure you are using Python3, not Python 2.7 version.

# White paper

A white paper is available at [here](paper/paper.md). We can build it as PDF using pandoc.

```bash
$docker run --rm --platform linux/amd64 -v /Users/yperez/work/pridepy/paper/:/data -w /data openjournals/inara:latest paper.md -p -o pdf
```

# Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

# Citation

Selvakumar Kamatchinathan, Suresh Hewapathirana, Chakradhar Bandla, Juan Antonio VizcaĆ­no, Yasset Perez-Riverol. (2021, January 28). pridepy: A Python package to download and search data from PRIDE database (Version v0.0.3). 

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4475414.svg)](https://doi.org/10.5281/zenodo.4475414)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/PRIDE-Archive/pridepy",
    "name": "pridepy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "PRIDE python client REST API",
    "author": "PRIDE Team",
    "author_email": "pride-support@ebi.ac.uk",
    "download_url": "https://files.pythonhosted.org/packages/7c/7e/063a910f6242b2599bd72bf653337fbefa952d2e3b5ee42d017bcd68facc/pridepy-0.0.6.tar.gz",
    "platform": null,
    "description": "# pridepy: A Python package to download and search data from PRIDE database\n\n[![Python package](https://github.com/PRIDE-Archive/pridepy/actions/workflows/python-package.yml/badge.svg)](https://github.com/PRIDE-Archive/pridepy/actions/workflows/python-package.yml)\n[![PyPI version](https://badge.fury.io/py/pridepy.svg)](https://badge.fury.io/py/pridepy)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/pridepy)\n\nPython Client library for PRIDE Rest API\n\n# Installation\n\n## From PyPI\n\nTo install, simply use `pip`:\n\n```bash\n$ pip install --upgrade pridepy\n```\n\n## From Source\n\nFirst, clone the repository on your local machine and then install the package using `pip`:\n\n```bash\n$ git clone https://github.com/PRIDE-Archive/pridepy\n$ cd pridepy\n$ pip install .\n```\n\nInstall with setup.py: \n\n```bash\n$ git clone https://github.com/PRIDE-Archive/pridepy\n$ cd pridepy\n$ python setup.py sdist bdist_wheel \n$ pip install dist/pridepy-{version}.tar.gz\n```\n\n# Examples\n\nDownload all the raw files from a dataset(eg: PXD012353).\nWarning: Raw files are generally large in size, so it may take some time to download depending on the number of files and file sizes.\n\n`-p`: in download specifies protocol (ftp default): \n   - **ftp**: FTP protocol\n   - **aspera**: using the aspera protocol\n   - **globus**: PRIDE globus endpoint (_the data is downloaded through https_)\n\n```bash\n$ pridepy download-all-public-raw-files -a PXD012353 -o /Users/yourname/Downloads/foldername/ -p aspera\n```\n\nDownload single file by name:\n```bash\n$ pridepy download-file-by-name -a PXD022105 -o /Users/yourname/Downloads/foldername/ -f checksum.txt -p globus\n```\n\n>**NOTE**: Currently we use Globus URLs (when `-p globus` is used) via HTTPS, not the Globus protocol. For more information about Globus, see [Globus documentation](https://www.globus.org/data-transfer).\n\nSearch projects with keywords and filters\n```bash\n$ pridepy search-projects-by-keywords-and-filters --keyword accession:PXD012353\n```\n\nSearch files with filters\n```bash\n$ pridepy get-files-by-filter --filter fileCategory.value==RAW\n```\n\nStream metadata of all projects as json and write it to a file\n```bash\n$ pridepy stream-projects-metadata -o all_pride_projects.json\n```\n\nStream metadata of all files as json and write it to a file. Project accession can be specified as an optional parameter\n```bash\n$ pridepy stream-files-metadata -o all_pride_files.json\nOR\n$ pridepy stream-files-metadata -o PXD005011_files.json -a PXD005011\n```\n\nThis Python CLI tool, built using the Click module, \nalready provides detailed usage instructions for each command. To avoid redundancy and potential clutter in this README, you can access the usage instructions directly from the CLI\nUse the below command to view a list of commands available:\n\n```bash\n$ pridepy --help\nUsage: pridepy [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  download-all-public-raw-files   Download all public raw files...\n  download-file-by-name           Download a single file from a...\n  get-files-by-filter             get paged files :return:\n  get-files-by-project-accession  get files by project accession...\n  get-private-files               Get private files by project...\n  get-projects                    get paged projects :return:\n  get-projects-by-accession       get projects by accession... \n  stream-files-metadata           Stream all files metadata in...\n  stream-projects-metadata        Stream all projects metadata...\n    \n```\n# NOTE\n\nPlease make sure you are using Python3, not Python 2.7 version.\n\n# White paper\n\nA white paper is available at [here](paper/paper.md). We can build it as PDF using pandoc.\n\n```bash\n$docker run --rm --platform linux/amd64 -v /Users/yperez/work/pridepy/paper/:/data -w /data openjournals/inara:latest paper.md -p -o pdf\n```\n\n# Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n# Citation\n\nSelvakumar Kamatchinathan, Suresh Hewapathirana, Chakradhar Bandla, Juan Antonio Vizca\u00edno, Yasset Perez-Riverol. (2021, January 28). pridepy: A Python package to download and search data from PRIDE database (Version v0.0.3). \n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4475414.svg)](https://doi.org/10.5281/zenodo.4475414)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python Client library for PRIDE Rest API",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/PRIDE-Archive/pridepy"
    },
    "split_keywords": [
        "pride",
        "python",
        "client",
        "rest",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a0bde286c9c3fc2ad28a555f1757a8eaa631cbce56e9d07d067478ca1f3fb240",
                "md5": "e2855e30c06d4e0ea7702e7153b1b5fc",
                "sha256": "95d4069f724b99c6c2f98868cc54cb415fe91a0f2c085ea43b94af6daad5e08a"
            },
            "downloads": -1,
            "filename": "pridepy-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e2855e30c06d4e0ea7702e7153b1b5fc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 38445440,
            "upload_time": "2025-01-08T18:43:30",
            "upload_time_iso_8601": "2025-01-08T18:43:30.044023Z",
            "url": "https://files.pythonhosted.org/packages/a0/bd/e286c9c3fc2ad28a555f1757a8eaa631cbce56e9d07d067478ca1f3fb240/pridepy-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c7e063a910f6242b2599bd72bf653337fbefa952d2e3b5ee42d017bcd68facc",
                "md5": "f836b1d5feefdaba87a4563a18ad512e",
                "sha256": "006b38f4798b123acaeb329b0dc15f491be52f912fdfb35ec8174d45fd97e128"
            },
            "downloads": -1,
            "filename": "pridepy-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "f836b1d5feefdaba87a4563a18ad512e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 38301007,
            "upload_time": "2025-01-08T18:43:37",
            "upload_time_iso_8601": "2025-01-08T18:43:37.892115Z",
            "url": "https://files.pythonhosted.org/packages/7c/7e/063a910f6242b2599bd72bf653337fbefa952d2e3b5ee42d017bcd68facc/pridepy-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-08 18:43:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PRIDE-Archive",
    "github_project": "pridepy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "ratelimit",
            "specs": []
        },
        {
            "name": "click",
            "specs": []
        },
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "setuptools",
            "specs": []
        },
        {
            "name": "plotly",
            "specs": []
        },
        {
            "name": "boto3",
            "specs": []
        },
        {
            "name": "botocore",
            "specs": []
        },
        {
            "name": "tqdm",
            "specs": []
        },
        {
            "name": "urllib3",
            "specs": []
        },
        {
            "name": "httpx",
            "specs": []
        }
    ],
    "lcname": "pridepy"
}
        
Elapsed time: 3.42124s