Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Observatoire
observatoire-scripts
Commits
0dc9007e
Commit
0dc9007e
authored
Sep 30, 2019
by
Pierre Dittgen
Browse files
Stop outputting libelle_region (not always available)
parent
1f588759
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/download/siren_info.py
View file @
0dc9007e
...
...
@@ -51,7 +51,6 @@ def get_coords_by_siren(siren):
'latitude'
:
siege_social
.
get
(
'latitude'
,
''
),
'nom'
:
siege_social
.
get
(
'l1_normalisee'
,
''
),
'region'
:
siege_social
.
get
(
'region'
,
''
),
'libelle_region'
:
siege_social
.
get
(
'libelle_region'
,
''
),
'departement'
:
siege_social
.
get
(
'departement'
,
''
)
}
}
...
...
@@ -80,8 +79,8 @@ def main():
out
=
args
.
out
.
open
(
'wt'
,
encoding
=
'utf-8'
)
if
args
.
out
else
sys
.
stdout
writer
=
csv
.
writer
(
out
)
writer
.
writerow
([
'siren'
,
'nom'
,
'latitude'
,
'longitude'
,
'region'
,
'
libelle_region'
,
'
departement'
,
'statut'
,
'message'
])
writer
.
writerow
([
'siren'
,
'nom'
,
'latitude'
,
'longitude'
,
'
code_
region'
,
'
code_
departement'
,
'statut'
,
'message'
])
with
input_filepath
.
open
(
'rt'
,
encoding
=
'utf-8'
)
as
fd
:
for
line
in
fd
:
...
...
@@ -101,7 +100,6 @@ def main():
data
[
'latitude'
],
data
[
'longitude'
],
data
[
'region'
],
data
[
'libelle_region'
],
data
[
'departement'
],
'ok'
,
''
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment