wip
This commit is contained in:
parent
82293a196c
commit
95c3ba7798
|
@ -32,6 +32,7 @@
|
||||||
"@tiptap/extension-mention": "2.0.0-beta.102",
|
"@tiptap/extension-mention": "2.0.0-beta.102",
|
||||||
"@tiptap/starter-kit": "2.0.0-beta.190",
|
"@tiptap/starter-kit": "2.0.0-beta.190",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
|
"csv-parser": "3.0.0",
|
||||||
"express": "4.18.1",
|
"express": "4.18.1",
|
||||||
"firebase-admin": "10.0.0",
|
"firebase-admin": "10.0.0",
|
||||||
"firebase-functions": "3.21.2",
|
"firebase-functions": "3.21.2",
|
||||||
|
|
1398
functions/src/scripts/grants/op-grants.csv
Normal file
1398
functions/src/scripts/grants/op-grants.csv
Normal file
File diff suppressed because it is too large
Load Diff
21
functions/src/scripts/grants/parse-op.ts
Normal file
21
functions/src/scripts/grants/parse-op.ts
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
// Run with `npx ts-node src/scripts/grants/parse-op.ts`
|
||||||
|
|
||||||
|
import * as fs from 'fs'
|
||||||
|
|
||||||
|
// Parse OpenPhil grants from csv file
|
||||||
|
async function parseOp() {
|
||||||
|
const csv = fs.readFileSync('op-grants.csv', 'utf8')
|
||||||
|
const lines = csv.split('\n')
|
||||||
|
// Remove header row
|
||||||
|
lines.shift()
|
||||||
|
const grants = lines.map((line) => {
|
||||||
|
const [grant, orgName, focusArea, amount, date] = line.split(',')
|
||||||
|
// Return a json-formatted string like `{ from: 'OP', to: 'Manifold', amount: 1234 }`
|
||||||
|
return `{ from: "OP", to: ${orgName}, date: ${date}, amount: ${amount}, description: ${grant}${focusArea} }`
|
||||||
|
})
|
||||||
|
fs.writeFileSync('output-grants.csv', grants.join('\n'))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (require.main === module) {
|
||||||
|
parseOp().then(() => process.exit())
|
||||||
|
}
|
3
web/pages/grants/opGrants.ts
Normal file
3
web/pages/grants/opGrants.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import { Grant } from '.'
|
||||||
|
|
||||||
|
export const ftxGrants: Grant[] = []
|
|
@ -5043,6 +5043,13 @@ csstype@^3.0.2:
|
||||||
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2"
|
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2"
|
||||||
integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==
|
integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==
|
||||||
|
|
||||||
|
csv-parser@3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/csv-parser/-/csv-parser-3.0.0.tgz#b88a6256d79e090a97a1b56451f9327b01d710e7"
|
||||||
|
integrity sha512-s6OYSXAK3IdKqYO33y09jhypG/bSDHPuyCme/IdEHfWpLf/jKcpitVFyOC6UemgGk8v7Q5u2XE0vvwmanxhGlQ==
|
||||||
|
dependencies:
|
||||||
|
minimist "^1.2.0"
|
||||||
|
|
||||||
d3-array@2, d3-array@^2.3.0:
|
d3-array@2, d3-array@^2.3.0:
|
||||||
version "2.12.1"
|
version "2.12.1"
|
||||||
resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-2.12.1.tgz#e20b41aafcdffdf5d50928004ececf815a465e81"
|
resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-2.12.1.tgz#e20b41aafcdffdf5d50928004ececf815a465e81"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user