Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration for credentials, proxies, and progress #162

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
b673ada
Use configuration dictionary
tfardet Jul 18, 2023
4e86896
Correct environment variables for credentials
tfardet Jul 18, 2023
49bd3a9
Remove pynsee_print_url from env
tgrandje Jul 25, 2023
3cee35d
Fix get_location, add token logging + alt text
tfardet Aug 8, 2023
871df17
bugfix
hadrilec Sep 2, 2023
c735cc4
Move idbank and file list to settings, improved token management
tfardet Sep 4, 2023
f7c37f9
Use configuration dictionary
tfardet Jul 18, 2023
73f6f84
Correct environment variables for credentials
tfardet Jul 18, 2023
15f0631
Remove pynsee_print_url from env
tgrandje Jul 25, 2023
9d455be
Move idbank and file list to settings, improved token management
tfardet Sep 4, 2023
f01f66c
Merged remote
tfardet Sep 4, 2023
6ed4f77
Merge branch 'master' into settings
tfardet Sep 4, 2023
22d0f23
restore old imports
tfardet Sep 5, 2023
9d44564
Merge remote-tracking branch 'refs/remotes/origin/settings' into sett…
tfardet Sep 5, 2023
a382201
Correct missing imports
tfardet Sep 5, 2023
3fe8df0
Final correction of imports
tfardet Sep 5, 2023
b1d3f5c
bug fix geofrdf import
hadrilec Sep 9, 2023
a629c9a
bug fix - ci/cd - trigger pkg tests on pr head commit
hadrilec Sep 9, 2023
d1d0fb8
Merge branch 'master' into settings
tfardet Sep 9, 2023
a26877f
Fix test imports + update them
Sep 9, 2023
f3c86e7
Fix tests except number 2
Sep 9, 2023
7a32ef2
Fix logging
Sep 9, 2023
156b830
cleanup
Sep 9, 2023
aec3a9d
Move to platformdirs and add config file
Nov 14, 2023
cb0fd7a
Merge master, fix test decorator
Nov 14, 2023
0f567dd
Fix tests
Nov 14, 2023
9fbeae2
Insee key and secret must be passed simultaneously
Nov 15, 2023
41cc4b9
Restore order for token: env, then config, then request from insee cred
Nov 15, 2023
3cf4a1b
Fix _get_credentials
Nov 15, 2023
2b9b436
Finalize credentials logic
Nov 16, 2023
2c8626b
doc requirements adjustement - tests fix
hadrilec Sep 24, 2023
32882f6
readme.md
hadrilec Oct 3, 2023
f464ee0
modif readme
hadrilec Oct 3, 2023
c5f72e3
setup include readme.md
hadrilec Oct 3, 2023
75a1dd7
readme update
hadrilec Oct 3, 2023
cb2162b
readme update
hadrilec Oct 3, 2023
d171c08
readme update
hadrilec Oct 3, 2023
2c3ce82
test new release in pypitest
hadrilec Oct 3, 2023
a9faa7b
markdown readme
hadrilec Oct 14, 2023
fca3a87
geopandas doc requirement
hadrilec Oct 14, 2023
860e27a
tests only on py 3.8+3.11, geopandas version fix
hadrilec Nov 18, 2023
68d4c0e
multiprocessing backup solution if it fails
hadrilec Nov 18, 2023
5922208
warning removed by explicitly dropping cols before concat df
hadrilec Nov 18, 2023
82ca453
wait_api_query not needed anymore as 529 error triggers some sleep
hadrilec Nov 18, 2023
7880833
notebooks update and fix
hadrilec Nov 18, 2023
34c3121
gitignore update
hadrilec Nov 18, 2023
67a8a98
conflicts solved
hadrilec Nov 18, 2023
0383d69
syntax fix
hadrilec Nov 18, 2023
5a1125c
func not used anymore rmv
hadrilec Nov 18, 2023
772e6dd
Update pynsee/geodata/_get_geodata.py
hadrilec Nov 18, 2023
6de48c4
Update pynsee/localdata/_find_latest_local_dataset.py
hadrilec Nov 18, 2023
1e1163d
Update pynsee/macrodata/_download_idbank_list.py
hadrilec Nov 18, 2023
147d025
Update pynsee/utils/_clean_insee_folder.py
hadrilec Nov 18, 2023
e52ade6
Update pynsee/utils/_create_insee_folder.py
hadrilec Nov 18, 2023
7b614d0
Update pynsee/metadata/get_legal_entity.py
hadrilec Nov 18, 2023
8117f61
cleaning tests
hadrilec Nov 18, 2023
fb413cb
user agent used to try to avoid connection error
hadrilec Nov 18, 2023
269154a
Merge branch 'settings' of https://github.com/tfardet/pynsee into set…
hadrilec Nov 18, 2023
2366eb8
use _request_insee in token config func
hadrilec Nov 18, 2023
7763812
catch error 429 and sleep
hadrilec Nov 18, 2023
72e13ac
init_conn - catch error 429
hadrilec Nov 18, 2023
0afbd0f
share connections when testing the token
hadrilec Nov 18, 2023
977b67d
Cleanup code, move to return early pattern
Nov 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pkgTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.11"]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgTests_pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.11"]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ docs/auto_examples/
.idea/
.ipynb_checkpoints/
docs/examples/*.html
docs/examples/*.csv
docs/examples/*.svg
docs/examples/.jupyter_cache/*
/.quarto/
.spyproject/
Expand Down
22 changes: 11 additions & 11 deletions docs/api_subscription.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. role:: raw-html(raw)
:format: html

Have a look at the official tutorial on `api.insee.fr <https://api.insee.fr/catalogue/site/themes/wso2/subthemes/insee/pages/help.jag>`_


API Subscription Tutorial
=========================

Expand All @@ -21,38 +21,38 @@ API Subscription Tutorial

.. image:: _static/myaccount.png
:target: _static/myaccount.png
:alt:
:alt: Click on "Créer son compte", which means "create an account", in French, when on https://api.insee.fr

:raw-html:`<br />`

.. image:: _static/myapp.png
:target: _static/myapp.png
:alt:
:alt: Once logged, click on "Mes applications" (my apps), then on "Ajouter une application" '(add an app).

:raw-html:`<br />`

.. image:: _static/mytoken.png
:target: _static/mytoken.png
:alt:
:alt: Select "Clefs et jetons d'accès" (keys and tokens) and click on "Générer les clefs" (generate keys) to create your credentials.

:raw-html:`<br />`

.. image:: _static/mykeys.png
:target: _static/mykeys.png
:alt:
:alt: Then click on "Montrer les clefs" (show keys) and copy these for use in the init_con function.

:raw-html:`<br />`

.. image:: _static/mysubscription.png
:target: _static/mysubscription.png
:alt:
:alt: Use the newly created application to subscribe to all relevant APIs via "Les APIs de l'INSEE", then selecting each API (B, L, M, S), select the new applications in "Applications", and click "Souscrire" (subscribe).

.. code-block:: python

# Subscribe to api.insee.fr and get your credentials!
# Save your credentials with init_conn function :
# Save your credentials with init_conn function :
from pynsee.utils.init_conn import init_conn
init_conn(insee_key="my_insee_key", insee_secret="my_insee_secret")

# Beware : any change to the keys should be tested after having cleared the cache
# Please do : from pynsee.utils import clear_all_cache; clear_all_cache()
# Please do : from pynsee.utils import clear_all_cache; clear_all_cache()
Loading
Loading