This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S uv run | |
# /// script | |
# requires-python = ">=3.11" | |
# dependencies = ["duckdb"] | |
# /// | |
import duckdb | |
duckdb.sql(""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
while(<<>>) { | |
s/",?\s?"?/|/g; | |
print "|---" x (tr/|// - 1), "|\n" if $. == 2; | |
s/(\d),/$1/g; | |
print; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
while (<<>>) { | |
$. == 1 ? s/",?\s?"?/||/g : s/",?\s?"?/|/g; | |
s/(\d),/$1/g; | |
s/\|\|/| |/g if $. > 1; | |
s/\s\|\|/ | |/g if $. > 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(httr2) | |
library(tidyr) | |
library(xml2) | |
library(dplyr) | |
library(stringr) | |
library(lubridate) | |
library(congress) | |
set_congress_key("DEMO_KEY") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NR == 1 { | |
gsub(/",\s?"/, "||"); | |
gsub(/",/, "||"); | |
gsub(/,"/, "||"); | |
gsub(/"/, ""); | |
print("||"$0"||"); | |
} | |
NR >= 2 { | |
gsub(/",\s?"/, "|"); | |
gsub(/",/, "|"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { FS = "|" } | |
NR == 1 { | |
gsub(/",\s?"/, "|"); | |
gsub(/",/, "|"); | |
gsub(/,"/, "|"); | |
gsub(/"/, ""); | |
print("|"$0"|"); | |
for (i = 0; i < NF; i++) { | |
printf("|---") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import sys | |
from pathlib import Path | |
input_file = sys.argv[1] | |
input_file_path = Path(input_file) | |
output_file_path = Path(f"{input_file_path.stem}.tsv") | |
with open(input_file_path) as csv_in, open(output_file_path, "w") as tsv_out: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy | |
from fastapi import FastAPI | |
from pydantic import BaseModel, Field | |
app = FastAPI( | |
title="NER service based on spaCy", | |
description=""" | |
Provides the NER component from [spaCy](https://spacy.io/) as web service. | |
- spaCy: 3.5.2 | |
- Model: [en_core_web_sm](https://spacy.io/models/en#en_core_web_sm) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
python3 smrc_tags.py | |
mlr --j2t cat tags.json > tags.tsv | |
python3 upload.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"flag" | |
"fmt" | |
"io" | |
"net/http" | |
"regexp" | |
"strconv" |
NewerOlder