Skip to content

Instantly share code, notes, and snippets.

View linwoodc3's full-sized avatar

Linwood Creekmore linwoodc3

  • United States
View GitHub Profile
@linwoodc3
linwoodc3 / utilities.py
Last active April 2, 2024 15:35
A python script to scrape text from websites. This works surprisingly well on most news websites when you have the URL to the story. Use GDELT urls for the best results.
# Author: Linwood Creekmore
# Email: valinvescap@gmail.com
# Description: Python script to pull content from a website (works on news stories).
#Licensed under GNU GPLv3; see https://choosealicense.com/licenses/lgpl-3.0/ for details
# Notes
"""
23 Oct 2017: updated to include readability based on PyCon talk: https://github.com/DistrictDataLabs/PyCon2016/blob/master/notebooks/tutorial/Working%20with%20Text%20Corpora.ipynb
18 Jul 2018: added keywords and summary
@linwoodc3
linwoodc3 / keyholemarkup_converter.py
Last active January 30, 2024 11:51
Convert KML/KMZ to CSV or KML/KMZ to shapefile or KML/KMZ to Dataframe or KML/KMZ to GeoJSON. Full script with classes to convert a KML or KMZ to GeoJSON, ESRI Shapefile, Pandas Dataframe, GeoPandas GeoDataframe, or CSV. Can write the converted file directly to disk with no human intervention.
# Author:
# Linwood Creekmore III
# email: valinvescap@gmail.com
# Acknowledgements:
# http://programmingadvent.blogspot.com/2013/06/kmzkml-file-parsing-with-python.html
# http://gis.stackexchange.com/questions/159681/geopandas-cant-save-geojson
# https://gist.github.com/mciantyre/32ff2c2d5cd9515c1ee7
@linwoodc3
linwoodc3 / polyglotOnMacOSX35.sh
Last active January 23, 2023 03:28
Bash script that successfully installs the polyglot multilingual text (NLP) processing toolkit on a MacOSX computer with Python 3 and Anaconda
#!/bin/bash
# Author:
# Linwood Creekmore
# email: valinvescap@gmail.com
# navigate to home directory; just for clean start
cd ~ &&
# exit out of whatever conda environment you are in
@linwoodc3
linwoodc3 / SOAP_working.ipynb
Created July 1, 2018 11:25
A working example of using zeep to query a SOAP service
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@linwoodc3
linwoodc3 / cleantweets.py
Last active January 19, 2021 22:58
Python script that uses the python Twitter client (https://github.com/sixohsix/twitter) to pull tweets that are geolocated. Optionally stores in efficient columnar parquet data store with configurable file sizes. Took 13 secs to download 100 geolocated tweets on MacOS 10.12 with 16 GB RAM on 82 Mb/s connection.
# Author
# Linwood Creekmore III
# April 8 2017
# heavy input from http://socialmedia-class.org/twittertutorial.html
# valinvescap@gmail.com
import re
import copy
import numpy as np
import pandas as pd
@linwoodc3
linwoodc3 / gg.py
Created March 17, 2019 13:05
testing code editor
timeit -n 100 geohash.encode(36.056595, -112.125092)
[Out]: 992 ns ± 21.4 ns per loop (mean ± std. dev. of 7 runs, 100 loops each)
@linwoodc3
linwoodc3 / polyglotOnMacOSXPython27.sh
Last active September 1, 2018 14:32
Bash script that successfully installs the polyglot multilingual text (NLP) processing toolkit on a MacOSX computer with Python 2.7 and Anaconda.
#!/bin/bash
# Author:
# Linwood Creekmore
# email: valinvescap@gmail.com
# navigate to home directory; just for clean start
cd ~ &&
# exit out of whatever conda environment you are in
THE SHAME OF SAN JOAQUIN
WGAw #1834463
FADE IN:
EXT. SUBDIVISION - MORNING
A peculiar wind blows snowflakes past a wall guarding the
entrance to a neighborhood that reads “SAN JOAQUIN ESTATES”.
In a black Mustang idling at the curb sits BOBBY GONZALEZ, a
directionless young man with a hard look and disheveled hair.
THE SHAME OF SAN JOAQUIN
WGAw #1834463
FADE IN:
EXT. SUBDIVISION - MORNING
A peculiar wind blows snowflakes past a wall guarding the
entrance to a neighborhood that reads “SAN JOAQUIN ESTATES”.
In a black Mustang idling at the curb sits BOBBY GONZALEZ, a
directionless young man with a hard look and disheveled hair.
@linwoodc3
linwoodc3 / index.html
Last active June 5, 2018 12:15
sample html for sage.
<!DOCTYPE html>
<html>
<title>QB-Spective</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body { font-family: sans-serif; }