mobisurvstd 1.3.1__tar.gz → 1.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mobisurvstd-1.3.1/src/mobisurvstd.egg-info → mobisurvstd-1.4.0}/PKG-INFO +1 -1
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/pyproject.toml +1 -1
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/main.py +18 -19
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0/src/mobisurvstd.egg-info}/PKG-INFO +1 -1
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/LICENSE.md +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/README.md +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/setup.cfg +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/__init__.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/__main__.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/__init__.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/common.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/deplacements.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/edgt.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/edvm.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/emc2.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/emd.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/menages.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/nantes_opendata.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/personnes.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/reader.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/survey.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/trajets.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cerema/zones.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/classes.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/cli.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/common/__init__.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/common/cars.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/common/clean.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/common/households.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/common/legs.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/common/motorcycles.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/common/persons.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/common/trips.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/common/zones.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2010/__init__.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2010/deplacements.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2010/menages.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2010/personnes.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2010/survey.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2010/trajets.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2010/zones.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2020/__init__.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2020/deplacements.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2020/menages.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2020/motos.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2020/personnes.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2020/survey.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2020/trajets.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/egt2020/voitures.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emg2023/__init__.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emg2023/deplacements.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emg2023/menages.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emg2023/personnes.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emg2023/survey.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emp/__init__.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emp/common.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emp/deplacements.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emp/menages.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emp/motos.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emp/personnes.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emp/survey.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/emp/voitures.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/logger.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/resources/__init__.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/resources/admin_express.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/resources/insee_data.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/resources/nuts.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/schema/__init__.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/schema/cars.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/schema/common.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/schema/guarantees.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/schema/households.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/schema/legs.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/schema/motorcycles.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/schema/persons.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/schema/trips.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/utils.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd/validation.py +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd.egg-info/SOURCES.txt +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd.egg-info/dependency_links.txt +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd.egg-info/entry_points.txt +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd.egg-info/requires.txt +0 -0
- {mobisurvstd-1.3.1 → mobisurvstd-1.4.0}/src/mobisurvstd.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mobisurvstd
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: A tool to standardize French mobility survey datasets (EMC2, EGT, EMP, etc.) into a unified format.
|
|
5
5
|
Author-email: Lucas Javaudin <lucas@lucasjavaudin.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "mobisurvstd"
|
|
9
|
-
version = "1.
|
|
9
|
+
version = "1.4.0"
|
|
10
10
|
description = "A tool to standardize French mobility survey datasets (EMC2, EGT, EMP, etc.) into a unified format."
|
|
11
11
|
readme = "README.md"
|
|
12
12
|
authors = [{ name = "Lucas Javaudin", email = "lucas@lucasjavaudin.com" }]
|
|
@@ -139,12 +139,12 @@ def standardize(
|
|
|
139
139
|
|
|
140
140
|
def bulk_standardize(
|
|
141
141
|
directory: str | Path,
|
|
142
|
-
output_directory: str | Path,
|
|
142
|
+
output_directory: str | Path | None = None,
|
|
143
143
|
survey_type: str | None = None,
|
|
144
144
|
skip_spatial: bool = False,
|
|
145
145
|
skip_insee: bool = False,
|
|
146
146
|
no_validation: bool = False,
|
|
147
|
-
):
|
|
147
|
+
) -> list[SurveyData] | None:
|
|
148
148
|
"""Standardizes mobility surveys in bulk from a given directory.
|
|
149
149
|
|
|
150
150
|
MobiSurvStd will explore all directories and zipfiles within `directory`, try to standardize
|
|
@@ -159,6 +159,7 @@ def bulk_standardize(
|
|
|
159
159
|
Path to the directory where the standardized surveys should be stored.
|
|
160
160
|
If the directory does not exist, MobiSurvStd will create it (recursively).
|
|
161
161
|
Each survey read is stored in a subdirectory whose name is the survey's name.
|
|
162
|
+
If None, the standardized surveys will not be saved.
|
|
162
163
|
survey_type
|
|
163
164
|
String indicating the type of the surveys to be converted.
|
|
164
165
|
If the directory contains surveys of different types, leave this value to None and
|
|
@@ -187,47 +188,45 @@ def bulk_standardize(
|
|
|
187
188
|
>>> import mobisurvstd
|
|
188
189
|
>>> mobisurvstd.bulk_standardize("my_surveys", "standardized_surveys")
|
|
189
190
|
"""
|
|
190
|
-
|
|
191
|
-
Path(
|
|
192
|
-
|
|
193
|
-
survey_type,
|
|
194
|
-
skip_spatial,
|
|
195
|
-
skip_insee,
|
|
196
|
-
no_validation,
|
|
197
|
-
n=0,
|
|
191
|
+
if output_directory is not None:
|
|
192
|
+
output_directory = Path(output_directory)
|
|
193
|
+
results = bulk_standardize_impl(
|
|
194
|
+
Path(directory), output_directory, survey_type, skip_spatial, skip_insee, no_validation
|
|
198
195
|
)
|
|
196
|
+
n = len(results)
|
|
199
197
|
if n > 0:
|
|
200
198
|
logger.success(f"Successfully read {n} surveys from `{directory}`")
|
|
201
199
|
if n == 0:
|
|
202
200
|
logger.error(f"No survey could be read from `{directory}`")
|
|
201
|
+
return results
|
|
203
202
|
|
|
204
203
|
|
|
205
204
|
def bulk_standardize_impl(
|
|
206
205
|
directory: Path,
|
|
207
|
-
output_directory: Path,
|
|
206
|
+
output_directory: Path | None,
|
|
208
207
|
survey_type: str | None = None,
|
|
209
208
|
skip_spatial: bool = False,
|
|
210
209
|
skip_insee: bool = False,
|
|
211
210
|
no_validation: bool = False,
|
|
212
|
-
|
|
213
|
-
):
|
|
211
|
+
results: list[SurveyData] = [],
|
|
212
|
+
) -> list[SurveyData]:
|
|
214
213
|
if not directory.is_dir():
|
|
215
214
|
logger.error(f"Not a valid directory: {directory}")
|
|
216
|
-
return
|
|
215
|
+
return results
|
|
217
216
|
for source in directory.iterdir():
|
|
218
217
|
if source.is_dir():
|
|
219
218
|
maybe_type = guess_survey_type(source)
|
|
220
219
|
if maybe_type is None:
|
|
221
220
|
# The directory does not seem to be a valid survey.
|
|
222
221
|
# We try to iteratively read that directory.
|
|
223
|
-
|
|
222
|
+
bulk_standardize_impl(
|
|
224
223
|
source,
|
|
225
224
|
output_directory,
|
|
226
225
|
survey_type,
|
|
227
226
|
skip_spatial,
|
|
228
227
|
skip_insee,
|
|
229
228
|
no_validation,
|
|
230
|
-
|
|
229
|
+
results,
|
|
231
230
|
)
|
|
232
231
|
else:
|
|
233
232
|
data = standardize(
|
|
@@ -240,7 +239,7 @@ def bulk_standardize_impl(
|
|
|
240
239
|
no_validation=no_validation,
|
|
241
240
|
)
|
|
242
241
|
if data is not None:
|
|
243
|
-
|
|
242
|
+
results.append(data)
|
|
244
243
|
if source.suffix == ".zip":
|
|
245
244
|
data = standardize(
|
|
246
245
|
source,
|
|
@@ -252,5 +251,5 @@ def bulk_standardize_impl(
|
|
|
252
251
|
no_validation=no_validation,
|
|
253
252
|
)
|
|
254
253
|
if data is not None:
|
|
255
|
-
|
|
256
|
-
return
|
|
254
|
+
results.append(data)
|
|
255
|
+
return results
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mobisurvstd
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: A tool to standardize French mobility survey datasets (EMC2, EGT, EMP, etc.) into a unified format.
|
|
5
5
|
Author-email: Lucas Javaudin <lucas@lucasjavaudin.com>
|
|
6
6
|
License-Expression: MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|