Skip to content

Commit 4d57ed0

Browse files
committed
Fix entrypoint path building
1 parent 9a34c34 commit 4d57ed0

9 files changed

Lines changed: 63 additions & 69 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Versions follow [Semantic Versioning](https://semver.org/) (`<major>.<minor>.<patch>`).
44

5+
## Unreleased
6+
7+
Released XXXX-XX-XX
8+
9+
- Fix entrypoint path building.
10+
511
## Version 0.6.4
612

713
Released 2021-04-08

istacpy/indicators/indicators.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
31
from istacpy import services
42

53
API = 'indicators'
@@ -63,7 +61,7 @@ def get_indicators_code(indicatorcode):
6361
>>> get_indicators_code("AFILIACIONES")
6462
>>> get_indicators_code("PARO_REGISTRADO")
6563
"""
66-
path = os.path.join('indicators', indicatorcode)
64+
path = '/'.join(['indicators', indicatorcode])
6765
url = services.build_entrypoint_url(API, path)
6866
return services.get_content(url)
6967

@@ -88,7 +86,7 @@ def get_indicators_code_data(indicatorcode, representation='', granularity='', f
8886
Examples:
8987
>>> get_indicators_code_data("AFILIACIONES")
9088
"""
91-
path = os.path.join('indicators', indicatorcode, 'data')
89+
path = '/'.join(['indicators', indicatorcode, 'data'])
9290
url = services.build_entrypoint_url(
9391
API, path, representation=representation, granularity=granularity, fields=fields
9492
)

istacpy/indicators/systems.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
31
from istacpy import services
42

53
API = 'indicators'
@@ -44,7 +42,7 @@ def get_indicators_systems_code(indicatorsystemcode):
4442
Examples:
4543
>>> get_indicators_systems_code("C00075H")
4644
"""
47-
path = os.path.join('indicatorsSystems', indicatorsystemcode)
45+
path = '/'.join(['indicatorsSystems', indicatorsystemcode])
4846
url = services.build_entrypoint_url(API, path)
4947
return services.get_content(url)
5048

@@ -90,7 +88,7 @@ def get_indicators_systems_code_instances(
9088
... q='id EQ "INDICADORES_MUNICIPALES"'
9189
... )
9290
"""
93-
path = os.path.join('indicatorsSystems', indicatorsystemcode, 'indicatorsInstances')
91+
path = '/'.join(['indicatorsSystems', indicatorsystemcode, 'indicatorsInstances'])
9492
url = services.build_entrypoint_url(
9593
API,
9694
path,
@@ -121,11 +119,13 @@ def get_indicators_systems_code_instances_code(indicatorsystemcode, indicatorins
121119
... "21af0477-d63b-493b-ad02-4ab181547223"
122120
... )
123121
"""
124-
path = os.path.join(
125-
'indicatorsSystems',
126-
indicatorsystemcode,
127-
'indicatorsInstances',
128-
indicatorinstancecode,
122+
path = '/'.join(
123+
[
124+
'indicatorsSystems',
125+
indicatorsystemcode,
126+
'indicatorsInstances',
127+
indicatorinstancecode,
128+
]
129129
)
130130
url = services.build_entrypoint_url(API, path)
131131
return services.get_content(url)
@@ -159,12 +159,14 @@ def get_indicators_systems_code_instances_code_data(
159159
... "21af0477-d63b-493b-ad02-4ab181547223"
160160
... )
161161
"""
162-
path = os.path.join(
163-
'indicatorsSystems',
164-
indicatorsystemcode,
165-
'indicatorsInstances',
166-
indicatorinstancecode,
167-
'data',
162+
path = '/'.join(
163+
[
164+
'indicatorsSystems',
165+
indicatorsystemcode,
166+
'indicatorsInstances',
167+
indicatorinstancecode,
168+
'data',
169+
]
168170
)
169171
url = services.build_entrypoint_url(
170172
API, path, representation=representation, granularity=granularity, fields=fields

istacpy/statisticalresources/cubes.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
31
from istacpy import services
42

53
API = 'statistical-resources'
@@ -48,7 +46,7 @@ def get_statisticalresources_datasets_agency(
4846
Examples:
4947
>>> get_statisticalresources_datasets_agency(agencyid="ISTAC")
5048
"""
51-
path = os.path.join('datasets', agencyid)
49+
path = '/'.join(['datasets', agencyid])
5250
url = services.build_entrypoint_url(
5351
API, path, lang=lang, limit=limit, offset=offset, orderBy=orderby, query=query
5452
)
@@ -81,7 +79,7 @@ def get_statisticalresources_datasets_agency_resource(
8179
... )
8280
8381
"""
84-
path = os.path.join('datasets', agencyid, resourceid)
82+
path = '/'.join(['datasets', agencyid, resourceid])
8583
url = services.build_entrypoint_url(
8684
API, path, lang=lang, limit=limit, offset=offset, orderBy=orderby, query=query
8785
)
@@ -114,6 +112,6 @@ def get_statisticalresources_datasets_agency_resource_version(
114112
... version="001.000"
115113
... )
116114
"""
117-
path = os.path.join('datasets', agencyid, resourceid, version)
115+
path = '/'.join(['datasets', agencyid, resourceid, version])
118116
url = services.build_entrypoint_url(API, path, dim=dim, fields=fields, lang=lang)
119117
return services.get_content(url)

istacpy/structuralresources/category.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
31
from istacpy import services
42

53
API = 'structural-resources'
@@ -49,7 +47,7 @@ def get_structuralresources_categorisations_agency(
4947
Examples:
5048
>>> get_structuralresources_categorisations_agency("ISTAC")
5149
"""
52-
path = os.path.join('categorisations', agencyid)
50+
path = '/'.join(['categorisations', agencyid])
5351
url = services.build_entrypoint_url(
5452
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
5553
)
@@ -75,7 +73,7 @@ def get_structuralresources_categorisations_agency_resource(
7573
Examples:
7674
>>> get_structuralresources_categorisations_agency_resource("ISTAC", "cat2")
7775
"""
78-
path = os.path.join('categorisations', agencyid, resourceid)
76+
path = '/'.join(['categorisations', agencyid, resourceid])
7977
url = services.build_entrypoint_url(
8078
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
8179
)
@@ -102,7 +100,7 @@ def get_structuralresources_categorisations_agency_resource_version(
102100
... "01.000"
103101
... )
104102
"""
105-
path = os.path.join('categorisations', agencyid, resourceid, version)
103+
path = '/'.join(['categorisations', agencyid, resourceid, version])
106104
url = services.build_entrypoint_url(API, path)
107105
return services.get_content(url)
108106

@@ -155,7 +153,7 @@ def get_structuralresources_category_schemes_agency(
155153
... orderby="ID ASC"
156154
...)
157155
"""
158-
path = os.path.join('categoryschemes', agencyid)
156+
path = '/'.join(['categoryschemes', agencyid])
159157
url = services.build_entrypoint_url(
160158
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
161159
)
@@ -184,7 +182,7 @@ def get_structuralresources_category_schemes_agency_resource(
184182
... "TEMAS_CANARIAS"
185183
... )
186184
"""
187-
path = os.path.join('categoryschemes', agencyid, resourceid)
185+
path = '/'.join(['categoryschemes', agencyid, resourceid])
188186
url = services.build_entrypoint_url(
189187
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
190188
)
@@ -211,7 +209,7 @@ def get_structuralresources_category_schemes_agency_resource_version(
211209
... "01.000"
212210
... )
213211
"""
214-
path = os.path.join('categoryschemes', agencyid, resourceid, version)
212+
path = '/'.join(['categoryschemes', agencyid, resourceid, version])
215213
url = services.build_entrypoint_url(API, path)
216214
return services.get_content(url)
217215

@@ -241,7 +239,7 @@ def get_structuralresources_category_schemes_agency_resource_version_categories(
241239
... "01.000"
242240
... )
243241
"""
244-
path = os.path.join('categoryschemes', agencyid, resourceid, version, 'categories')
242+
path = '/'.join(['categoryschemes', agencyid, resourceid, version, 'categories'])
245243
url = services.build_entrypoint_url(
246244
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
247245
)
@@ -276,8 +274,8 @@ def get_structuralresources_category_schemes_agency_resource_version_categories_
276274
... "060.060_010.060_010_010"
277275
... )
278276
"""
279-
path = os.path.join(
280-
'categoryschemes', agencyid, resourceid, version, 'categories', categoryid
277+
path = '/'.join(
278+
['categoryschemes', agencyid, resourceid, version, 'categories', categoryid]
281279
)
282280
url = services.build_entrypoint_url(API, path)
283281
return services.get_content(url)

istacpy/structuralresources/classifications.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
31
from istacpy import services
42

53
API = 'structural-resources'
@@ -38,7 +36,7 @@ def get_structuralresources_codelist_families_id(id):
3836
Examples:
3937
>>> get_structuralresources_codelist_families_id('CODELIST_ID')
4038
"""
41-
path = os.path.join('codelistfamilies', id)
39+
path = '/'.join(['codelistfamilies', id])
4240
url = services.build_entrypoint_url(API, path)
4341
return services.get_content(url)
4442

@@ -85,7 +83,7 @@ def get_structuralresources_codelists_agency(
8583
>>> get_structuralresources_codelists_agency("ISTAC")
8684
>>> get_structuralresources_codelists_agency("ESTAT")
8785
"""
88-
path = os.path.join('codelists', agencyid)
86+
path = '/'.join(['codelists', agencyid])
8987
url = services.build_entrypoint_url(
9088
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
9189
)
@@ -112,7 +110,7 @@ def get_structuralresources_codelists_agency_resource(
112110
Examples:
113111
>>> get_structuralresources_codelists_agency_resource("ISTAC", "CL_AREA_ES")
114112
"""
115-
path = os.path.join('codelists', agencyid, resourceid)
113+
path = '/'.join(['codelists', agencyid, resourceid])
116114
url = services.build_entrypoint_url(
117115
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
118116
)
@@ -138,7 +136,7 @@ def get_structuralresources_codelists_agency_resource_version(
138136
... "01.000"
139137
... )
140138
"""
141-
path = os.path.join('codelists', agencyid, resourceid, version)
139+
path = '/'.join(['codelists', agencyid, resourceid, version])
142140
url = services.build_entrypoint_url(API, path)
143141
return services.get_content(url)
144142

@@ -181,7 +179,7 @@ def get_structuralresources_codelists_agency_resource_version_codes(
181179
... "01.000"
182180
... )
183181
"""
184-
path = os.path.join('codelists', agencyid, resourceid, version, 'codes')
182+
path = '/'.join(['codelists', agencyid, resourceid, version, 'codes'])
185183
url = services.build_entrypoint_url(
186184
API,
187185
path,
@@ -213,6 +211,6 @@ def get_structuralresources_codelists_agency_resource_version_codes_codeid(
213211
>>> get_structuralresources_codelists_agency_resource_version_codes_codeid(
214212
"ISTAC", "CL_AREA_ES", "01.000", "ES706A01")
215213
"""
216-
path = os.path.join('codelists', agencyid, resourceid, version, 'codes', codeid)
214+
path = '/'.join(['codelists', agencyid, resourceid, version, 'codes', codeid])
217215
url = services.build_entrypoint_url(API, path)
218216
return services.get_content(url)

istacpy/structuralresources/concepts.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
31
from istacpy import services
42

53
API = 'structural-resources'
@@ -67,7 +65,7 @@ def get_structuralresources_concept_schemes_agency(
6765
... orderby="ID ASC"
6866
... )
6967
"""
70-
path = os.path.join('conceptschemes', agencyid)
68+
path = '/'.join(['conceptschemes', agencyid])
7169
url = services.build_entrypoint_url(
7270
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
7371
)
@@ -96,7 +94,7 @@ def get_structuralresources_concept_schemes_agency_resource(
9694
... resourceid="CSM_C00010A_SIE"
9795
... )
9896
"""
99-
path = os.path.join('conceptschemes', agencyid, resourceid)
97+
path = '/'.join(['conceptschemes', agencyid, resourceid])
10098
url = services.build_entrypoint_url(
10199
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
102100
)
@@ -123,7 +121,7 @@ def get_structuralresources_concept_schemes_agency_resource_version(
123121
... version="01.000"
124122
... )
125123
"""
126-
path = os.path.join('conceptschemes', agencyid, resourceid, version)
124+
path = '/'.join(['conceptschemes', agencyid, resourceid, version])
127125
url = services.build_entrypoint_url(API, path)
128126
return services.get_content(url)
129127

@@ -154,7 +152,7 @@ def get_structuralresources_concept_schemes_agency_resource_version_concepts(
154152
... version="01.000"
155153
... )
156154
"""
157-
path = os.path.join('conceptschemes', agencyid, resourceid, version, 'concepts')
155+
path = '/'.join(['conceptschemes', agencyid, resourceid, version, 'concepts'])
158156
url = services.build_entrypoint_url(
159157
API, path, limit=limit, offset=offset, query=query, orderBy=orderby, fields=fields
160158
)
@@ -183,8 +181,8 @@ def get_structuralresources_concept_schemes_agency_resource_version_concepts_id(
183181
... conceptID="ELECTORES"
184182
... )
185183
"""
186-
path = os.path.join(
187-
'conceptschemes', agencyid, resourceid, version, 'concepts', conceptid
184+
path = '/'.join(
185+
['conceptschemes', agencyid, resourceid, version, 'concepts', conceptid]
188186
)
189187
url = services.build_entrypoint_url(API, path)
190188
return services.get_content(url)

istacpy/structuralresources/datastructures.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
31
from istacpy import services
42

53
API = 'structural-resources'
@@ -49,7 +47,7 @@ def get_structuralresources_content_constraints_agency(
4947
Examples:
5048
>>> get_structuralresources_content_constraints_agency("ISTAC")
5149
"""
52-
path = os.path.join('contentConstraints', agencyid)
50+
path = '/'.join(['contentConstraints', agencyid])
5351
url = services.build_entrypoint_url(
5452
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
5553
)
@@ -79,7 +77,7 @@ def get_structuralresources_content_constraints_agency_resource(
7977
... "CSM_C00010A_SIE"
8078
... )
8179
"""
82-
path = os.path.join('contentConstraints', agencyid, resourceid)
80+
path = '/'.join(['contentConstraints', agencyid, resourceid])
8381
url = services.build_entrypoint_url(
8482
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
8583
)
@@ -106,7 +104,7 @@ def get_structuralresources_content_constraints_agency_resource_version(
106104
... "01.000"
107105
... )
108106
"""
109-
path = os.path.join('contentConstraints', agencyid, resourceid, version)
107+
path = '/'.join(['contentConstraints', agencyid, resourceid, version])
110108
url = services.build_entrypoint_url(API, path)
111109
return services.get_content(url)
112110

@@ -135,8 +133,8 @@ def get_structuralresources_content_constraints_agency_resource_version_regions(
135133
... )
136134
"""
137135
path = "contentConstraints"
138-
path = os.path.join(
139-
'contentConstraints', agencyid, resourceid, version, 'regions', regioncode
136+
path = '/'.join(
137+
['contentConstraints', agencyid, resourceid, version, 'regions', regioncode]
140138
)
141139
url = services.build_entrypoint_url(API, path)
142140
return services.get_content(url)
@@ -186,7 +184,7 @@ def get_structuralresources_data_structures_agency(
186184
Examples:
187185
>>> get_structuralresources_data_structures_agency("ISTAC")
188186
"""
189-
path = os.path.join('datastructures', agencyid)
187+
path = '/'.join(['datastructures', agencyid])
190188
url = services.build_entrypoint_url(
191189
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
192190
)
@@ -215,7 +213,7 @@ def get_structuralresources_data_structures_agency_resource(
215213
... "DSD_C00010A_00001"
216214
... )
217215
"""
218-
path = os.path.join('datastructures', agencyid, resourceid)
216+
path = '/'.join(['datastructures', agencyid, resourceid])
219217
url = services.build_entrypoint_url(
220218
API, path, limit=limit, offset=offset, query=query, orderBy=orderby
221219
)
@@ -242,6 +240,6 @@ def get_structuralresources_data_structures_agency_resource_version(
242240
... "01.001"
243241
... )
244242
"""
245-
path = os.path.join('datastructures', agencyid, resourceid, version)
243+
path = '/'.join(['datastructures', agencyid, resourceid, version])
246244
url = services.build_entrypoint_url(API, path)
247245
return services.get_content(url)

0 commit comments

Comments
 (0)