README.md 1.33 KB
Newer Older
1
# Tricoteuses-Assemblee-API-Server
Emmanuel Raviart's avatar
Emmanuel Raviart committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

## _GraphQL API based on open data of French Assemblée nationale_

## Installation

```bash
git clone https://framagit.org/tricoteuses/tricoteuses-assemblee-api-server
cd tricoteuses-assemblee-api-server/
npm install
```

## Usage

### Retrieve & clean open data of Assemblée nationale

```bash
# Retrieve open data (in JSON format) from Assemblée nationale's website:
npx babel-node --max-old-space-size=5120 -- node_modules/tricoteuses-assemblee/lib/scripts/retrieve_open_data.js ../assemblee-data/
# Split open data big files into small files (one for each entity).
npx babel-node --max-old-space-size=2048 -- node_modules/tricoteuses-assemblee/lib/scripts/split_data.js ../assemblee-data/
# Validate & clean JSON data:
npx babel-node -- node_modules/tricoteuses-assemblee/lib/scripts/clean_split_data.js ../assemblee-data/
# Retrieve députés' pictures from Assemblée nationale's website:
npx babel-node -- node_modules/tricoteuses-assemblee/lib/scripts/retrieve_deputes_photos.js --fetch ../assemblee-data/
# Retrieve députés' non open data informations (email...) from Assemblée nationale's website:
npx babel-node -- node_modules/tricoteuses-assemblee/lib/scripts/retrieve_deputes_infos.js --fetch --parse ../assemblee-data/
```

### Launch development web server

```bash
npm run dev ../assemblee-data/
```