GithubHelp home page GithubHelp logo

mpeechatt / pycon_2017 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nd1/pycon_2017

0.0 1.0 0.0 2.8 MB

Fantastic Data and Where To Find Them: An introduction to APIs, RSS, and Scraping

Home Page: https://nd1.github.io/pycon_2017/

License: MIT License

Jupyter Notebook 10.97% Python 1.33% HTML 42.50% CSS 23.86% JavaScript 21.33%

pycon_2017's Introduction

Fantastic Data and Where To Find Them: An introduction to APIs, RSS, and Scraping

This repository contains the notebooks, slides, and sample code for the tutorial given at PyCon on Wendesday, May 17, 2017.

Whether you’re building a custom web application, getting started in machine learning, or just want to try something new, everyone needs data. And while the web offers a seemingly boundless source for custom data sets, the collection of that data can present a whole host of obstacles. From ever-changing APIs to rate-limiting woes, from nightmarishly nested XML to convoluted DOM trees, working with APIs and web scraping are challenging but critically useful skills for application developers and data scientists alike. In this tutorial, we’ll introduce RESTful APIs, RSS feeds, and web scraping in order to see how different ingestion techniques impact application development. We’ll explore how and when to use Python libraries such as feedparser, requests, beautifulsoup, and urllib. And finally we will present common data collection problems and how to overcome them.

We’ll take a hands-on, directed exercise approach combined with short presentations to engage a range of different APIs (with and without authentication), explore examples of how and why you might web scrape, and learn the ethical and legal considerations for both. To prepare attendees to create their own data ingestion scripts, the tutorial will walk through a set of examples for robust and responsible data collection and ingestion. This tutorial will conclude with a case study of Baleen, an automated RSS ingestion service designed to construct a production-grade text corpus for NLP research and machine learning applications. Exercises will be presented both as Jupyter Notebooks and Python scripts.

Contents

There is a directory for each topic that contains the tutorial notebook and sample code. The slides were created with Jupyter notebook and reveal.js. They are hosted on GitHub Pages and can be viewed here.

Getting Started

Step one is to clone or download the repository, unzip it and then cd into the project directory.

Note, this code requires Python 3 or Anaconda to run, as well as several third party libraries. Make sure that you have Jupyter notebook installed, and if you're using Python that you have pip installed. One you do, you can install the required third party dependencies as follows:

$ pip install -r requirements.txt

or

$ conda install --yes --file requirements.txt

Environment Considerations

All code has been tested in Python 3.5. Some of the notebooks will run in 2.7, but not all. See the setup note below for a note on running the code in Python 3.6.

If you running Windows and do not have extensive expereince with the libraries in the requirements.txt file, I recommend installing Anaconda and creating a Python 3.5 environment.

Special Setup

Python 3.6 on OS X does not include a trust store, so SSL connections do not work out of the box. This can be fixed by running:

/Applications/Python\ 3.6/Install\ Certificates.command

This installs a default trust store.

References:

pycon_2017's People

Contributors

nd1 avatar will2041 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.