pycen 0.1.0a2__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.
Files changed (33) hide show
  1. pycen-0.1.0a2/LICENSE +21 -0
  2. pycen-0.1.0a2/PKG-INFO +209 -0
  3. pycen-0.1.0a2/README.md +178 -0
  4. pycen-0.1.0a2/pycen/__init__.py +82 -0
  5. pycen-0.1.0a2/pycen/acquire/__init__.py +9 -0
  6. pycen-0.1.0a2/pycen/acquire/get.py +893 -0
  7. pycen-0.1.0a2/pycen/acquire/quick.py +91 -0
  8. pycen-0.1.0a2/pycen/data/census_geos_acs1_2023.json +26 -0
  9. pycen-0.1.0a2/pycen/data/census_geos_acs5_2023.json +72 -0
  10. pycen-0.1.0a2/pycen/data/census_geos_dec_pl_2020.json +103 -0
  11. pycen-0.1.0a2/pycen/data/census_geos_dec_sf1_2010.json +170 -0
  12. pycen-0.1.0a2/pycen/data/counties.json +9619 -0
  13. pycen-0.1.0a2/pycen/datasets.py +19 -0
  14. pycen-0.1.0a2/pycen/explore/__init__.py +7 -0
  15. pycen-0.1.0a2/pycen/explore/lookup.py +41 -0
  16. pycen-0.1.0a2/pycen/explore/metadata.py +141 -0
  17. pycen-0.1.0a2/pycen/explore/search.py +340 -0
  18. pycen-0.1.0a2/pycen/explore/theme_config.py +145 -0
  19. pycen-0.1.0a2/pycen/geography/__init__.py +10 -0
  20. pycen-0.1.0a2/pycen/geography/catalog.py +145 -0
  21. pycen-0.1.0a2/pycen/geography/listing.py +76 -0
  22. pycen-0.1.0a2/pycen/geography/lookup.py +173 -0
  23. pycen-0.1.0a2/pycen/products.py +79 -0
  24. pycen-0.1.0a2/pycen/utils/__init__.py +0 -0
  25. pycen-0.1.0a2/pycen/utils/api.py +52 -0
  26. pycen-0.1.0a2/pycen/utils/cache.py +105 -0
  27. pycen-0.1.0a2/pycen.egg-info/PKG-INFO +209 -0
  28. pycen-0.1.0a2/pycen.egg-info/SOURCES.txt +31 -0
  29. pycen-0.1.0a2/pycen.egg-info/dependency_links.txt +1 -0
  30. pycen-0.1.0a2/pycen.egg-info/requires.txt +14 -0
  31. pycen-0.1.0a2/pycen.egg-info/top_level.txt +2 -0
  32. pycen-0.1.0a2/pyproject.toml +50 -0
  33. pycen-0.1.0a2/setup.cfg +4 -0
