Skip to content

Instantly share code, notes, and snippets.

@aniemerg
aniemerg / minerdata.py
Created September 20, 2017 16:12
Retrieves information about miner addresses sent mining rewards by Flypool to Zcash miners
# minerdata.py
# This script builds a dataset of miners that have mined on Flypool by looking for all addresses paid
# alongside an existing miner during recent payments to that miner.
# The data output is addresss, number of times seen, total amount sent to address
# Written by Allan Niemerg
# email: my first name at cumberlandmining.com
import requests
import datetime
# DescLength()
# Counts the length of patent descriptions
import MySQLdb as mdb
import sys
import datetime
import re
import math
import time
import numpy as np
@aniemerg
aniemerg / CountForwardCites.py
Created August 4, 2012 21:07
Retrieves forward cites for sample of Patents. Randomly samples patents with replacement in the range from *begin* to *end* and counts forward cites using the USPTO's PATFT. Repeats for *number* of times.
# CountForwardCites(begin, end, number)
# by Allan Niemerg
# Randomly samples patents with replacement in the range
# from *begin* to *end* and counts forward cites using the
# USPTO's PATFT. Repeats for *number* of times.
# *IMPORTANT NOTE*
# The USPTO PATFT policies limit the number of database accesses
# per IP address. To avoid violating their terms of use and
# getting banned, please limit the number of patents you
@aniemerg
aniemerg / ClaimCounts.py
Created June 10, 2012 01:10
Counts various statistics of claims, such as total claims, number of independent claims, dependent claims
# ClaimCounts()
# Counts various statistics of claims, such as total claims,
# number of independent claims, dependent claims
# files to create database can be found at:
# https://github.com/aniemerg/Patent-Tools
# written on May 30, 2012 for a blog post
import MySQLdb as mdb
import sys
import datetime
@aniemerg
aniemerg / Two_years_of_weekly_grants_2009_10.py
Created May 24, 2012 14:36
Script to retrieve the number of U.S. utility patents granted by week during 2009-2010
import urllib2
import re
import datetime
import pprint
import time
# Start by Getting Date of Last Tuesday of 2010
current = datetime.date(2010,12,31)
if current.weekday() == 0:
#if New Years Eve falls on Monday, go back into previous week
@aniemerg
aniemerg / TotalGrantsAtYearsEnd.py
Created May 8, 2012 14:42
Script to retrieve the Number of total patents granted at the end of the year(1980-2012)
# Script to retrieve the Number of total patents granted at the end of the year
# for several years using the USPTO's search site
import urllib2
import re
import datetime
import pprint
import time
# Choose the range of years
years = range(1980,2012)
@aniemerg
aniemerg / number_of_US_utility_patents.py
Created May 4, 2012 02:08
Python script to scrape the number of Issued U.S. utility patents
import urllib2
import re
import datetime
import pprint
# Start by Getting Date of Last Tuesday
today = datetime.date.today()
tuesday = today - datetime.timedelta(days=today.weekday()) + datetime.timedelta(days=1)
month = str(tuesday.month)
day = str(tuesday.day)