keeganskeate commited on
Commit
5c9e80e
β€’
1 Parent(s): c0464cb

cannabis-licenses-2023-09-30 (#6)

Browse files

- Fixed data dir and included NY licenses (96e289006d6b39fb681ae10c5aaed5efb113b73e)

Files changed (2) hide show
  1. README.md +2 -2
  2. cannabis_licenses.py +7 -11
README.md CHANGED
@@ -66,7 +66,7 @@ The dataset is partitioned into 18 subsets for each state and the aggregate.
66
  | [Delaware](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/de) | `md` | βœ… |
67
  | [Illinois](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/il) | `il` | βœ… |
68
  | [Maine](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/me) | `me` | βœ… |
69
- | [Maryland](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/md) | `md` | ⚠️ Under development |
70
  | [Massachusetts](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ma) | `ma` | βœ… |
71
  | [Michigan](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/mi) | `mi` | βœ… |
72
  | [Missouri](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/mo) | `mo` | βœ… |
@@ -74,7 +74,7 @@ The dataset is partitioned into 18 subsets for each state and the aggregate.
74
  | [Nevada](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nv) | `nv` | βœ… |
75
  | [New Jersey](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nj) | `nj` | βœ… |
76
  | [New Mexico](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nm) | `nm` | βœ… |
77
- | [New York](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ny) | `ny` | ⚠️ Under development |
78
  | [Oregon](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/or) | `or` | βœ… |
79
  | [Rhode Island](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ri) | `ri` | βœ… |
80
  | [Vermont](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/vt) | `vt` | βœ… |
 
66
  | [Delaware](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/de) | `md` | βœ… |
67
  | [Illinois](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/il) | `il` | βœ… |
68
  | [Maine](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/me) | `me` | βœ… |
69
+ | [Maryland](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/md) | `md` | βœ… |
70
  | [Massachusetts](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ma) | `ma` | βœ… |
71
  | [Michigan](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/mi) | `mi` | βœ… |
72
  | [Missouri](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/mo) | `mo` | βœ… |
 
74
  | [Nevada](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nv) | `nv` | βœ… |
75
  | [New Jersey](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nj) | `nj` | βœ… |
76
  | [New Mexico](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nm) | `nm` | βœ… |
77
+ | [New York](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ny) | `ny` | βœ… |
78
  | [Oregon](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/or) | `or` | βœ… |
79
  | [Rhode Island](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ri) | `ri` | βœ… |
80
  | [Vermont](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/vt) | `vt` | βœ… |
cannabis_licenses.py CHANGED
@@ -6,17 +6,17 @@ Authors:
6
  Keegan Skeate <https://github.com/keeganskeate>
7
  Candace O'Sullivan-Sutherland <https://github.com/candy-o>
8
  Created: 9/29/2022
9
- Updated: 9/19/2023
10
  License: <https://huggingface.co/datasets/cannlytics/cannabis_licenses/blob/main/LICENSE>
11
  """
12
- # External imports.
13
  import datasets
14
  import pandas as pd
15
 
16
 
17
  # Constants.
18
  _SCRIPT = 'cannabis_licenses.py'
19
- _VERSION = '1.0.1'
20
  _HOMEPAGE = 'https://huggingface.co/datasets/cannlytics/cannabis_licenses'
21
  _LICENSE = "https://opendatacommons.org/licenses/by/4-0/"
22
  _DESCRIPTION = """\
@@ -35,7 +35,7 @@ _CITATION = """\
35
  """
36
 
37
 
38
- # Read subsets from local source.
39
  SUBSETS = [
40
  'all',
41
  'ak',
@@ -52,7 +52,7 @@ SUBSETS = [
52
  'mt',
53
  'nj',
54
  'nm',
55
- # 'ny',
56
  'nv',
57
  'or',
58
  'ri',
@@ -107,7 +107,7 @@ class CannabisLicensesConfig(datasets.BuilderConfig):
107
  description = _DESCRIPTION
108
  description += f'This configuration is for the `{name}` subset.'
109
  super().__init__(
110
- data_dir='./data',
111
  description=description,
112
  name=name,
113
  **kwargs,
@@ -137,11 +137,7 @@ class CannabisLicenses(datasets.GeneratorBasedBuilder):
137
  def _split_generators(self, dl_manager):
138
  """Returns SplitGenerators."""
139
  subset = self.config.name
140
- # Deprecated: Use the data from the Cannlytics Hugging Face repository.
141
- # https://huggingface.co/datasets/cannlytics/cannabis_licenses/raw/main/
142
- # data_url = SUBSETS[config_name]['data_url']
143
- # TEST: Use local data.
144
- data_url = f'./data/{subset}/licenses-{subset}-latest.csv'
145
  urls = {subset: data_url}
146
  downloaded_files = dl_manager.download_and_extract(urls)
147
  params = {'filepath': downloaded_files[subset]}
 
6
  Keegan Skeate <https://github.com/keeganskeate>
7
  Candace O'Sullivan-Sutherland <https://github.com/candy-o>
8
  Created: 9/29/2022
9
+ Updated: 9/30/2023
10
  License: <https://huggingface.co/datasets/cannlytics/cannabis_licenses/blob/main/LICENSE>
11
  """
12
+ # External imports:
13
  import datasets
14
  import pandas as pd
15
 
16
 
17
  # Constants.
18
  _SCRIPT = 'cannabis_licenses.py'
19
+ _VERSION = '1.0.2'
20
  _HOMEPAGE = 'https://huggingface.co/datasets/cannlytics/cannabis_licenses'
21
  _LICENSE = "https://opendatacommons.org/licenses/by/4-0/"
22
  _DESCRIPTION = """\
 
35
  """
36
 
37
 
38
+ # Define subsets.
39
  SUBSETS = [
40
  'all',
41
  'ak',
 
52
  'mt',
53
  'nj',
54
  'nm',
55
+ 'ny',
56
  'nv',
57
  'or',
58
  'ri',
 
107
  description = _DESCRIPTION
108
  description += f'This configuration is for the `{name}` subset.'
109
  super().__init__(
110
+ data_dir='data',
111
  description=description,
112
  name=name,
113
  **kwargs,
 
137
  def _split_generators(self, dl_manager):
138
  """Returns SplitGenerators."""
139
  subset = self.config.name
140
+ data_url = f'data/{subset}/licenses-{subset}-latest.csv'
 
 
 
 
141
  urls = {subset: data_url}
142
  downloaded_files = dl_manager.download_and_extract(urls)
143
  params = {'filepath': downloaded_files[subset]}