pycen-0.1.0a2/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 pycen contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
pycen-0.1.0a2/PKG-INFO ADDED
@@ -0,0 +1,209 @@
1
+ Metadata-Version: 2.4
2
+ Name: pycen
3
+ Version: 0.1.0a2
4
+ Summary: Lightweight Python package for intuitively exploring and acquiring U.S. Census data with spatial integration
5
+ Author: pycen contributors
6
+ License-Expression: MIT
7
+ Keywords: census,acs,demographics,gis,spatial
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Topic :: Scientific/Engineering :: GIS
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: pandas<3.0,>=1.5
18
+ Requires-Dist: requests<3.0,>=2.28
19
+ Requires-Dist: us<4.0,>=2.0
20
+ Requires-Dist: tqdm<5.0,>=4.64
21
+ Requires-Dist: geopandas<1.0,>=0.14
22
+ Requires-Dist: pygris<0.3,>=0.1.6
23
+ Requires-Dist: shapely<3.0,>=2.0
24
+ Requires-Dist: matplotlib<4.0,>=3.5
25
+ Requires-Dist: mapclassify<3.0,>=2.4
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=7.0; extra == "dev"
28
+ Requires-Dist: black>=23.0; extra == "dev"
29
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ # pycen
33
+
34
+ Lightweight Python package for exploring and acquiring U.S. Census data with intuitive spatial integration. <br><br>
35
+
36
+ ```mermaid
37
+ flowchart TD
38
+ A[Need Census data?]
39
+
40
+ A --> B & C
41
+
42
+ subgraph PYCEN["<i>pycen</i>"]
43
+ direction TB
44
+ B[<b>`explore`</b><br/>Intuitive metadata<br/>keyword search]
45
+ C[<b>`acquire`</b><br/>Data + boundaries<br/>in one call]
46
+
47
+ C --> D
48
+ C --> E
49
+
50
+ D[<b>`quick_check`</b><br/>Quality validation]
51
+ E[<b>`quick_viz`</b><br/>Instant maps]
52
+ end
53
+
54
+ B --> F
55
+ D & E --> F[Domain analysis]
56
+
57
+ style A fill:#94a3b8,stroke:#334155,stroke-width:2px,color:#000
58
+ style B fill:#3b82f6,stroke:#1e40af,stroke-width:2px,color:#fff
59
+ style C fill:#3b82f6,stroke:#1e40af,stroke-width:2px,color:#fff
60
+ style D fill:#22c55e,stroke:#15803d,stroke-width:2px,color:#fff
61
+ style E fill:#22c55e,stroke:#15803d,stroke-width:2px,color:#fff
62
+ style F fill:#94a3b8,stroke:#334155,stroke-width:2px,color:#000
63
+ style PYCEN fill:#1e293b,stroke:#64748b,stroke-width:2px,color:#fff
64
+ ```
65
+ ## overview
66
+
67
+ `pycen` makes the exploration and acquisition of U.S. Census data accessible and intuitive for spatial workflows. The `explore` module presents browsable Census API metadata via topic-organized, interactive nested tables, with customizable themes to highlight curated variable recipes. It also supports natural‑language keyword searches for efficient variable discovery. The `acquire` module streamlines data processing: one function call returns both data and boundaries as a GeoDataFrame with built-in quality checks and rapid visualizations;simple tabular or boundaries-only downloads are separately callable. `pycen` pulls live data products with efficient local caches to keep iterations fast, smooth, and reproducible. The multi‑year fetch function enables longitudinal comparisons tracking change over time.
68
+
69
+ ## sample use
70
+
71
+ ```python
72
+ # basic workflow
73
+ import pycen
74
+ from pycen import explore, acquire
75
+
76
+ # 1. Explore variables
77
+ # `browse` and `search` return interactive tables
78
+ # `lookup` returns details
79
+ explore.browse(year=2023, dataset="acs5").show()
80
+ explore.search("vehicle", year=2023, dataset="acs5").show()
81
+ explore.lookup("B08201_002E", year=2021, dataset="acs5")
82
+
83
+ # 2. Acquire data
84
+ ## continental US income gini map
85
+ gdf = acquire.get_censhp(
86
+ variables={"B19083_001E":"gini_index"},
87
+ geography="place", # if no state/county, gets nationwide
88
+ dataset="acs5",
89
+ year=2023,
90
+ )
91
+ acquire.quick_check(gdf) # returns N/A summary
92
+ acquire.quick_viz(gdf, "gini_index") # returns map + distribution histogram
93
+
94
+ ## finer scale
95
+ ## Cook County income gini at tract level
96
+ gdf = acquire.get_censhp(
97
+ variables={"B19083_001E":"gini_index"},
98
+ geography="tract",
99
+ county="Cook County County",
100
+ state="IL",
101
+ dataset="acs5",
102
+ year=2023,
103
+ )
104
+ acquire.quick_viz(gdf, "gini_index")
105
+
106
+ ## neighborhood analyses
107
+ ## Chicago super commuters
108
+ gdf = acquire.get_censhp(
109
+ variables={"B08303_013E":"commute_over_60min", "B08303_001E":"total_commuters"},
110
+ geography="block group",
111
+ county="Cook County",
112
+ state="IL",
113
+ dataset="acs5",
114
+ year=2023,
115
+ clip_to="place", # default off, clip to [place/cbsa/csa]
116
+ place="Chicago city",
117
+ )
118
+ gdf["pct_super_commuters"] = gdf["commute_over_60min"] / gdf["total_commuters"] * 100
119
+ acquire.quick_viz(gdf, "pct_super_commuters")
120
+
121
+ ## decennial data supports block-scale (finest)
122
+ ## Chicago housing vacancy rates at block level
123
+ select_var={
124
+ "H001003": "vacant_hh",
125
+ "H001001": "total_hh"
126
+ }
127
+ gdf = acquire.get_censhp(
128
+ variables=select_var,
129
+ geography="block",
130
+ county="Cook County",
131
+ state="IL",
132
+ dataset="dec_pl",
133
+ year=2010,
134
+ )
135
+ gdf['vacancy_rate'] = gdf['vacant_hh'] / gdf['total_hh'] * 100
136
+ acquire.quick_viz(gdf, "vacancy_rate")
137
+
138
+ # 3. Tabular data only
139
+ df = acquire.get_census(
140
+ variables=["B25032_022E"], # renter-occupied, mobile home
141
+ geography="tract",
142
+ state="CA",
143
+ year=2021,
144
+ )
145
+
146
+ # 4. Multi-year tabular data for trend analysis
147
+ # comparative tracking of remote work surge (2019–2023)
148
+ from pycen import acquire
149
+ import matplotlib.pyplot as plt
150
+
151
+ # explore.search("work from home", year=2023, dataset="acs5").show()
152
+ # B08101_049E = worked from home
153
+ df_long = acquire.get_census(
154
+ variables={'B08101_049E': 'wfh_workers', 'B08101_001E': 'total_workers'},
155
+ geography='county',
156
+ state='CA',
157
+ years=[2019, 2020, 2021, 2022, 2023],
158
+ merge='long'
159
+ )
160
+
161
+ df_long['wfh_pct'] = (df_long['wfh_workers'] / df_long['total_workers']) * 100
162
+ bay_area = df_long[df_long['NAME'].str.contains('San Francisco|Alameda|Santa Clara|Contra Costa|San Mateo')]
163
+
164
+ for county in bay_area['NAME'].unique():
165
+ county_data = bay_area[bay_area['NAME'] == county]
166
+ plt.plot(county_data['year'], county_data['wfh_pct'], marker='o', label=county)
167
+
168
+ plt.title('Bay Area WFH 2019-2023')
169
+ plt.ylabel('Work From Home (%)')
170
+ plt.xlabel('Year')
171
+ plt.legend()
172
+ plt.grid(alpha=0.3)
173
+ plt.tight_layout()
174
+ ```
175
+
176
+ ## core functions
177
+
178
+ Explore
179
+ - `explore.search(query, year, dataset)` - supports exact term match and fuzzy keyword search
180
+ - `explore.browse(year, dataset)` - view all variables via interactive tree table with theme variable highlights
181
+ - `explore.lookup(code, year, dataset)` - inspect variable details
182
+
183
+ Acquire
184
+ - `acquire.get_censhp(...)` - data + boundaries --> GeoDataFrame
185
+ - `acquire.get_census(...)` - data only --> DataFrame
186
+ - `acquire.get_boundaries(...)` - boundaries only --> shp/gpkg
187
+ - `acquire.quick_check(gdf)` - N/A values summary
188
+ - `acquire.quick_viz(gdf, column)` - exploratory map + distribution histogram for select variable
189
+
190
+ Info
191
+ - `pycen.get_product()` - list datasets and years
192
+ - `pycen.get_geography()` - list geography levels by dataset
193
+
194
+ Themes
195
+ - `pycen.set_theme(name_or_dict)` - set active theme name or register a custom theme (dict)
196
+ - `pycen.get_theme_settings()` - get active theme name (defaults to a general curation of useful variables)
197
+ - `pycen.explore.get_theme(name=None)` - get theme details (dict); defaults to active theme
198
+ - `pycen.list_themes()` - list available theme names (includes session custom themes)
199
+
200
+ ## Notes
201
+
202
+ - Datasets: `acs5`, `acs1`, `dec_pl`, `dec_sf1`
203
+ - Spatial features require: `geopandas`, `pygris`
204
+ - Geographies are resolved per dataset/year from Census geography metadata (live/cache/static)
205
+
206
+ API key for higher rate limits:
207
+ ```python
208
+ pycen.set_api_key("YOUR_KEY") # get key at api.census.gov/data/key_signup.html
209
+ ```
@@ -0,0 +1,178 @@
1
+ # pycen
2
+
3
+ Lightweight Python package for exploring and acquiring U.S. Census data with intuitive spatial integration. <br><br>
4
+
5
+ ```mermaid
6
+ flowchart TD
7
+ A[Need Census data?]
8
+
9
+ A --> B & C
10
+
11
+ subgraph PYCEN["<i>pycen</i>"]
12
+ direction TB
13
+ B[<b>`explore`</b><br/>Intuitive metadata<br/>keyword search]
14
+ C[<b>`acquire`</b><br/>Data + boundaries<br/>in one call]
15
+
16
+ C --> D
17
+ C --> E
18
+
19
+ D[<b>`quick_check`</b><br/>Quality validation]
20
+ E[<b>`quick_viz`</b><br/>Instant maps]
21
+ end
22
+
23
+ B --> F
24
+ D & E --> F[Domain analysis]
25
+
26
+ style A fill:#94a3b8,stroke:#334155,stroke-width:2px,color:#000
27
+ style B fill:#3b82f6,stroke:#1e40af,stroke-width:2px,color:#fff
28
+ style C fill:#3b82f6,stroke:#1e40af,stroke-width:2px,color:#fff
29
+ style D fill:#22c55e,stroke:#15803d,stroke-width:2px,color:#fff
30
+ style E fill:#22c55e,stroke:#15803d,stroke-width:2px,color:#fff
31
+ style F fill:#94a3b8,stroke:#334155,stroke-width:2px,color:#000
32
+ style PYCEN fill:#1e293b,stroke:#64748b,stroke-width:2px,color:#fff
33
+ ```
34
+ ## overview
35
+
36
+ `pycen` makes the exploration and acquisition of U.S. Census data accessible and intuitive for spatial workflows. The `explore` module presents browsable Census API metadata via topic-organized, interactive nested tables, with customizable themes to highlight curated variable recipes. It also supports natural‑language keyword searches for efficient variable discovery. The `acquire` module streamlines data processing: one function call returns both data and boundaries as a GeoDataFrame with built-in quality checks and rapid visualizations;simple tabular or boundaries-only downloads are separately callable. `pycen` pulls live data products with efficient local caches to keep iterations fast, smooth, and reproducible. The multi‑year fetch function enables longitudinal comparisons tracking change over time.
37
+
38
+ ## sample use
39
+
40
+ ```python
41
+ # basic workflow
42
+ import pycen
43
+ from pycen import explore, acquire
44
+
45
+ # 1. Explore variables
46
+ # `browse` and `search` return interactive tables
47
+ # `lookup` returns details
48
+ explore.browse(year=2023, dataset="acs5").show()
49
+ explore.search("vehicle", year=2023, dataset="acs5").show()
50
+ explore.lookup("B08201_002E", year=2021, dataset="acs5")
51
+
52
+ # 2. Acquire data
53
+ ## continental US income gini map
54
+ gdf = acquire.get_censhp(
55
+ variables={"B19083_001E":"gini_index"},
56
+ geography="place", # if no state/county, gets nationwide
57
+ dataset="acs5",
58
+ year=2023,
59
+ )
60
+ acquire.quick_check(gdf) # returns N/A summary
61
+ acquire.quick_viz(gdf, "gini_index") # returns map + distribution histogram
62
+
63
+ ## finer scale
64
+ ## Cook County income gini at tract level
65
+ gdf = acquire.get_censhp(
66
+ variables={"B19083_001E":"gini_index"},
67
+ geography="tract",
68
+ county="Cook County County",
69
+ state="IL",
70
+ dataset="acs5",
71
+ year=2023,
72
+ )
73
+ acquire.quick_viz(gdf, "gini_index")
74
+
75
+ ## neighborhood analyses
76
+ ## Chicago super commuters
77
+ gdf = acquire.get_censhp(
78
+ variables={"B08303_013E":"commute_over_60min", "B08303_001E":"total_commuters"},
79
+ geography="block group",
80
+ county="Cook County",
81
+ state="IL",
82
+ dataset="acs5",
83
+ year=2023,
84
+ clip_to="place", # default off, clip to [place/cbsa/csa]
85
+ place="Chicago city",
86
+ )
87
+ gdf["pct_super_commuters"] = gdf["commute_over_60min"] / gdf["total_commuters"] * 100
88
+ acquire.quick_viz(gdf, "pct_super_commuters")
89
+
90
+ ## decennial data supports block-scale (finest)
91
+ ## Chicago housing vacancy rates at block level
92
+ select_var={
93
+ "H001003": "vacant_hh",
94
+ "H001001": "total_hh"
95
+ }
96
+ gdf = acquire.get_censhp(
97
+ variables=select_var,
98
+ geography="block",
99
+ county="Cook County",
100
+ state="IL",
101
+ dataset="dec_pl",
102
+ year=2010,
103
+ )
104
+ gdf['vacancy_rate'] = gdf['vacant_hh'] / gdf['total_hh'] * 100
105
+ acquire.quick_viz(gdf, "vacancy_rate")
106
+
107
+ # 3. Tabular data only
108
+ df = acquire.get_census(
109
+ variables=["B25032_022E"], # renter-occupied, mobile home
110
+ geography="tract",
111
+ state="CA",
112
+ year=2021,
113
+ )
114
+
115
+ # 4. Multi-year tabular data for trend analysis
116
+ # comparative tracking of remote work surge (2019–2023)
117
+ from pycen import acquire
118
+ import matplotlib.pyplot as plt
119
+
120
+ # explore.search("work from home", year=2023, dataset="acs5").show()
121
+ # B08101_049E = worked from home
122
+ df_long = acquire.get_census(
123
+ variables={'B08101_049E': 'wfh_workers', 'B08101_001E': 'total_workers'},
124
+ geography='county',
125
+ state='CA',
126
+ years=[2019, 2020, 2021, 2022, 2023],
127
+ merge='long'
128
+ )
129
+
130
+ df_long['wfh_pct'] = (df_long['wfh_workers'] / df_long['total_workers']) * 100
131
+ bay_area = df_long[df_long['NAME'].str.contains('San Francisco|Alameda|Santa Clara|Contra Costa|San Mateo')]
132
+
133
+ for county in bay_area['NAME'].unique():
134
+ county_data = bay_area[bay_area['NAME'] == county]
135
+ plt.plot(county_data['year'], county_data['wfh_pct'], marker='o', label=county)
136
+
137
+ plt.title('Bay Area WFH 2019-2023')
138
+ plt.ylabel('Work From Home (%)')
139
+ plt.xlabel('Year')
140
+ plt.legend()
141
+ plt.grid(alpha=0.3)
142
+ plt.tight_layout()
143
+ ```
144
+
145
+ ## core functions
146
+
147
+ Explore
148
+ - `explore.search(query, year, dataset)` - supports exact term match and fuzzy keyword search
149
+ - `explore.browse(year, dataset)` - view all variables via interactive tree table with theme variable highlights
150
+ - `explore.lookup(code, year, dataset)` - inspect variable details
151
+
152
+ Acquire
153
+ - `acquire.get_censhp(...)` - data + boundaries --> GeoDataFrame
154
+ - `acquire.get_census(...)` - data only --> DataFrame
155
+ - `acquire.get_boundaries(...)` - boundaries only --> shp/gpkg
156
+ - `acquire.quick_check(gdf)` - N/A values summary
157
+ - `acquire.quick_viz(gdf, column)` - exploratory map + distribution histogram for select variable
158
+
159
+ Info
160
+ - `pycen.get_product()` - list datasets and years
161
+ - `pycen.get_geography()` - list geography levels by dataset
162
+
163
+ Themes
164
+ - `pycen.set_theme(name_or_dict)` - set active theme name or register a custom theme (dict)
165
+ - `pycen.get_theme_settings()` - get active theme name (defaults to a general curation of useful variables)
166
+ - `pycen.explore.get_theme(name=None)` - get theme details (dict); defaults to active theme
167
+ - `pycen.list_themes()` - list available theme names (includes session custom themes)
168
+
169
+ ## Notes
170
+
171
+ - Datasets: `acs5`, `acs1`, `dec_pl`, `dec_sf1`
172
+ - Spatial features require: `geopandas`, `pygris`
173
+ - Geographies are resolved per dataset/year from Census geography metadata (live/cache/static)
174
+
175
+ API key for higher rate limits:
176
+ ```python
177
+ pycen.set_api_key("YOUR_KEY") # get key at api.census.gov/data/key_signup.html
178
+ ```
@@ -0,0 +1,82 @@
1
+ """pycen: Lightweight Python package for U.S. Census data with spatial integration."""
2
+
3
+ __version__ = "0.1.0a2"
4
+
5
+ from pycen import explore, acquire, geography
6
+ from pycen.products import get_product, get_geography
7
+ from pycen.explore.theme_config import list_themes as _list_themes
8
+
9
+ _metadata_cache_enabled = False
10
+ _metadata_cache_path = None
11
+ _theme_name = None
12
+ _api_key = None
13
+
14
+ def set_api_key(key):
15
+ '''Set Census API key for this session.'''
16
+ global _api_key
17
+ _api_key = key
18
+
19
+ def get_api_key():
20
+ '''Return the active Census API key (if set).'''
21
+ return _api_key
22
+
23
+ def enable_metadata_cache(path=None):
24
+ '''Enable on-disk metadata cache.'''
25
+ global _metadata_cache_enabled, _metadata_cache_path
26
+ _metadata_cache_enabled = True
27
+ _metadata_cache_path = path
28
+
29
+ def disable_metadata_cache():
30
+ '''Disable on-disk metadata cache.'''
31
+ global _metadata_cache_enabled
32
+ _metadata_cache_enabled = False
33
+
34
+ def get_metadata_cache_settings():
35
+ '''Return (enabled, path) for metadata cache.'''
36
+ if not _metadata_cache_enabled:
37
+ return (False, None)
38
+ if _metadata_cache_path:
39
+ return (True, _metadata_cache_path)
40
+ from pathlib import Path
41
+ return (True, str(Path.home() / '.pycen' / 'metadata.db'))
42
+
43
+ def set_theme(theme):
44
+ '''
45
+ Set the active search display theme.
46
+
47
+ theme: str theme name or None to reset to default.
48
+ '''
49
+ global _theme_name
50
+ if theme is None or isinstance(theme, str):
51
+ _theme_name = "default" if theme is None else theme
52
+ return
53
+ if isinstance(theme, dict):
54
+ from pycen.explore.theme_config import register_theme
55
+ name = register_theme(theme)
56
+ _theme_name = name
57
+ return
58
+ raise ValueError("theme must be a name (str), dict, or None.")
59
+
60
+ def get_theme_settings():
61
+ '''Return the active theme name (defaults to "default").'''
62
+ return _theme_name or "default"
63
+
64
+ def list_themes():
65
+ '''Return available theme names (built-in + custom).'''
66
+ return _list_themes()
67
+
68
+ __all__ = [
69
+ 'explore',
70
+ 'acquire',
71
+ 'geography',
72
+ 'enable_metadata_cache',
73
+ 'disable_metadata_cache',
74
+ 'get_metadata_cache_settings',
75
+ 'set_api_key',
76
+ 'get_api_key',
77
+ 'set_theme',
78
+ 'get_theme_settings',
79
+ 'list_themes',
80
+ 'get_product',
81
+ 'get_geography'
82
+ ]
@@ -0,0 +1,9 @@
1
+ from pycen.acquire.get import get_census, get_boundaries, get_censhp, join_data
2
+ from pycen.geography.listing import list_places, list_cbsa, list_csa, list_zcta
3
+ from pycen.acquire.quick import quick_check, quick_viz
4
+
5
+ __all__ = [
6
+ 'get_census', 'get_boundaries', 'get_censhp', 'join_data',
7
+ 'list_places', 'list_cbsa', 'list_csa', 'list_zcta',
8
+ 'quick_check', 'quick_viz',
9
+ ]