Skip to content

Commit

Permalink
respect PYSTORE_PATH if set
Browse files Browse the repository at this point in the history
  • Loading branch information
ranaroussi committed Sep 27, 2020
1 parent 79fc038 commit e0af12a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ Using PyStore
import pystore
import quandl
# Set storage path (optional, default is `~/pystore`)
# Set storage path (optional)
# Defaults to `~/pystore` or `PYSTORE_PATH` environment variable (if set)
pystore.set_path("~/pystore")
# List stores
Expand Down
5 changes: 3 additions & 2 deletions pystore/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from os.path import expanduser as _expanduser
import os as os
from .utils import Path

DEFAULT_PATH = _expanduser("~/pystore")
DEFAULT_PATH = os.environ.get("PYSTORE_PATH", Path.home() / "pystore")
DEFAULT_PARTITION_SIZE = 99e+6 # ~99MB
PARTITION_SIZE = 99e+6 # ~99MB

Expand Down

0 comments on commit e0af12a

Please sign in to comment.