Skip to content

Instantly share code, notes, and snippets.

View kallewesterling's full-sized avatar
🏠
Working from home

Kalle Westerling kallewesterling

🏠
Working from home
View GitHub Profile
@kallewesterling
kallewesterling / periodize_dates.py
Last active April 13, 2021 17:02
Make a list of list where dates are chained together based on their delta
def periodize_dates(dates:list=[], delta:datetime.timedelta=timedelta(days=14), dateformat='%Y-%m-%d'):
"""
Takes a list of dates and returns a list of lists, where the original list has been divided into strings of dates that are within the provided delta.
Parameters:
dates (list): List of dates that you want periodized.
delta (datetime.timedelta/int): The delta that you want compared. If provided as type `int`, the value will be interpreted as `timedelta.days=<int>`.
dateformat (str): A date formatting string that all dates in the list will need to adhere to.
Returns:
list:Periodized dates
This file has been truncated, but you can view the full file.
[{"Date":"1928","Category":"","Performer":"Gloria Swanson","Normalized performer":"Sepia Gloria Swanson","Performer first-name":"Sepia Gloria Swanson","Performer last-name":"—","Venue":"Book Store","Normalized Venue":"Book Store","City":"Chicago, IL","Normalized City":"Chicago, IL","Unique venue":"Book Store (Chicago, IL)","Revue name":"","Normalized Revue Name":"","Legal name":"— Winston","Alleged age":0,"Assumed birth year":0,"Source clean":"On 'Gloria Swanson' (Real Name: Mr. Winston), January 1, 1928, 221","Newspaper_ID":"","Date_unknown":"","Page_unknown":"","Newspaper":"—","EIMA_ID":0,"Edge Comment":"","Exclude from visualization":"","Comment on node: performer":"Legal name here is \"Mr. Winston,\" full legal name corroborated by Afro-American, December 24, 1932, 18.","Comment on node: venue":"\"rendezvous protected by the fact that his 'protector' was a big shot—a well-known underworld figure. All went well until his 'boy friend' had a fit of jealousy—a tantrum of violence during which he practically w
This file has been truncated, but you can view the full file.
{"Normalized City-Normalized performer":{"":["Adrian Ames","Alan Gray","Albert Henry Cook","Alden Garrison","Allan Cook","Andrew Tribble","Arthur Wilson","Arvin Giese","Barbette","Bert Savoy","Bert Wheeler","Bill Jones","Billie Marsh","Billy \"Senorita\" Herrera","Billy Ardelle","Billy Byrne","Billy Hayes","Billy Irwin","Billy Nichols","Bobby Allen","Bobby Morris","Bobby Royce","Bonnie Clark","Boots Lavana","Bothwell Browne","Brannan Fernandez","Buster Brant","Candy Cain","Chick Chandler","Clarence Long","Clarence Thomas","Cliff LaVerne","Dee Liddell","Dell Day","Delorice De'Fren","Dick Hastings","Dixie Dixon","Donnie Dawn","Doris Lorraine","E. Russell","Elsie Day","Elsie the Cobra Woman","Etailook Hoy","Fay Norman","Frances Dee","Francis Blair","Francis Logan","Francis Loite","Francis Renault","Frank Barrett Carman","Frank Burns","Fred Berrens","Fred Moore","Gene Dana","Gene Ford","Gene Mosely","George Charles","Gloria Armour","Gordon Lohman","Harold Hesse","Harri Henri","Harry Mick","Harry Watson, Jr.","Har
{"Date":{"":11,"1907-05-16":1,"1907-11-08":1,"1908-12-12":1,"1908-12-19":1,"1909-05-15":1,"1909-08-28":1,"1909-09-18":1,"1910-05-06":1,"1910-05-08":1,"1910-05-13":1,"1910-11-18":1,"1911-02-18":1,"1911-03-05":2,"1911-12-23":1,"1912-05-04":1,"1912-05-05":1,"1912-11-30":1,"1913-01-18":1,"1913-08-02":1,"1913-08-07":1,"1914-03-21":1,"1915-02-06":1,"1915-04-24":1,"1915-04-25":1,"1915-05-29":1,"1915-06-12":1,"1915-07-17":1,"1915-07-27":1,"1915-08-14":1,"1915-10-30":1,"1915-12-31":1,"1916-11-11":1,"1917-07-28":1,"1917-09-11":1,"1918-02-16":1,"1918-02-23":1,"1918-03-30":1,"1918-04-05":1,"1918-04-20":1,"1918-07-30":1,"1918-10-19":1,"1918-11-01":1,"1919-03-14":1,"1919-04-04":1,"1919-05-10":2,"1919-05-12":1,"1919-05-27":1,"1919-05-28":1,"1919-06-01":3,"1919-06-28":1,"1919-09-20":1,"1920-01-10":1,"1920-01-23":1,"1920-02-07":1,"1920-03-24":1,"1920-06-05":1,"1920-10-01":3,"1920-10-22":1,"1920-10-29":1,"1921-01-02":2,"1921-02-09":1,"1921-07-01":1,"1921-08-26":1,"1921-10-14":1,"1922-06-03":1,"1922-08-19":1,"1922-10-15":1,"192
This file has been truncated, but you can view the full file.
[{"Date":"1937-01-16","Inferred date":"","Performer":"Jean La Monte","City":"Detroit, MI","Venue":"Club Frontenac (Detroit, MI)","State":"MI","Source":"—————————, January 16, 1937","No_ID":"","Date_unknown":"","Page_unknown":true,"search":"","Unsure whether drag artist":"","Revue":""},{"Date":"1935-05-18","Inferred date":"","Performer":"Manhattan Pearl","City":"Pittsburgh, PA","Venue":"C and G Club (Pittsburgh, PA)","State":"PA","Source":"—————————, May 18, 1935","No_ID":"","Date_unknown":"","Page_unknown":true,"search":"","Unsure whether drag artist":"","Revue":""},{"Date":"1937-09-04","Inferred date":"","Performer":"Bobby Brennan","City":"Lake Huntington, NY","Venue":"Hotel Nut Shell (Lake Huntington, NY)","State":"NY","Source":"—————————, September 4, 1937","No_ID":"","Date_unknown":"","Page_unknown":true,"search":"","Unsure whether drag artist":"","Revue":""},{"Date":"1937-09-04","Inferred date":"","Performer":"Merry Pickford","City":"Lake Huntington, NY","Venue":"Hotel Nut Shell (Lake Huntington, NY)","S
This file has been truncated, but you can view the full file.
{"directed":false,"multigraph":false,"graph":{},"nodes":[{"connected":{"network":{"nodes":["Adrian Ames","Adrian Norris","Al Benson","Al DeMarco","Al Garbell","Al Lucas","Al Ray","Alberta Vaughn","Alden Garrison","Alfred Carmen","Alice Rydner","Alice White","Allen Carl","Andy Cliff","Arica Wild","Art Bernard","Art West","Arthur Budd","Arthur G. West","Arthur La Delle","Babe Allen","Babe Baker","Baby Blue Eyes","Bel Ager","Benny Pauly","Bert Sherry","Bert Wheeler","Bill Kennedy","Billie Beryl","Billie Brannon","Billie Brill","Billie Dale","Billie Davis","Billie Dove","Billie McAllister","Billie Russell","Billy \"Senorita\" Herrera","Billy Brill","Billy Hayes","Billy Irwin","Billy Joy","Billy Kent","Billy O'Brien","Billy Pinnell","Billy Reed","Billy Richards","Billy Rohmer","Billy Turner","Billy West","Blackie Dennis","Bob Mack","Bobbie Bell","Bobbie Davis","Bobbie Kaye","Bobbie La Marr","Bobbie Macklin","Bobbie Marlowe","Bobby Allen","Bobby Anderson","Bobby Bell","Bobby Brennan","Bobby Cummins","Bobby Dean","B
This file has been truncated, but you can view the full file.
{"directed":false,"multigraph":false,"graph":{},"nodes":[{"connected":{"network":{"nodes":["Adrian Ames","Adrian Norris","Al Benson","Al DeMarco","Al Garbell","Al Lucas","Al Ray","Alberta Vaughn","Alden Garrison","Alfred Carmen","Alice Rydner","Alice White","Allen Carl","Andy Cliff","Arica Wild","Art Bernard","Art West","Arthur Budd","Arthur G. West","Arthur La Delle","Babe Allen","Babe Baker","Baby Blue Eyes","Bel Ager","Benny Pauly","Bert Sherry","Bert Wheeler","Bill Kennedy","Billie Beryl","Billie Brannon","Billie Brill","Billie Dale","Billie Davis","Billie Dove","Billie McAllister","Billie Russell","Billy \"Senorita\" Herrera","Billy Brill","Billy Hayes","Billy Irwin","Billy Joy","Billy Kent","Billy O'Brien","Billy Pinnell","Billy Reed","Billy Richards","Billy Rohmer","Billy Turner","Billy West","Blackie Dennis","Bob Mack","Bobbie Bell","Bobbie Davis","Bobbie Kaye","Bobbie La Marr","Bobbie Macklin","Bobbie Marlowe","Bobby Allen","Bobby Anderson","Bobby Bell","Bobby Brennan","Bobby Cummins","Bobby Dean","B
This file has been truncated, but you can view the full file.
{"Sepia Mae West": [{"coLocated": {"Cabin Inn (Chicago, IL)": [["1936-09-12", "1936-09-19"], ["1938-01-01"]]}, "revues": ["Anything Goes", "Ladies by Request", "Lessons in Swing", "Salvaging Our Souls", "Swingin' at the Cabin Inn", "Doin' the Jive", "Swinging and Jamming", "(Four unnamed artists)", "At the Jazz Band Ball"], "cities": ["Chicago, IL"], "weights": {"dateGroups": 2, "venues": 1}, "edge_id": "bobbie_macklin_carol_lee", "comments": {"venues": {}, "cities": {}, "revues": {}}, "general_comments": [], "found": ["1936-09-12", "1936-09-19", "1938-01-01"], "source": "Carol Lee", "target": "Bobbie Macklin"}, {"coLocated": {"Cabin Inn (Chicago, IL)": [["1936-09-12", "1936-09-19"]]}, "revues": ["Anything Goes", "Ladies by Request", "Lessons in Swing", "Salvaging Our Souls", "Swingin' at the Cabin Inn", "Doin' the Jive", "Swinging and Jamming", "(Four unnamed artists)", "At the Jazz Band Ball"], "cities": ["Chicago, IL"], "weights": {"dateGroups": 1, "venues": 1}, "edge_id": "dixie_lee_carol_lee", "comments"
{"1032129997": [{"date": "1937-7-3", "inside": "The Billboard", "pages": "14", "title": "Night clubs-vaudeville: R. I. Bans Sunday Game", "author": null, "file": "Dunn, Francis [performer]/1937-07-03 1032129997 [Frances Dunn].jpg"}], "1032106208": [{"date": "1936-8-15", "inside": "The Billboard", "pages": "34", "title": "Circuses: Numerous Circus Acts in 'Jumbo' At Ft. Worth Frontier Centennial", "author": null, "file": "Barbette [performer]/1936-08-15 The Billboard (1032106208).jpg"}, {"date": "1936-8-15", "inside": "The Billboard", "pages": "34", "title": "Circuses: Numerous Circus Acts in 'Jumbo' At Ft. Worth Frontier Centennial", "author": null, "file": "female impersonation [subject; general]/[ProQuest] female impersonator OR female impersonation/1936-08-15 The Billboard (1032106208).jpg"}], "1475908838": [{"date": "1936-10-14", "inside": "Variety", "pages": "56", "title": "Variety House Reviews: STATE. N. Y.", "author": null, "file": "Barbette [performer]/1936-10-14 Variety (1475908838).jpg"}, {"date":
{"560013194": [{"date": "1930-10-12", "inside": "Times Union", "pages": "59", "title": null, "location": "Brooklyn, New York", "paper_url": "/browse/us/new-york/brooklyn/times-union_18390", "issue_url": "/browse/us/new-york/brooklyn/times-union_18390/1930/10/12", "file": "homosexuality, historical views on [subject; general]/sissies NY, 1930 (partial)/1930-10-12 Times Union (Brooklyn, New York), 1930-10-12, 59 (560013194).png"}], "576303103": [{"date": "1930-8-2", "inside": "The Tablet", "pages": "10", "title": null, "location": "Brooklyn, New York", "paper_url": "/browse/us/new-york/brooklyn/the-tablet_18398", "issue_url": "/browse/us/new-york/brooklyn/the-tablet_18398/1930/08/02", "file": "homosexuality, historical views on [subject; general]/sissies NY, 1930 (partial)/1930-08-02 The Tablet (Brooklyn, New York), 1930-08-02, 10 (576303103).png"}], "253878949": [{"date": "1930-3-31", "inside": "Press and Sun-Bulletin", "pages": "21", "title": null, "location": "Binghamton, New York", "paper_url": "/browse/us/