Skip to content

Commit

Permalink
bugfix release + fix init_conn imports in docs (#260)
Browse files Browse the repository at this point in the history
* fix: correct init_conn imports in docs
* Update NEWS.md

Signed-off-by: Tanguy Fardet <[email protected]>
  • Loading branch information
tfardet authored Mar 7, 2025
1 parent 17467ad commit 7985c43
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 82 deletions.
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# pynsee 0.2.1

**Bugfixes**

* support parquet files in downloads (#257)
* correct column handling in ``get_series_list`` (#259)
* correct documentation about ``init_conn`` (#260)

# pynsee 0.2.0

**Breaking changes**
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pip install pynsee[full]

# Subscribe to portail-api.insee.fr and get your credentials!
# Save your credentials with init_conn function :
from pynsee.utils.init_conn import init_conn
from pynsee.utils import init_conn
init_conn(sirene_key="my_sirene_key")

# Beware : any change to the keys should be tested after having cleared the cache
Expand Down Expand Up @@ -134,7 +134,7 @@ fig.savefig('pop_france.svg',
```python

# Use the proxy_server argument of the init_conn function to change the proxy server address
from pynsee.utils.init_conn import init_conn
from pynsee.utils import init_conn
init_conn(sirene_key="my_sirene_key",
http_proxy="http://my_proxy_server:port",
https_proxy="http://my_proxy_server:port")
Expand Down
2 changes: 1 addition & 1 deletion docs/api_subscription.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Steps to access the SIRENE API via ``pynsee``
# Subscribe to api.insee.fr and get your credentials!
# Save your credentials with init_conn function :
from pynsee.utils.init_connection import init_conn
from pynsee.utils import init_conn
init_conn(sirene_key="my_sirene_key")
# Beware: any change to the keys should be tested after having cleared the cache
Expand Down
123 changes: 53 additions & 70 deletions docs/examples/example_deaths_births.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/examples/example_gdp_growth_rate_yoy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"source": [
"# Subscribe to api.insee.fr and get your credentials!\n",
"# Save your credentials with init_conn function :\n",
"# from pynsee.utils.init_conn import init_conn\n",
"# from pynsee.utils import init_conn\n",
"# init_conn(insee_key=\"my_insee_key\", insee_secret=\"my_insee_secret\")\n",
"\n",
"# Beware : any change to the keys should be tested after having cleared the cache\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/example_inflation_yoy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"source": [
"# Subscribe to api.insee.fr and get your credentials!\n",
"# Save your credentials with init_conn function :\n",
"# from pynsee.utils.init_conn import init_conn\n",
"# from pynsee.utils import init_conn\n",
"# init_conn(insee_key=\"my_insee_key\", insee_secret=\"my_insee_secret\")\n",
"\n",
"# Beware : any change to the keys should be tested after having cleared the cache\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/example_insee_premises_sirene.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"\n",
"Save your credentials with init_conn function :\n",
"```python\n",
"from pynsee.utils.init_conn import init_conn\n",
"from pynsee.utils import init_conn\n",
"init_conn(sirene_key=\"my_sirene_key\")\n",
"```\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/example_population_pyramid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"source": [
"# Subscribe to api.insee.fr and get your credentials!\n",
"# Save your credentials with init_conn function :\n",
"# from pynsee.utils.init_conn import init_conn\n",
"# from pynsee.utils import init_conn\n",
"# init_conn(insee_key=\"my_insee_key\", insee_secret=\"my_insee_secret\")\n",
"\n",
"# Beware : any change to the keys should be tested after having cleared the cache\n",
Expand Down
2 changes: 1 addition & 1 deletion pynsee/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from pynsee.utils import *
from pynsee.download import *

__version__ = "0.2.0"
__version__ = "0.2.1"
2 changes: 1 addition & 1 deletion pynsee/utils/_get_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _get_credentials_from_configfile() -> Dict[str, str]:
def _missing_credentials() -> None:
logger.critical(
"INSEE API credentials have not been found: please try to reuse "
"pynsee.utils.init_conn to save them locally.\n"
"pynsee.init_conn to save them locally.\n"
"Otherwise, you can still use environment variables as follow:\n\n"
"import os\n"
"os.environ['sirene_key'] = 'my_sirene_key'"
Expand Down
4 changes: 2 additions & 2 deletions pynsee/utils/init_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def init_conn(
Environment variables can be used instead of init_conn function
Examples:
>>> from pynsee.utils.init_conn import init_conn
>>> from pynsee.utils import init_conn
>>> init_conn(sirene_key="my_sirene_key")
>>> #
>>> # if the user has to use a proxy server use http_proxy and https_proxy arguments as follows:
>>> from pynsee.utils.init_conn import init_conn
>>> from pynsee.utils import init_conn
>>> init_conn(sirene_key="my_sirene_key",
>>> http_proxy="http://my_proxy_server:port",
>>> https_proxy="http://my_proxy_server:port")
Expand Down
2 changes: 1 addition & 1 deletion pynsee/utils/requests_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
**This function should only be loaded with arguments through
pynsee.utils.init_conn**.
See pynsee.utils.init_conn to create a new configuration.
See :func:`~pynsee.utils.init_conn` to create a new configuration.
Parameters
----------
Expand Down

0 comments on commit 7985c43

Please sign in to comment.