Skip to main content

Scrape biological data from websites

Project description

#Bioscraping

Web scrapers to interact with remote databases programatically in Python that makes a local cache of web data with sqlite3 to prevent excessive web traffic.

So far, implemented:

  • [Uniprot](http://uniprot.org) by uniprot protein ID. (e.g. ‘Q8BP71’)

  • [PubMed](www.ncbi.nlm.nih.gov/pubmed/) by PMID (e.g. ‘24213538’)

#Install

##Python 2.7.x and 3.x pip install bioscraping

#Test

Real unit tests are absent, but you can test basic functionality with python test/not_a_real_test.py.

#Usage

##PubMed

from bioscraping import PubMedClient

pubmed = PubMedClient()

defaults to writing a file called .bioscraping.pubmed.sqlite.db. Use PubMedClient(“:memory:”) for in-memory data storage.

pubmed.fetch(<PMID>)

Returns text with author and abstract for PMID.

##Uniprot

from bioscraping import UniprotClient

uniprot = UniprotClient()

defaults to writing a file called .bioscraping.uniprot.sqlite.db. Use UniprotClient(“:memory:”) for in-memory data storage.

uniprot.fetch(<Uniprot ID>)

Returns a dictionary of data parsed from xml.

#Buyer beware

UniprotClient has a potential race condition and tempfile needs to be implemented before it is safe for concurrent processes. (see TODO)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bioscraping-0.0.3.tar.gz (14.1 kB view details)

Uploaded Source

File details

Details for the file bioscraping-0.0.3.tar.gz.

File metadata

  • Download URL: bioscraping-0.0.3.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bioscraping-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a240bc134d100edd9f7d0cf3d0ef7a230e071fe8b70970c2007f62d1fd36fcfb
MD5 d1078c7dc5533f315506ec17c2d21dcd
BLAKE2b-256 e78d6959fc699fbd9194724736e2d3e47fd450a184c2e79de4919210d62d69b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page