Skip to content

Commit

Permalink
chore: add libpostal installation and fix minor element
Browse files Browse the repository at this point in the history
  • Loading branch information
AlasDiablo committed Jan 30, 2024
1 parent 2e84684 commit 0293d85
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 14 deletions.
28 changes: 25 additions & 3 deletions services/affiliations-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
FROM cnrsinist/ezs-python-server:py3.9-no16-1.0.6

USER root
# Install all python dependencies
# RUN pip install \
# unidecode==1.3.7

# Install libpostal
ENV LIBPOSTAL_HOME=/usr/share/libpostal

RUN apt install -y curl autoconf automake libtool pkg-config

ADD \
https://codeload.github.com/openvenues/libpostal/zip/refs/heads/master \
${LIBPOSTAL_HOME}/libpostal.zip

WORKDIR ${LIBPOSTAL_HOME}

RUN unzip libpostal.zip && \
chmod +x libpostal-master && \
ch libpostal-master && \
./bootstrap.sh && \
./configure --datadir=${LIBPOSTAL_HOME} && \
make -j4 && \
make install && \
ldconfig && \
cd .. && \
rm -rf libpostal-master && \
rm libpostal.zip

# Install all node dependencies
RUN npm install \
node-gyp \
@cymen/[email protected] \
@ezs/[email protected] \
@ezs/[email protected]

Expand Down
10 changes: 5 additions & 5 deletions services/affiliations-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ des virgules.
#### Exemple CSV

```bash
cat <<EOF | curl -X POST --data-binary @- "https://affiliations-tools.services.inist.fr/v1/rnsr/csv"
cat <<EOF | curl -X POST --data-binary @- "https://affiliations-tools.services.istex.fr/v1/rnsr/csv"
Année,Adresse
2015,CNRS UMR AMAP MONTPELLIER FRA
2015,IRD UMR AMAP MONTPELLIER FRA
Expand Down Expand Up @@ -99,7 +99,7 @@ Le champ `value` contient un objet avec deux propriétés:
#### Exemple JSON

```bash
cat <<EOF|curl -X POST --data-binary @- "https://affiliations-tools.services.inist.fr/v1/rnsr/json?indent=true"
cat <<EOF|curl -X POST --data-binary @- "https://affiliations-tools.services.istex.fr/v1/rnsr/json?indent=true"
[
{ "id":1, "value": { "year": "2021", "address": "CNRS UMR AMAP MONTPELLIER FRA" } },
{ "id":2, "value": { "year": "2021", "address": "IRD UMR AMAP MONTPELLIER FRA" } },
Expand Down Expand Up @@ -149,7 +149,7 @@ Le champ `value` contient un objet avec deux propriétés:
#### Exemple Info
```bash
cat <<EOF|curl -X POST --data-binary @- "https://affiliations-tools.services.inist.fr/v1/rnsr/info?indent=true"
cat <<EOF|curl -X POST --data-binary @- "https://affiliations-tools.services.istex.fr/v1/rnsr/info?indent=true"
[
{ "id":7, "value": { "address": "Inist-CNRS, UPS76, 2 rue Jean Zay, Vandoeuvre-lès-Nancy" } }
]
Expand Down Expand Up @@ -195,7 +195,7 @@ Ajoute un champ `conditorRnsr` au niveau du champ `address`.
#### Exemple conditor
```bash
cat <<EOF|curl -X POST --data-binary @- "https://affiliations-tools.services.inist.fr/v1/rnsr/conditor"
cat <<EOF|curl -X POST --data-binary @- "https://affiliations-tools.services.istex.fr/v1/rnsr/conditor"
[
{
"xPublicationDate": ["2012-01-01"],
Expand Down Expand Up @@ -237,7 +237,7 @@ Sortie :
#### via curl
```bash
cat <<EOF|curl -N --data-binary @- "https://affiliations-tools.services.inist.fr/v1/addresses/parse?indent=true"
cat <<EOF|curl -N --data-binary @- "https://affiliations-tools.services.istex.fr/v1/addresses/parse?indent=true"
[
{ "value": "Inist-CNRS 2, rue Jean Zay CS 10310 F-54519 Vandœuvre-lès-Nancy France" },
{ "value": "46th St & 1st Ave, New York, NY 10017" }
Expand Down
4 changes: 2 additions & 2 deletions services/affiliations-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "ws-affiliations-tools",
"version": "0.0.0",
"version": "1.1.2",
"description": "Structuration et enrichissements d'affiliations",
"repository": {
"type": "git",
Expand Down Expand Up @@ -32,4 +32,4 @@
"start": "docker run --rm -p 31976:31976 cnrsinist/${npm_package_name}:${npm_package_version}",
"publish": "docker push cnrsinist/${npm_package_name}:${npm_package_version}"
}
}
}
4 changes: 2 additions & 2 deletions services/affiliations-tools/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "affiliations-tools - Structuration et enrichissements d'affiliations",
"summary": "Propose plusieurs services autour des affiliations présentes dans les notices bibliographiques",
"version": "0.0.0",
"version": "1.1.2",
"termsOfService": "https://services.istex.fr/",
"contact": {
"name": "Inist-CNRS",
Expand All @@ -30,4 +30,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion services/affiliations-tools/v1/addresses/parse.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
mimeType = application/json

post.operationId = post-v1-addresses-parse
post.description = Traitement qui analyse une adresse postal dans une chaine de caractère et qui renvoit un objet contenant les champs trouvés dans l'adresse
post.description = Traitement qui analyse une adresse postale dans une chaîne de caractères et qui renvoie un objet contenant les champs trouvés dans l'adresse
post.summary = Analyse and parse address given in `value`, when possible
post.tags.0 = adresses
post.requestBody.content.application/json.example.0.id = 1
Expand Down
2 changes: 1 addition & 1 deletion services/affiliations-tools/v1/expand.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
mimeType = application/json

post.operationId = post-v1-expand
post.description = Traitement qui analyse une adresse postal dans une chaine de caractère et qui renvoit un objet enrichi
post.description = Traitement qui analyse une adresse postale dans une chaîne de caractères et qui renvoie un objet enrichi
post.summary = Analyse and parse address given in `value`, when possible
post.tags.0 = adresses
post.requestBody.content.application/json.example.0.id = 1
Expand Down

0 comments on commit 0293d85

Please sign in to comment.