Skip to content

Commit

Permalink
bugfix in get_file_list from download module + readme cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
hadrilec committed Jan 2, 2025
1 parent 3033ab5 commit 180d1b3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 30 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ It benefits from the developments made by teams working on APIs at INSEE and IGN

## Installation & API subscription

Credentials are necessary to access SIRENE API available through `pynsee` by the module `sirene`. API credentials can be created here : [portail-api.insee.fr](https://portail-api.insee.fr/). All other modules are freely accessible. `macrodata` module gives access to macroeconomic data from BDM database. `localdata` module helps users download data at regional and departmental level. Some metadata as the activity classification (NACE) is available thanks to the `metadata` module. The files available on [insee.fr](https://www.insee.fr) and IGN data, are available from the modules `download` and `geodata` respectively.

Credentials are necessary to access SIRENE API available through `pynsee` by the module `sirene`. API credentials can be created here : [portail-api.insee.fr](https://portail-api.insee.fr/). All other modules are freely accessible.

```python

Expand Down
2 changes: 1 addition & 1 deletion docs/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ It benefits from the developments made by teams working on APIs at INSEE and IGN
Installation & API subscription
-------------------------------

Credentials are necessary to access SIRENE API available through `pynsee` by the module `sirene`. API credentials can be created here : `portail-api.insee.fr <https://portail-api.insee.fr/>`_. All other modules are freely accessible. `macrodata` module gives access to macroeconomic data from BDM database. `localdata` module helps users download data at regional and departmental level. Some metadata as the activity classification (NACE) is available thanks to the `metadata` module. The files available on `insee.fr <https://www.insee.fr>`_ and IGN data, are available from the modules `download` and `geodata` respectively.
Credentials are necessary to access SIRENE API available through `pynsee` by the module `sirene`. API credentials can be created here : `portail-api.insee.fr <https://portail-api.insee.fr/>`_. All other modules are freely accessible.

.. code-block:: python
Expand Down
42 changes: 15 additions & 27 deletions pynsee/download/get_file_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,21 @@ def get_file_list():
df = df.reset_index(drop=True)
df = _move_col_before(df, "id", "nom")

df.columns = [
"id",
"name",
"label",
"collection",
"link",
"type",
"zip",
"big_zip",
"data_file",
"tab",
"first_row",
"api_rest",
"md5",
"size",
"label_col",
"date_ref",
"meta_file",
"separator",
"type_col",
"long_col",
"val_col",
"encoding",
"last_row",
"missing_value",
]

rename_col_dict = {
"nom": "name",
"libelle": "label",
"lien": "link",
"fichier_donnees": "data_file",
"onglet": "tab",
"premiere_ligne": "first_row",
"fichier_meta": "meta_file",
"separateur": "separator",
"derniere_ligne": "last_row",
"valeurs_manquantes": "missing_value",
"disponible": "available"
}
df = df.rename(columns = rename_col_dict)

df = df[~df.link.str.contains("https://api.insee.fr")]

warning_metadata_download()
Expand Down

0 comments on commit 180d1b3

Please sign in to comment.