Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compress data files to save space #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/license_expression/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
The main entry point is the Licensing object.
"""

import gzip
import itertools
import json
import re
Expand Down Expand Up @@ -60,7 +61,7 @@
data_dir = join(curr_dir, 'data')
vendored_scancode_licensedb_index_location = join(
data_dir,
'scancode-licensedb-index.json',
'scancode-licensedb-index.json.gz',
)

# append new error codes to PARSE_ERRORS by monkey patching
Expand Down Expand Up @@ -830,7 +831,7 @@ def get_license_index(
The default value of `license_index_location` points to a vendored copy
of the license index from https://scancode-licensedb.aboutcode.org/
"""
with open(license_index_location) as f:
with gzip.open(license_index_location, "rt") as f:
return json.load(f)


Expand Down
Loading
Loading